1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 Templated basic entry that holds a constant value.
30 Usage - for entry \<entryName\> having the value <value>:
32 <entryName> constant <value>
38 \*---------------------------------------------------------------------------*/
43 #include "DataEntry.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 Ostream& operator<<(Ostream&, const Constant<Type>&);
56 /*---------------------------------------------------------------------------*\
57 Class Constant Declaration
58 \*---------------------------------------------------------------------------*/
63 public DataEntry<Type>
71 // Private Member Functions
73 //- Disallow default bitwise assignment
74 void operator=(const Constant<Type>&);
79 // Runtime type information
85 //- Construct from entry name and Istream
86 Constant(const word& entryName, Istream& is);
89 Constant(const Constant<Type>& cnst);
91 //- Construct and return a clone
92 virtual tmp<DataEntry<Type> > clone() const
94 return tmp<DataEntry<Type> >(new Constant<Type>(*this));
104 //- Return constant value
105 Type value(const scalar) const;
107 //- Integrate between two values
108 Type integrate(const scalar x1, const scalar x2) const;
112 friend Ostream& operator<< <Type>(Ostream&, const Constant<Type>&);
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 } // End namespace Foam
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 # include "Constant.C"
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 // ************************************************************************* //