51#ifndef Foam_expressions_exprTraits_H
52#define Foam_expressions_exprTraits_H
107 const word& dataTypeName,
142 static constexpr const char*
const name =
"";
145 ::Foam::expressions::valueTypeCode
value =
148 static constexpr ::Foam::direction
rank = 0;
150 static constexpr ::Foam::direction
nComponents = 0;
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
Tensor of scalars, i.e. Tensor<scalar>.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
#define defineExprTypeTraits(Type, Name, Rank, NumCmpts)
Implementation details for various OpenFOAM classes.
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
::Foam::direction rank(const expressions::valueTypeCode) noexcept
The vector-space rank associated with given valueTypeCode.
A namespace for expression-related classes/traits etc.
valueTypeCode valueTypeCodeOf(const word &dataTypeName, const expressions::valueTypeCode deflt=expressions::valueTypeCode::INVALID)
From string to valueTypeCode (if any).
valueTypeCode
An enumeration of known and expected expression value types.
@ type_sphericalTensor
Type is 'sphericalTensor'.
@ type_symmTensor
Type is 'symmTensor'.
@ type_scalar
Type is 'scalar'.
@ type_label
Type is 'label'.
@ type_vector
Type is 'vector'.
@ NONE
No type, or default initialized type.
@ type_bool
Type is 'bool'.
@ INVALID
Invalid/unknown/error type.
@ type_tensor
Type is 'tensor'.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Simple type identifiers for polymorphic expression values. The definitions are similar to std::integr...
static constexpr const char *const name
static constexpr ::Foam::direction rank
static constexpr ::Foam::direction nComponents
static constexpr::Foam::expressions::valueTypeCode value
word operator()(const expressions::valueTypeCode typeCode) const
Extract name (as a word) from an object, typically using its name() method.
word operator()(const T &obj) const