ConstantI.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) 2021 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 "Constant.H"
30 
31 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32 
33 template<class Type>
34 inline void Foam::Function1Types::Constant<Type>::reset(const Type& val)
35 {
36  value_ = val;
37 }
38 
39 
40 template<class Type>
41 inline Type Foam::Function1Types::Constant<Type>::value(const scalar) const
42 {
43  return value_;
44 }
45 
46 
47 template<class Type>
49 (
50  const scalar x1,
51  const scalar x2
52 ) const
53 {
54  return Type((x2 - x1)*value_);
55 }
56 
57 
58 // ************************************************************************* //
Foam::Function1Types::Constant::reset
void reset(const Type &val)
Change the constant value.
Definition: ConstantI.H:34
Foam::Function1Types::Constant::integrate
virtual Type integrate(const scalar x1, const scalar x2) const
Integrate between two values.
Definition: ConstantI.H:49
Constant.H
Foam::Function1Types::Constant::value
virtual Type value(const scalar) const
Return constant value.
Definition: ConstantI.H:41