An expressions::exprValue (polymorphic typed union) with an additional flag for tracking Field content as uniform etc. More...
Classes | |
struct | combineOp |
Binary combine operator, e.g. for global reduction. More... | |
Public Member Functions | |
exprValueFieldTag ()=default | |
Default construct. Uniformity = empty, type = none. More... | |
exprValueFieldTag (const exprValueFieldTag &)=default | |
Copy construct. More... | |
exprValueFieldTag & | operator= (const exprValueFieldTag &)=default |
Copy assignment. More... | |
template<class Type > | |
exprValueFieldTag (const Type &val) | |
Construct as uniform with the specified type/value. More... | |
template<class Type > | |
exprValueFieldTag (const Type *first, const Type *last) | |
Construct from a range of values. More... | |
bool | empty () const noexcept |
True if the uniformity is "empty". More... | |
bool | is_uniform () const noexcept |
True if the uniformity is "uniform". More... | |
bool | is_nonuniform () const noexcept |
True if the uniformity is "non-uniform". More... | |
const expressions::exprValue & | value () const noexcept |
Representative (uniform) value for the field. More... | |
int | compare (const exprValueFieldTag &rhs) const |
Compare (uniformity, type, value) More... | |
bool | equal (const exprValueFieldTag &rhs) const |
Test for equality of the values. More... | |
template<class Type > | |
void | set (const Type *first, const Type *last) |
Set value and uniformity from range of data. More... | |
template<class Type > | |
void | set_value (const Type &val) |
Set as uniform, with specified value. More... | |
template<class Type > | |
void | set_zero () |
Set type and zero value (does not affect uniformity) More... | |
void | set_empty () |
Set as empty with zero value, leave type unchanged. More... | |
void | set_nouniform () |
Set as non-uniform with zero value, leave type unchanged. More... | |
void | reduce () |
Inplace parallel reduction, uses worldComm. More... | |
void | combine (const exprValueFieldTag &b) |
Inplace combine - eg, for global uniformity. More... | |
void | read (Istream &is) |
Read uniformity label and the value as pair. More... | |
void | write (Ostream &os) const |
Write uniformity label and the value as pair. More... | |
void | print (Ostream &os) const |
Print description to Ostream. More... | |
void | operator= (const Foam::zero) |
Assign from zero. Changes value but not type. More... | |
bool | operator== (const exprValueFieldTag &) const |
Compare (uniformity,value) for equality. More... | |
bool | operator!= (const exprValueFieldTag &rhs) const |
Compare (uniformity,value) for inequality. More... | |
bool | operator< (const exprValueFieldTag &) const |
Compare (uniformity,value) More... | |
Static Public Member Functions | |
template<class Type > | |
static exprValueFieldTag | make_empty () |
Make an empty field tag with the specified type (zero-value) More... | |
static exprValueFieldTag | returnReduce (const exprValueFieldTag &tag) |
Perform a reduction on a copy and return the result. More... | |
An expressions::exprValue (polymorphic typed union) with an additional flag for tracking Field content as uniform etc.
Definition at line 50 of file exprValueFieldTag.H.
|
default |
Default construct. Uniformity = empty, type = none.
|
default |
Copy construct.
|
inlineexplicit |
Construct as uniform with the specified type/value.
Definition at line 93 of file exprValueFieldTag.H.
References exprValueFieldTag::set_value().
|
inlineexplicit |
Construct from a range of values.
Definition at line 102 of file exprValueFieldTag.H.
|
default |
Copy assignment.
|
inlinestatic |
Make an empty field tag with the specified type (zero-value)
Definition at line 114 of file exprValueFieldTag.H.
References exprValueFieldTag::set_zero().
|
noexcept |
True if the uniformity is "empty".
Definition at line 26 of file exprValueFieldTag.C.
References Foam::Detail::ListPolicy::EMPTY.
Referenced by exprValueFieldTag::combine().
|
noexcept |
True if the uniformity is "uniform".
Definition at line 35 of file exprValueFieldTag.C.
References Foam::Detail::ListPolicy::UNIFORM.
Referenced by exprValueFieldTag::combine().
|
noexcept |
True if the uniformity is "non-uniform".
Definition at line 44 of file exprValueFieldTag.C.
References Foam::Detail::ListPolicy::NONUNIFORM.
|
noexcept |
Representative (uniform) value for the field.
Definition at line 56 of file exprValueFieldTag.C.
int compare | ( | const exprValueFieldTag & | rhs | ) | const |
Compare (uniformity, type, value)
Definition at line 77 of file exprValueFieldTag.C.
bool equal | ( | const exprValueFieldTag & | rhs | ) | const |
Test for equality of the values.
Definition at line 97 of file exprValueFieldTag.C.
Referenced by exprValueFieldTag::combine().
|
inline |
Set value and uniformity from range of data.
Definition at line 161 of file exprValueFieldTag.H.
References Foam::Detail::ListPolicy::check_uniformity(), and exprValue::set().
|
inline |
Set as uniform, with specified value.
Definition at line 181 of file exprValueFieldTag.H.
References exprValue::set(), and Foam::Detail::ListPolicy::UNIFORM.
Referenced by exprValueFieldTag::exprValueFieldTag().
|
inline |
Set type and zero value (does not affect uniformity)
Definition at line 191 of file exprValueFieldTag.H.
References exprValue::set().
Referenced by exprValueFieldTag::make_empty().
void set_empty | ( | ) |
Set as empty with zero value, leave type unchanged.
Definition at line 62 of file exprValueFieldTag.C.
References Foam::Detail::ListPolicy::EMPTY.
void set_nouniform | ( | ) |
Set as non-uniform with zero value, leave type unchanged.
Definition at line 69 of file exprValueFieldTag.C.
References Foam::Detail::ListPolicy::NONUNIFORM.
Referenced by exprValueFieldTag::combine().
void reduce | ( | ) |
Inplace parallel reduction, uses worldComm.
Definition at line 105 of file exprValueFieldTag.C.
References Foam::Detail::ListPolicy::EMPTY, UPstream::is_parallel(), UPstream::msgType(), Foam::reduce(), Foam::Detail::ListPolicy::UNIFORM, and UPstream::worldComm.
Referenced by exprValueFieldTag::returnReduce().
|
static |
Perform a reduction on a copy and return the result.
Definition at line 175 of file exprValueFieldTag.C.
References exprValueFieldTag::reduce().
void combine | ( | const exprValueFieldTag & | b | ) |
Inplace combine - eg, for global uniformity.
Definition at line 186 of file exprValueFieldTag.C.
References Foam::constant::physicoChemical::b, exprValueFieldTag::empty(), exprValueFieldTag::equal(), exprValueFieldTag::is_uniform(), and exprValueFieldTag::set_nouniform().
Referenced by exprValueFieldTag::combineOp::operator()().
void read | ( | Istream & | is | ) |
Read uniformity label and the value as pair.
Definition at line 246 of file exprValueFieldTag.C.
References Istream::readBegin(), and Istream::readEnd().
Referenced by Foam::operator>>().
void write | ( | Ostream & | os | ) | const |
Write uniformity label and the value as pair.
Definition at line 260 of file exprValueFieldTag.C.
References token::BEGIN_LIST, token::END_LIST, os(), and token::SPACE.
Referenced by Foam::operator<<().
void print | ( | Ostream & | os | ) | const |
Print description to Ostream.
Definition at line 269 of file exprValueFieldTag.C.
References os().
|
inline |
Assign from zero. Changes value but not type.
Definition at line 268 of file exprValueFieldTag.H.
bool operator== | ( | const exprValueFieldTag & | rhs | ) | const |
Compare (uniformity,value) for equality.
Definition at line 221 of file exprValueFieldTag.C.
|
inline |
Compare (uniformity,value) for inequality.
Definition at line 278 of file exprValueFieldTag.H.
bool operator< | ( | const exprValueFieldTag & | rhs | ) | const |
Compare (uniformity,value)
Definition at line 238 of file exprValueFieldTag.C.