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-2022 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
34  For entry <name> returning the value <value>:
35  \verbatim
36  <name> uniform <value>
37  \endverbatim
38 
39 SourceFiles
40  Uniform.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef Uniform_H
45 #define Uniform_H
46 
47 #include "Function1.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 namespace Function1s
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class Uniform Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class Type>
61 class Uniform
62 :
63  public Constant<Type>
64 {
65 
66 public:
67 
68  // Runtime type information
69  TypeName("uniform");
70 
71 
72  // Constructors
73 
74  //- Construct from name and dictionary
75  Uniform(const word& name, const dictionary& dict);
76 
77 
78  // Member Operators
79 
80  //- Disallow default bitwise assignment
81  void operator=(const Uniform<Type>&) = delete;
82 };
83 
84 
85 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86 
87 } // End namespace Function1s
88 } // End namespace Foam
89 
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92 #ifdef NoRepository
93  #include "Uniform.C"
94 #endif
95 
96 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
97 
98 #endif
99 
100 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
void operator=(const Uniform< Type > &)=delete
Disallow default bitwise assignment.
const word & name() const
Return the name of the entry.
Definition: Function1.C:82
A class for handling words, derived from string.
Definition: word.H:59
Uniform(const word &name, const dictionary &dict)
Construct from name and dictionary.
Definition: Uniform.C:32
Templated function that returns a constant value.
Definition: Constant.H:57
Templated function that returns a constant value.
Definition: Uniform.H:60
Namespace for OpenFOAM.