Uniform.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) 2020-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 Class
28  Foam::Function1Types::Uniform
29 
30 Description
31  Templated function that returns a constant value.
32 
33  Provides backward-compatibility for cases where a field is spatially
34  "uniform" and may be treated as a constant value.
35 
36  Usage - for entry <entryName> returning the value <value>:
37  \verbatim
38  <entryName> uniform <value>
39  \endverbatim
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef Function1Types_Uniform_H
44 #define Function1Types_Uniform_H
45 
46 #include "Constant.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 public:
65 
66  //- Declare type-name, virtual type (with debug switch)
67  TypeName("uniform");
68 
69 
70  // Generated Methods
71 
72  //- Copy construct
73  Uniform<Type>(const Uniform&) = default;
74 
75  //- No copy assignment
76  void operator=(const Uniform<Type>&) = delete;
77 
78 
79  // Constructors
80 
81  //- Construct from entry name, dictionary and optional registry
83  (
84  const word& entryName,
85  const dictionary& dict,
86  const objectRegistry* obrPtr = nullptr
87  )
88  :
89  Constant<Type>(entryName, dict, obrPtr)
90  {}
91 };
92 
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 } // End namespace Function1Types
97 } // End namespace Foam
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 #endif
102 
103 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::Function1::entryName
const word & entryName
Definition: Function1.H:133
Foam::Function1::dict
const word const dictionary & dict
Definition: Function1.H:134
Foam::Function1Types::Uniform::TypeName
TypeName("uniform")
Declare type-name, virtual type (with debug switch)
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::Function1::obrPtr
const word const dictionary const objectRegistry * obrPtr
Definition: Function1.H:136
Foam::Function1Types::Uniform::operator=
void operator=(const Uniform< Type > &)=delete
No copy assignment.
Foam::Function1Types::Constant
Templated function that returns a constant value.
Definition: Constant.H:72
Foam::Function1Types::Uniform
Templated function that returns a constant value.
Definition: Uniform.H:59
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::Function1Types::Uniform::Uniform
Uniform(const Uniform &)=default
Copy construct.
Constant.H