|
[Sponsors] |
January 27, 2023, 06:19 |
FOR_ALL_FIELD_TYPES in OpenFOAM
|
#1 |
New Member
do
Join Date: Jan 2023
Posts: 1
Rep Power: 0 |
Hi, formers,
I'm trying to understand what does "FOR_ALL_FIELD_TYPES" function do in source codes in OpenFOAM. I have found this function at "fieldTypes.H" and its definition is written below: Code:
Description Include the header files for all the primitive types that Fields are instantiated for. \*---------------------------------------------------------------------------*/ #ifndef fieldTypes_H #define fieldTypes_H #include "label.H" #include "scalar.H" #include "vector.H" #include "sphericalTensor.H" #include "symmTensor.H" #include "tensor.H" #include "triad.H" #include "macros.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #define CAPITALIZE_scalar Scalar #define CAPITALIZE_vector Vector #define CAPITALIZE_sphericalTensor SphericalTensor #define CAPITALIZE_symmTensor SymmTensor #define CAPITALIZE_tensor Tensor #define FOR_ALL_FIELD_TYPES(Macro, ...) \ Macro(scalar, __VA_ARGS__) \ Macro(vector, __VA_ARGS__) \ Macro(sphericalTensor, __VA_ARGS__) \ Macro(symmTensor, __VA_ARGS__) \ Macro(tensor, __VA_ARGS__) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* // I tried to search what does "Macro" means with grep utility, but i have not found anything helpful. Does anyone knows anything about those "FOR_ALL_FIELD_TYPES" and "Macro" functions? |
|
September 25, 2023, 17:14 |
|
#2 |
New Member
Liu Yajing
Join Date: Apr 2022
Posts: 4
Rep Power: 4 |
My understanding. According to the Macro syntax, ‘Macro’ is the first parameter of FOR_ALL_TYPE_FIELD, which is also a function name because it puts before (). For example, the 'Macro' is 'makePatchFieldTypeName', then FOR_ALL_TYPE_FIELD means makePatchFieldTypeName(scalar, __VA_ARGS__)
makePatchFieldTypeName(vector, __VA_ARGS__) ... |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Frequently Asked Questions about Installing OpenFOAM | wyldckat | OpenFOAM Installation | 3 | November 14, 2023 11:58 |
How to develop OpenFOAM with CMake and popular IDEs | cosscholar | OpenFOAM Programming & Development | 0 | March 16, 2022 15:17 |
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 | cfd.direct | OpenFOAM Announcements from Other Sources | 2 | August 31, 2015 13:36 |
Suggestion for a new sub-forum at OpenFOAM's Forum | wyldckat | Site Help, Feedback & Discussions | 20 | October 28, 2014 09:04 |
64bitrhel5 OF installation instructions | mirko | OpenFOAM Installation | 2 | August 12, 2008 18:07 |