All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Uniform.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::Function1s::Uniform
26 
27 Description
28  Templated function that returns a constant value.
29 
30  Provides backward-compatibility for cases where a field is spatially
31  "uniform" and may be treated as a constant value.
32 
33  Usage - for entry <entryName> returning the value <value>:
34  \verbatim
35  <entryName> uniform <value>
36  \endverbatim
37 
38 SourceFiles
39  Uniform.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef Uniform_H
44 #define Uniform_H
45 
46 #include "Function1.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace Function1s
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class Uniform Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class Type>
60 class Uniform
61 :
62  public Constant<Type>
63 {
64 
65 public:
66 
67  // Runtime type information
68  TypeName("uniform");
69 
70 
71  // Constructors
72 
73  //- Construct from entry name and dictionary
74  Uniform(const word& entryName, const dictionary& dict);
75 
76 
77  // Member Operators
78 
79  //- Disallow default bitwise assignment
80  void operator=(const Uniform<Type>&) = delete;
81 };
82 
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 } // End namespace Function1s
87 } // End namespace Foam
88 
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90 
91 #ifdef NoRepository
92  #include "Uniform.C"
93 #endif
94 
95 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97 #endif
98 
99 // ************************************************************************* //
const word const dictionary & dict
Definition: Function1.H:84
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
void operator=(const Uniform< Type > &)=delete
Disallow default bitwise assignment.
const word & entryName
Definition: Function1.H:84
A class for handling words, derived from string.
Definition: word.H:59
Templated function that returns a constant value.
Definition: Constant.H:56
Uniform(const word &entryName, const dictionary &dict)
Construct from entry name and dictionary.
Definition: Uniform.C:32
Templated function that returns a constant value.
Definition: Uniform.H:59
Namespace for OpenFOAM.