ConstantFieldI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2017 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "ConstantField.H"
30 
31 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32 
33 template<class Type>
36 (
37  const scalar x
38 ) const
39 {
40  if (this->coordSys_.active())
41  {
42  return this->transform(value_);
43  }
44 
45  return value_;
46 }
47 
48 
49 template<class Type>
52 (
53  const scalar x1,
54  const scalar x2
55 ) const
56 {
57  if (this->coordSys_.active())
58  {
59  return (x2 - x1) * this->transform(value_);
60  }
61 
62  return (x2 - x1)*value_;
63 }
64 
65 
66 // ************************************************************************* //
ConstantField.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::transform
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Definition: dimensionSet.C:519
Foam::PatchFunction1Types::ConstantField::value
virtual tmp< Field< Type > > value(const scalar x) const
Return constant value.
Definition: ConstantFieldI.H:36
Foam::PatchFunction1Types::ConstantField::integrate
virtual tmp< Field< Type > > integrate(const scalar x1, const scalar x2) const
Integrate between two values.
Definition: ConstantFieldI.H:52
x
x
Definition: LISASMDCalcMethod2.H:52