fieldTypes.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-2016 OpenFOAM Foundation
9  Copyright (C) 2018-2025 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 Namespace
28  Foam::fieldTypes
29 
30 Description
31  Collection of common field types
32 
33 Note
34  The fieldTypes header contains macros for primitive types
35  that Fields are instantiated for.
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef Foam_fieldTypes_H
40 #define Foam_fieldTypes_H
41 
42 #include "label.H"
43 #include "scalar.H"
44 #include "vector.H"
45 #include "sphericalTensor.H"
46 #include "symmTensor.H"
47 #include "tensor.H"
48 #include "triad.H"
49 #include "macros.H"
50 #include "wordList.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 #define CAPITALIZE_bool Bool
55 #define CAPITALIZE_label Label
56 #define CAPITALIZE_scalar Scalar
57 #define CAPITALIZE_complex Complex
58 #define CAPITALIZE_vector Vector
59 #define CAPITALIZE_sphericalTensor SphericalTensor
60 #define CAPITALIZE_symmTensor SymmTensor
61 #define CAPITALIZE_tensor Tensor
62 
63 #define FOR_ALL_FIELD_TYPES(Macro, ...) \
64  Macro(scalar, __VA_ARGS__) \
65  Macro(vector, __VA_ARGS__) \
66  Macro(sphericalTensor, __VA_ARGS__) \
67  Macro(symmTensor, __VA_ARGS__) \
68  Macro(tensor, __VA_ARGS__)
69 
70 
71 /*---------------------------------------------------------------------------*\
72  Namespace fieldTypes Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 namespace Foam
76 {
77 namespace fieldTypes
78 {
79 
80 //- Standard basic field types (label, scalar, vector, tensor, etc)
81 // These also correspond to cloud output fields.
82 extern const wordList basic;
83 
84 //- Test if the class name appears to be a basic field
85 bool is_basic(const word& clsName);
86 
87 
88 // Commonly used patch field types
89 
90 //- An \c empty patch field type
91 inline const char* emptyTypeName_() noexcept { return "empty"; }
92 
93 //- An \c empty patch field type
94 extern const word emptyType;
95 
96 //- A \c calculated patch field type
97 inline const char* calculatedTypeName_() noexcept { return "calculated"; }
98 
99 //- A \c calculated patch field type
100 extern const word calculatedType;
101 
102 //- A combined \c zero-gradient and \c calculated patch field type
103 inline const char* extrapolatedCalculatedTypeName_() noexcept
104 {
105  return "extrapolatedCalculated";
106 }
107 
108 //- A combined \c zero-gradient and \c calculated patch field type
109 extern const word extrapolatedCalculatedType;
110 
111 //- A \c processor patch field type
112 inline const char* processorTypeName_() noexcept { return "processor"; }
113 
114 //- A \c processor patch field type
115 extern const word processorType;
116 
117 //- A \c zeroGradient patch field type
118 inline const char* zeroGradientTypeName_() noexcept { return "zeroGradient"; }
119 
120 //- A \c zeroGradient patch field type
121 extern const word zeroGradientType;
122 
123 //- A \c zeroValue patch field type
124 inline const char* zeroValueTypeName_() noexcept { return "zeroValue"; }
126 //- A \c zeroValue patch field type
127 extern const word zeroValueType;
128 
129 } // End namespace fieldTypes
130 } // End namespace Foam
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #endif
136 // ************************************************************************* //
const char * calculatedTypeName_() noexcept
A calculated patch field type.
Definition: fieldTypes.H:102
const word zeroGradientType
A zeroGradient patch field type.
const char * zeroValueTypeName_() noexcept
A zeroValue patch field type.
Definition: fieldTypes.H:145
const word calculatedType
A calculated patch field type.
const char * zeroGradientTypeName_() noexcept
A zeroGradient patch field type.
Definition: fieldTypes.H:135
General C-preprocessor macros.
A class for handling words, derived from Foam::string.
Definition: word.H:63
const word processorType
A processor patch field type.
const direction noexcept
Definition: scalarImpl.H:265
const char * extrapolatedCalculatedTypeName_() noexcept
A combined zero-gradient and calculated patch field type.
Definition: fieldTypes.H:112
const wordList basic
Standard basic field types (label, scalar, vector, tensor, etc)
const word emptyType
An empty patch field type.
List< word > wordList
List of word.
Definition: fileName.H:59
const char * emptyTypeName_() noexcept
An empty patch field type.
Definition: fieldTypes.H:92
const char * processorTypeName_() noexcept
A processor patch field type.
Definition: fieldTypes.H:125
bool is_basic(const word &clsName)
Test if the class name appears to be a basic field.
Definition: fieldTypes.C:73
const word extrapolatedCalculatedType
A combined zero-gradient and calculated patch field type.
const word zeroValueType
A zeroValue patch field type.
Namespace for OpenFOAM.