mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Function1: Optimized field evaluations
This commit is contained in:
committed by
Andrew Heather
parent
2f431ffd3d
commit
3b6eb380d0
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -85,17 +85,20 @@ Foam::Function1Types::Constant<Type>::~Constant()
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Type Foam::Function1Types::Constant<Type>::value(const scalar x) const
|
||||
Foam::tmp<Foam::Field<Type>> Foam::Function1Types::Constant<Type>::value
|
||||
(
|
||||
const scalarField& x
|
||||
) const
|
||||
{
|
||||
return value_;
|
||||
return tmp<Field<Type>>(new Field<Type>(x.size(), value_));
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Type Foam::Function1Types::Constant<Type>::integrate
|
||||
Foam::tmp<Foam::Field<Type>> Foam::Function1Types::Constant<Type>::integrate
|
||||
(
|
||||
const scalar x1,
|
||||
const scalar x2
|
||||
const scalarField& x1,
|
||||
const scalarField& x2
|
||||
) const
|
||||
{
|
||||
return (x2 - x1)*value_;
|
||||
|
||||
Reference in New Issue
Block a user