faePatchFieldMacros.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) 2016 Wikki Ltd
9  Copyright (C) 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 Description
28  Macros for creating faePatchField types.
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef Foam_faePatchFieldMacros_H
33 #define Foam_faePatchFieldMacros_H
34 
35 #include "fieldTypes.H"
36 #include "faePatchField.H"
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 // Runtime selection macros
40 
41 #define addToFaePatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField)\
42  \
43  addToRunTimeSelectionTable \
44  ( \
45  PatchTypeField, \
46  typePatchTypeField, \
47  patch \
48  ); \
49  addToRunTimeSelectionTable \
50  ( \
51  PatchTypeField, \
52  typePatchTypeField, \
53  patchMapper \
54  ); \
55  addToRunTimeSelectionTable \
56  ( \
57  PatchTypeField, \
58  typePatchTypeField, \
59  dictionary \
60  );
61 
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 // For non-templated (or typedef) patch fields.
66 //- Define a concrete faePatchField type and add to run-time tables
67 //- Example, (faePatchScalarField, calculatedFaePatchScalarField)
68 #define makeFaePatchTypeField(PatchTypeField, typePatchTypeField) \
69  \
70  defineTypeNameAndDebug(typePatchTypeField, 0); \
71  addToFaePatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField);
72 
73 //- Define a faePatchField type for a specific field type
74 //- Example, (scalar, calculated)
75 #define makeFaePatchFieldTypeName(fieldType, bcType) \
76  defineNamedTemplateTypeNameAndDebug \
77  ( \
78  CAT4(bcType, FaePatch, CAPITALIZE(fieldType), Field), \
79  0 \
80  );
81 
82 //- Add runTime selection for faePatchField type of a specific field type
83 //- Example, (scalar, calculated)
84 #define addFaePatchFieldTypeRunTime(fieldType, bcType) \
85  addToFaePatchFieldRunTimeSelection \
86  ( \
87  CAT3(faePatch, CAPITALIZE(fieldType), Field), \
88  CAT4(bcType, FaePatch, CAPITALIZE(fieldType), Field) \
89  );
90 
91 // For templated patch fields
92 #define makeFaePatchFieldType(fieldType, bcType) \
93  makeFaePatchFieldTypeName(fieldType, bcType) \
94  addFaePatchFieldTypeRunTime(fieldType, bcType)
95 
96 //- Declare a typedef for a faePatchField. Example, (scalar, calculated)
97 #define makeFaePatchFieldTypedef(fieldType, bcType) \
98  typedef \
99  bcType##FaePatchField<fieldType> \
100  CAT4(bcType, FaePatch, CAPITALIZE(fieldType), Field);
101 
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 //- For all standard field types:
106 //- define a faePatchField type and add to run-time tables
107 #define makeFaePatchFields(bcType) \
108  \
109  makeFaePatchFieldType(scalar, bcType); \
110  makeFaePatchFieldType(vector, bcType); \
111  makeFaePatchFieldType(sphericalTensor, bcType); \
112  makeFaePatchFieldType(symmTensor, bcType); \
113  makeFaePatchFieldType(tensor, bcType);
114 
115 
116 //- For all standard field types: define a faePatchField type
117 //- Example, (calculated)
118 #define makeFaePatchFieldsTypeName(bcType) \
119  \
120  makeFaePatchFieldTypeName(scalar, bcType); \
121  makeFaePatchFieldTypeName(vector, bcType); \
122  makeFaePatchFieldTypeName(sphericalTensor, bcType); \
123  makeFaePatchFieldTypeName(symmTensor, bcType); \
124  makeFaePatchFieldTypeName(tensor, bcType);
125 
126 
127 //- For all standard field types: define typedefs for the faePatchField
128 //- Example, (calculated)
129 #define makeFaePatchTypeFieldTypedefs(bcType) \
130  \
131  makeFaePatchFieldTypedef(scalar, bcType); \
132  makeFaePatchFieldTypedef(vector, bcType); \
133  makeFaePatchFieldTypedef(sphericalTensor, bcType); \
134  makeFaePatchFieldTypedef(symmTensor, bcType); \
135  makeFaePatchFieldTypedef(tensor, bcType);
136 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //