patchExprFieldBase.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) 2011-2018 Bernhard Gschaider
9  Copyright (C) 2019-2020 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::expressions::patchExprFieldBase
29 
30 Description
31  Base class for managing patches with expressions.
32  The expected input supports value, gradient and mixed conditions.
33 
34 Usage
35  \table
36  Property | Description | Required | Default
37  valueExpr | expression for uniformValue | partly | 0
38  gradientExpr | expression for uniformGradient | partly | 0
39  fractionExpr | expression for valueFraction | partly | depends
40  \endtable
41 
42 SourceFiles
43  patchExprFieldBase.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef expressions_patchExprFieldBase_H
48 #define expressions_patchExprFieldBase_H
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 #include "dictionary.H"
53 #include "exprString.H"
54 
55 namespace Foam
56 {
57 namespace expressions
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class patchExprFieldBase Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class patchExprFieldBase
65 {
66 protected:
67 
68  // Protected Types
69 
70  //- Enumeration of expected expressions
71  enum expectedTypes
72  {
73  VALUE_TYPE = 1,
74  GRADIENT_TYPE = 2,
75  MIXED_TYPE = 3
76  };
77 
78 
79  // Protected Data
80 
81  //- Add debugging
82  bool debug_;
83 
84  //- Slightly dodgy concept here
85  bool evalOnConstruct_;
86 
87  // The expressions
91 
92 
93 private:
94 
95  // Private Member Functions
96 
97  //- Read expressions from dictionary
98  void readExpressions
99  (
100  const dictionary& dict,
101  enum expectedTypes expectedType,
102  bool wantPointData = false
103  );
104 
105 
106 public:
107 
108  // Generated Methods: copy construct, copy assignment
109 
110 
111  // Constructors
112 
113  //- Default construct
115 
116  //- Construct from dictionary
117  explicit patchExprFieldBase
118  (
119  const dictionary& dict,
120  enum expectedTypes expectedType = expectedTypes::VALUE_TYPE,
121  bool wantPointData = false
122  );
123 
124 
125  // Member Functions
126 
127  //- Write
128  void write(Ostream& os) const;
129 };
130 
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 } // End namespace expressions
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
Foam::expressions::patchExprFieldBase::debug_
bool debug_
Add debugging.
Definition: patchExprFieldBase.H:101
Foam::expressions::patchExprFieldBase::expectedTypes
expectedTypes
Enumeration of expected expressions.
Definition: patchExprFieldBase.H:90
exprString.H
Foam::expressions::patchExprFieldBase::gradExpr_
expressions::exprString gradExpr_
Definition: patchExprFieldBase.H:108
Foam::expressions::patchExprFieldBase
Base class for managing patches with expressions. The expected input supports value,...
Definition: patchExprFieldBase.H:83
Foam::expressions::patchExprFieldBase::patchExprFieldBase
patchExprFieldBase()
Default construct.
Definition: patchExprFieldBase.C:141
Foam::expressions::patchExprFieldBase::VALUE_TYPE
Definition: patchExprFieldBase.H:92
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::expressions::patchExprFieldBase::fracExpr_
expressions::exprString fracExpr_
Definition: patchExprFieldBase.H:109
Foam::expressions::patchExprFieldBase::GRADIENT_TYPE
Definition: patchExprFieldBase.H:93
Foam::expressions::patchExprFieldBase::write
void write(Ostream &os) const
Write.
Definition: patchExprFieldBase.C:170
Foam::expressions::exprString
Definition: exprString.H:60
dictionary.H
Foam::expressions::patchExprFieldBase::MIXED_TYPE
Definition: patchExprFieldBase.H:94
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::expressions::patchExprFieldBase::valueExpr_
expressions::exprString valueExpr_
Definition: patchExprFieldBase.H:107
Foam::expressions::patchExprFieldBase::evalOnConstruct_
bool evalOnConstruct_
Slightly dodgy concept here.
Definition: patchExprFieldBase.H:104