areaFields.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) 2016-2017 Wikki Ltd
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 "faMesh.H"
30 #include "areaFields.H"
31 #include "coupledFaPatchField.H"
32 #include "registerSwitch.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 
44 
50 
52 (
54  "areaScalarField::Boundary",
55  0
56 );
58 (
60  "areaVectorField::Boundary",
61  0
62 );
64 (
66  "areaSphericalTensorField::Boundary",
67  0
68 );
70 (
72  "areaSymmTensorField::Boundary",
73  0
74 );
76 (
78  "areaTensorField::Boundary",
79  0
80 );
81 
83 (
84  debug::floatOptimisationSwitch("areaScalarField::Boundary::tolerance", 0)
85 );
87 (
88  "areaScalarField::Boundary::tolerance",
89  scalar,
91 );
92 
94 (
95  debug::floatOptimisationSwitch("areaVectorField::Boundary::tolerance", 0)
96 );
98 (
99  "areaVectorField::Boundary::tolerance",
100  scalar,
102 );
103 
105 (
107  (
108  "areaSphericalTensorField::Boundary::tolerance",
109  0
110  )
111 );
113 (
114  "areaSphericalTensorField::Boundary::tolerance",
115  scalar,
117 );
118 
120 (
122  (
123  "areaSymmTensorField::Boundary::tolerance",
124  0
125  )
126 );
128 (
129  "areaSymmTensorField::Boundary::tolerance",
130  scalar,
132 );
133 
134 template<> scalar areaTensorField::Boundary::tolerance
135 (
136  debug::floatOptimisationSwitch("areaTensorField::Boundary::tolerance", 0)
137 );
139 (
140  "areaTensorField::Boundary::tolerance",
141  scalar,
143 );
144 
145 
146 // Local-ops consistency enforcing
147 
149 (
150  debug::optimisationSwitch("localConsistency", 1)
151 );
153 (
154  "areaScalarField::Boundary::localConsistency",
155  int,
157 );
158 
160 (
161  debug::optimisationSwitch("localConsistency", 1)
162 );
164 (
165  "areaVectorField::Boundary::localConsistency",
166  int,
168 );
169 
171 (
172  debug::optimisationSwitch("localConsistency", 1)
173 );
175 (
176  "areaSphericalTensorField::Boundary::localConsistency",
177  int,
179 );
180 
182 (
183  debug::optimisationSwitch("localConsistency", 1)
184 );
186 (
187  "areaSymmTensorField::Boundary::localConsistency",
188  int,
190 );
191 
193 (
194  debug::optimisationSwitch("localConsistency", 1)
195 );
197 (
198  "areaTensorField::Boundary::localConsistency",
199  int,
201 );
202 
203 } // End namespace Foam
204 
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 // Specializations
210 namespace Foam
211 {
212 
213 template<>
216 (
217  const direction
218 ) const
219 {
220  return *this;
221 }
222 
223 template<>
225 (
226  const direction,
228 )
229 {
230  *this == gsf;
231 }
232 
233 template<>
235 {
236  return checkConsistency<coupledFaPatchField<scalar>>
237  (
239  !(debug&4) // make into warning if debug&4
240  );
241 }
242 
243 template<>
245 {
246  return checkConsistency<coupledFaPatchField<vector>>
247  (
249  !(debug&4) // make into warning if debug&4
250  );
251 }
252 
253 template<>
255 () const
256 {
257  return checkConsistency<coupledFaPatchField<sphericalTensor>>
258  (
260  !(debug&4) // make into warning if debug&4
261  );
262 }
263 
264 template<>
266 {
267  return checkConsistency<coupledFaPatchField<symmTensor>>
268  (
270  !(debug&4) // make into warning if debug&4
271  );
272 }
273 
274 template<>
276 {
277  return checkConsistency<coupledFaPatchField<tensor>>
278  (
280  !(debug&4) // make into warning if debug&4
281  );
282 }
283 
284 } // End namespace Foam
285 
286 
287 // * * * * * * * * * * * * * * * * Global Data * * * * * * * * * * * * * * * //
288 
289 // Note hard-coded values are more reliable than other alternatives
290 
292 ({
293  "areaScalarField",
294  "areaVectorField",
295  "areaSphericalTensorField",
296  "areaSymmTensorField",
297  "areaTensorField"
298 });
299 
301 ({
302  "areaScalarField::Internal",
303  "areaVectorField::Internal",
304  "areaSphericalTensorField::Internal",
305  "areaSymmTensorField::Internal",
306  "areaTensorField::Internal"
307 });
308 
309 
310 // ************************************************************************* //
registerOptSwitch("fa:geometryOrder", int, faMesh::geometryOrder_)
uint8_t direction
Definition: direction.H:46
tmp< GeometricField< cmptType, PatchField, GeoMesh > > component(const direction) const
Return a component of the field.
GeometricField< symmTensor, faPatchField, areaMesh > areaSymmTensorField
Definition: areaFieldsFwd.H:84
Generic GeometricField class.
Definition: areaFieldsFwd.H:50
static scalar tolerance
User-defined tolerance (for consistency checks)
GeometricBoundaryField< scalar, faPatchField, areaMesh > Boundary
Type of boundary fields.
defineTemplateDebugSwitchWithName(areaScalarField::Boundary, "areaScalarField::Boundary", 0)
DimensionedField< scalar, areaMesh > Internal
The internal field type from which this GeometricField is derived.
const wordList area
Standard area field types (scalar, vector, tensor, etc)
GeometricField< tensor, faPatchField, areaMesh > areaTensorField
Definition: areaFieldsFwd.H:85
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.
GeometricField< sphericalTensor, faPatchField, areaMesh > areaSphericalTensorField
Definition: areaFieldsFwd.H:83
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 area_internal
Standard dimensioned field types (scalar, vector, tensor, etc)
A class for managing temporary objects.
Definition: HashPtrTable.H:50
GeometricField< vector, faPatchField, areaMesh > areaVectorField
Definition: areaFieldsFwd.H:81
Namespace for OpenFOAM.
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
Definition: areaFieldsFwd.H:80