88inline void Foam::expressions::exprValue::fill_zero()
91 const auto oldType(typeCode_);
121 <<
"Cannot construct for unsupported type: "
122 <<
typeid(Type).
name() <<
nl
191 data_.set<Type>(val);
192 typeCode_ = whichCode;
exprValue()
Default construct (zero-initialized) as 'none'.
bool set(const Type &val)
Assign from type. Returns false and sets to 'none' for unsupported types.
bool is_integral() const noexcept
True if the value type is an integral (bool or label).
const Type & get() const
Return the value. Return pTraits zero if the types mismatch.
word listCompoundName() const
The name for the compound token (for a List of values). Eg, List<scalar>, List<vector> ....
bool good() const noexcept
True if the value type is not none/invalid.
static bool supportedType()
True if the specified type is supported.
const Type * isA() const noexcept
Return non-null pointer to the data element (if types match). Can also be tested as a bool.
word valueTypeName() const
The name for the value type. Similar to pTraits typeName.
direction nComponents() const noexcept
The number of components associated with the value type.
direction rank() const noexcept
The vector-space rank associated with the value type.
static bool good(const expressions::valueTypeCode) noexcept
True if valueTypeCode is not none/invalid.
A traits class, which is primarily used for primitives and vector-space.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
::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.
valueTypeCode
An enumeration of known and expected expression value types.
@ type_label
Type is 'label'.
@ NONE
No type, or default initialized type.
@ type_bool
Type is 'bool'.
@ INVALID
Invalid/unknown/error type.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
errorManip< error > abort(error &err)
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
constexpr char nl
The newline '\n' character (0x0a).
static constexpr::Foam::expressions::valueTypeCode value