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-2018 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::Function1Types::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 Function1Types
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class Uniform Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class Type>
60 class Uniform
61 :
62  public Constant<Type>
63 {
64  // Private Member Functions
65 
66  //- Disallow default bitwise assignment
67  void operator=(const Uniform<Type>&);
68 
69 
70 public:
71 
72  // Runtime type information
73  TypeName("uniform");
74 
75 
76  // Constructors
77 
78  //- Construct from entry name and dictionary
79  Uniform(const word& entryName, const dictionary& dict);
80 };
81 
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 } // End namespace Function1Types
86 } // End namespace Foam
87 
88 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89 
90 #ifdef NoRepository
91  #include "Uniform.C"
92 #endif
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 #endif
97 
98 // ************************************************************************* //
const word const dictionary & dict
Definition: Function1.H:90
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Templated function that returns a constant value.
Definition: Uniform.H:59
const word & entryName
Definition: Function1.H:90
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
Namespace for OpenFOAM.