51 #ifndef Foam_expressions_exprTraits_H 52 #define Foam_expressions_exprTraits_H 107 const word& dataTypeName,
137 struct exprTypeTraits
142 static constexpr
const char*
const name =
"";
154 #undef defineExprTypeTraits 155 #define defineExprTypeTraits(Type, Name, Rank, NumCmpts) \ 158 struct exprTypeTraits<Type> \ 160 typedef Type value_type; \ 161 static constexpr const char* const name = #Name ; \ 163 ::Foam::expressions::valueTypeCode value = \ 164 ::Foam::expressions::valueTypeCode::type_##Name ; \ 165 static constexpr ::Foam::direction rank = Rank ; \ 166 static constexpr ::Foam::direction nComponents = NumCmpts ; \ 180 #undef defineExprTypeTraits
Type is 'sphericalTensor'.
No type, or default initialized type.
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
Type is 'scalar'.
Extract name (as a word) from an object, typically using its name() method.
Type is 'vector'.
Invalid/unknown/error type.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
valueTypeCode
An enumeration of known and expected expression value types.
static constexpr ::Foam::direction rank
valueTypeCode valueTypeCodeOf(const word &dataTypeName, const expressions::valueTypeCode deflt=expressions::valueTypeCode::INVALID)
From string to valueTypeCode (if any)
Type is 'tensor'.
static constexpr ::Foam::expressions::valueTypeCode value
word operator()(const T &obj) const
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
static constexpr const char *const name
::Foam::direction rank(const expressions::valueTypeCode) noexcept
The vector-space rank associated with given valueTypeCode.
#define defineExprTypeTraits(Type, Name, Rank, NumCmpts)
Type is 'symmTensor'.
static constexpr ::Foam::direction nComponents
Tensor of scalars, i.e. Tensor<scalar>.