Function1: Optimized field evaluations

This commit is contained in:
Henry Weller
2017-08-08 10:16:08 +01:00
committed by Andrew Heather
parent 2f431ffd3d
commit 3b6eb380d0
43 changed files with 677 additions and 265 deletions

View File

@ -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_;