volFields.C
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-2016 OpenFOAM Foundation
9  Copyright (C) 2018,2023 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 \*---------------------------------------------------------------------------*/
28 
29 #include "volFields.H"
30 #include "coupledFvPatchField.H"
31 #include "registerSwitch.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 
43 
49 
51 (
53  "volScalarField::Boundary",
54  0
55 );
57 (
59  "volVectorField::Boundary",
60  0
61 );
63 (
65  "volSphericalTensorField::Boundary",
66  0
67 );
69 (
71  "volSymmTensorField::Boundary",
72  0
73 );
75 (
77  "volTensorField::Boundary",
78  0
79 );
80 
81 
82 // Tolerance optimisation switch
83 
85 (
86  debug::floatOptimisationSwitch("volScalarField::Boundary::tolerance", 0)
87 );
89 (
90  "volScalarField::Boundary::tolerance",
91  scalar,
93 );
94 
96 (
97  debug::floatOptimisationSwitch("volScalarField::Boundary::tolerance", 0)
98 );
100 (
101  "volVectorField::Boundary::tolerance",
102  scalar,
104 );
105 
107 (
109  (
110  "volSphericalTensorField::Boundary::tolerance",
111  0
112  )
113 );
115 (
116  "volSphericalTensorField::Boundary::tolerance",
117  scalar,
119 );
120 
122 (
124  (
125  "volSymmTensorField::Boundary::tolerance",
126  0
127  )
128 );
130 (
131  "volSymmTensorField::Boundary::tolerance",
132  scalar,
134 );
135 
136 template<> scalar volTensorField::Boundary::tolerance
137 (
138  debug::floatOptimisationSwitch("volTensorField::Boundary::tolerance", 0)
139 );
141 (
142  "volTensorField::Boundary::tolerance",
143  scalar,
145 );
146 
147 
148 // Local-ops consistency enforcing
149 
151 (
152  debug::optimisationSwitch("localConsistency", 1)
153 );
155 (
156  "volScalarField::Boundary::localConsistency",
157  int,
159 );
160 
162 (
163  debug::optimisationSwitch("localConsistency", 1)
164 );
166 (
167  "volVectorField::Boundary::localConsistency",
168  int,
170 );
171 
173 (
174  debug::optimisationSwitch("localConsistency", 1)
175 );
177 (
178  "volSphericalTensorField::Boundary::localConsistency",
179  int,
181 );
182 
184 (
185  debug::optimisationSwitch("localConsistency", 1)
186 );
188 (
189  "volSymmTensorField::Boundary::localConsistency",
190  int,
192 );
193 
195 (
196  debug::optimisationSwitch("localConsistency", 1)
197 );
199 (
200  "volTensorField::Boundary::localConsistency",
201  int,
203 );
204 
205 
206 } // End namespace Foam
207 
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 // Specializations
213 namespace Foam
214 {
215 
216 template<>
219 (
220  const direction
221 ) const
222 {
223  return *this;
224 }
225 
226 
227 template<>
229 (
230  const direction,
232 )
233 {
234  *this == gsf;
235 }
236 
237 
238 template<>
240 {
241  return checkConsistency<coupledFvPatchField<scalar>>
242  (
244  !(debug&4) // make into warning if debug&4
245  );
246 }
247 
248 template<>
250 {
251  return checkConsistency<coupledFvPatchField<vector>>
252  (
254  !(debug&4) // make into warning if debug&4
255  );
256 }
257 
258 template<>
260 () const
261 {
262  return checkConsistency<coupledFvPatchField<sphericalTensor>>
263  (
265  !(debug&4) // make into warning if debug&4
266  );
267 }
268 
269 template<>
271 () const
272 {
273  return checkConsistency<coupledFvPatchField<symmTensor>>
274  (
276  !(debug&4) // make into warning if debug&4
277  );
278 }
279 
280 template<>
282 () const
283 {
284  return checkConsistency<coupledFvPatchField<tensor>>
285  (
287  !(debug&4) // make into warning if debug&4
288  );
289 }
290 
291 } // End namespace Foam
292 
293 
294 // * * * * * * * * * * * * * * * * Global Data * * * * * * * * * * * * * * * //
295 
296 // Note hard-coded values are more reliable than other alternatives
297 
299 ({
300  "volScalarField::Internal",
301  "volVectorField::Internal",
302  "volSphericalTensorField::Internal",
303  "volSymmTensorField::Internal",
304  "volTensorField::Internal"
305 });
306 
307 
309 ({
310  "volScalarField",
311  "volVectorField",
312  "volSphericalTensorField",
313  "volSymmTensorField",
314  "volTensorField"
315 });
316 
317 
318 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
registerOptSwitch("fa:geometryOrder", int, faMesh::geometryOrder_)
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
Definition: volFieldsFwd.H:85
uint8_t direction
Definition: direction.H:46
GeometricField< tensor, fvPatchField, volMesh > volTensorField
Definition: volFieldsFwd.H:86
tmp< GeometricField< cmptType, PatchField, GeoMesh > > component(const direction) const
Return a component of the field.
Generic GeometricField class.
Definition: areaFieldsFwd.H:50
static scalar tolerance
User-defined tolerance (for consistency checks)
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
Type of boundary fields.
defineTemplateDebugSwitchWithName(areaScalarField::Boundary, "areaScalarField::Boundary", 0)
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:82
DimensionedField< scalar, volMesh > Internal
The internal field type from which this GeometricField is derived.
GeometricField< sphericalTensor, fvPatchField, volMesh > volSphericalTensorField
Definition: volFieldsFwd.H:84
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
const wordList volume
Standard volume field types (scalar, vector, tensor, etc)
int optimisationSwitch(const char *name, const int deflt=0)
Lookup optimisation switch or add default value.
Definition: debug.C:234
int debug
Static debugging option.
defineTemplateTypeNameAndDebug(faScalarMatrix, 0)
static void check(const int retVal, const char *what)
float floatOptimisationSwitch(const char *name, const float deflt=0)
Lookup optimisation switch or add default value.
Definition: debug.C:240
const wordList internal
Standard dimensioned field types (scalar, vector, tensor, etc)
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.