exprValueFieldTag Class Reference

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...
 
exprValueFieldTagoperator= (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::exprValuevalue () 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...
 

Detailed Description

An expressions::exprValue (polymorphic typed union) with an additional flag for tracking Field content as uniform etc.

Source files

Definition at line 50 of file exprValueFieldTag.H.

Constructor & Destructor Documentation

◆ exprValueFieldTag() [1/4]

exprValueFieldTag ( )
default

Default construct. Uniformity = empty, type = none.

◆ exprValueFieldTag() [2/4]

exprValueFieldTag ( const exprValueFieldTag )
default

Copy construct.

◆ exprValueFieldTag() [3/4]

exprValueFieldTag ( const Type &  val)
inlineexplicit

Construct as uniform with the specified type/value.

Definition at line 93 of file exprValueFieldTag.H.

References exprValueFieldTag::set_value().

Here is the call graph for this function:

◆ exprValueFieldTag() [4/4]

exprValueFieldTag ( const Type *  first,
const Type *  last 
)
inlineexplicit

Construct from a range of values.

Definition at line 102 of file exprValueFieldTag.H.

Member Function Documentation

◆ operator=() [1/2]

exprValueFieldTag& operator= ( const exprValueFieldTag )
default

Copy assignment.

◆ make_empty()

static exprValueFieldTag make_empty ( )
inlinestatic

Make an empty field tag with the specified type (zero-value)

Definition at line 114 of file exprValueFieldTag.H.

References exprValueFieldTag::set_zero().

Here is the call graph for this function:

◆ empty()

bool empty ( ) const
noexcept

True if the uniformity is "empty".

Definition at line 26 of file exprValueFieldTag.C.

References Foam::Detail::ListPolicy::EMPTY.

Referenced by exprValueFieldTag::combine().

Here is the caller graph for this function:

◆ is_uniform()

bool is_uniform ( ) const
noexcept

True if the uniformity is "uniform".

Definition at line 35 of file exprValueFieldTag.C.

References Foam::Detail::ListPolicy::UNIFORM.

Referenced by exprValueFieldTag::combine().

Here is the caller graph for this function:

◆ is_nonuniform()

bool is_nonuniform ( ) const
noexcept

True if the uniformity is "non-uniform".

Definition at line 44 of file exprValueFieldTag.C.

References Foam::Detail::ListPolicy::NONUNIFORM.

◆ value()

const Foam::expressions::exprValue & value ( ) const
noexcept

Representative (uniform) value for the field.

Definition at line 56 of file exprValueFieldTag.C.

◆ compare()

int compare ( const exprValueFieldTag rhs) const

Compare (uniformity, type, value)

Definition at line 77 of file exprValueFieldTag.C.

◆ equal()

bool equal ( const exprValueFieldTag rhs) const

Test for equality of the values.

Definition at line 97 of file exprValueFieldTag.C.

Referenced by exprValueFieldTag::combine().

Here is the caller graph for this function:

◆ set()

void set ( const Type *  first,
const Type *  last 
)
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().

Here is the call graph for this function:

◆ set_value()

void set_value ( const Type &  val)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_zero()

void set_zero ( )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_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.

◆ set_nouniform()

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().

Here is the caller graph for this function:

◆ reduce()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ returnReduce()

Foam::expressions::exprValueFieldTag returnReduce ( const exprValueFieldTag tag)
static

Perform a reduction on a copy and return the result.

Definition at line 175 of file exprValueFieldTag.C.

References exprValueFieldTag::reduce().

Here is the call graph for this function:

◆ combine()

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()().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read()

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>>().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write()

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<<().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print()

void print ( Ostream os) const

Print description to Ostream.

Definition at line 269 of file exprValueFieldTag.C.

References os().

Here is the call graph for this function:

◆ operator=() [2/2]

void operator= ( const Foam::zero  )
inline

Assign from zero. Changes value but not type.

Definition at line 268 of file exprValueFieldTag.H.

◆ operator==()

bool operator== ( const exprValueFieldTag rhs) const

Compare (uniformity,value) for equality.

Definition at line 221 of file exprValueFieldTag.C.

◆ operator!=()

bool operator!= ( const exprValueFieldTag rhs) const
inline

Compare (uniformity,value) for inequality.

Definition at line 278 of file exprValueFieldTag.H.

◆ operator<()

bool operator< ( const exprValueFieldTag rhs) const

Compare (uniformity,value)

Definition at line 238 of file exprValueFieldTag.C.


The documentation for this class was generated from the following files: