Loading...
Searching...
No Matches
exprValueFieldTag Class Reference

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

#include <exprValueFieldTag.H>

Classes

struct  combineOp
 Binary combine operator, e.g. for global reduction. More...

Public Member Functions

 exprValueFieldTag ()=default
 Default construct. Uniformity = empty, type = none.
 exprValueFieldTag (const exprValueFieldTag &)=default
 Copy construct.
exprValueFieldTagoperator= (const exprValueFieldTag &)=default
 Copy assignment.
template<class Type>
 exprValueFieldTag (const Type &val)
 Construct as uniform with the specified type/value.
template<class Type>
 exprValueFieldTag (const Type *first, const Type *last)
 Construct from a range of values.
bool empty () const noexcept
 True if the uniformity is "empty".
bool is_uniform () const noexcept
 True if the uniformity is "uniform".
bool is_nonuniform () const noexcept
 True if the uniformity is "non-uniform".
const expressions::exprValuevalue () const noexcept
 Representative (uniform) value for the field.
int compare (const exprValueFieldTag &rhs) const
 Compare (uniformity, type, value).
bool equal (const exprValueFieldTag &rhs) const
 Test for equality of the values.
template<class Type>
void set (const Type *first, const Type *last)
 Set value and uniformity from range of data.
template<class Type>
void set_value (const Type &val)
 Set as uniform, with specified value.
template<class Type>
void set_zero ()
 Set type and zero value (does not affect uniformity).
void set_empty ()
 Set as empty with zero value, leave type unchanged.
void set_nouniform ()
 Set as non-uniform with zero value, leave type unchanged.
void reduce ()
 Inplace parallel reduction, uses worldComm.
void combine (const exprValueFieldTag &b)
 Inplace combine - eg, for global uniformity.
void read (Istream &is)
 Read uniformity label and the value as pair.
void write (Ostream &os) const
 Write uniformity label and the value as pair.
void print (Ostream &os) const
 Print description to Ostream.
void operator= (Foam::zero)
 Assign from zero. Changes value but not type.
bool operator== (const exprValueFieldTag &) const
 Compare (uniformity,value) for equality.
bool operator!= (const exprValueFieldTag &rhs) const
 Compare (uniformity,value) for inequality.
bool operator< (const exprValueFieldTag &) const
 Compare (uniformity,value).

Static Public Member Functions

template<class Type>
static exprValueFieldTag make_empty ()
 Make an empty field tag with the specified type (zero-value).
static exprValueFieldTag returnReduce (const exprValueFieldTag &tag)
 Perform a reduction on a copy and return the result.

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.

Referenced by combine(), compare(), equal(), exprValueFieldTag(), make_empty(), operator!=(), exprValueFieldTag::combineOp::operator()(), operator<(), operator=(), operator==(), and returnReduce().

Here is the caller graph for this function:

◆ exprValueFieldTag() [2/4]

exprValueFieldTag ( const exprValueFieldTag & )
default

Copy construct.

References exprValueFieldTag().

Here is the call graph for this function:

◆ exprValueFieldTag() [3/4]

template<class Type>
exprValueFieldTag ( const Type & val)
inlineexplicit

Construct as uniform with the specified type/value.

Definition at line 93 of file exprValueFieldTag.H.

References set_value().

Here is the call graph for this function:

◆ exprValueFieldTag() [4/4]

template<class Type>
exprValueFieldTag ( const Type * first,
const Type * last )
inlineexplicit

Construct from a range of values.

Definition at line 102 of file exprValueFieldTag.H.

References set().

Here is the call graph for this function:

Member Function Documentation

◆ operator=() [1/2]

exprValueFieldTag & operator= ( const exprValueFieldTag & )
default

Copy assignment.

References exprValueFieldTag().

Here is the call graph for this function:

◆ make_empty()

template<class Type>
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(), and 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::ListPolicy::EMPTY, and Foam::noexcept.

Referenced by 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::noexcept, and Foam::ListPolicy::UNIFORM.

Referenced by 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::noexcept, and Foam::ListPolicy::NONUNIFORM.

◆ value()

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

Representative (uniform) value for the field.

Definition at line 56 of file exprValueFieldTag.C.

References Foam::noexcept.

◆ compare()

int compare ( const exprValueFieldTag & rhs) const

Compare (uniformity, type, value).

Definition at line 76 of file exprValueFieldTag.C.

References exprValueFieldTag(), and Foam::rhs().

Referenced by operator<().

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

◆ equal()

bool equal ( const exprValueFieldTag & rhs) const

Test for equality of the values.

Definition at line 96 of file exprValueFieldTag.C.

References exprValueFieldTag(), and Foam::rhs().

Referenced by combine().

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

◆ set()

template<class Type>
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::ListPolicy::check_uniformity(), and set().

Referenced by exprValueFieldTag(), and set().

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

◆ set_value()

template<class Type>
void set_value ( const Type & val)
inline

Set as uniform, with specified value.

Definition at line 180 of file exprValueFieldTag.H.

References Foam::ListPolicy::UNIFORM.

Referenced by exprValueFieldTag().

Here is the caller graph for this function:

◆ set_zero()

template<class Type>
void set_zero ( )
inline

Set type and zero value (does not affect uniformity).

Definition at line 190 of file exprValueFieldTag.H.

Referenced by make_empty().

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::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::ListPolicy::NONUNIFORM.

Referenced by combine(), and reduce().

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::ListPolicy::EMPTY, UPstream::is_parallel(), UPstream::msgType(), Foam::reduce(), set_nouniform(), Foam::ListPolicy::UNIFORM, and UPstream::worldComm.

Referenced by 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 174 of file exprValueFieldTag.C.

References exprValueFieldTag(), and reduce().

Here is the call graph for this function:

◆ combine()

void combine ( const exprValueFieldTag & b)

Inplace combine - eg, for global uniformity.

Definition at line 185 of file exprValueFieldTag.C.

References b, empty(), equal(), exprValueFieldTag(), is_uniform(), and 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().

Here is the call 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.

Here is the call 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= ( Foam::zero )
inline

Assign from zero. Changes value but not type.

Definition at line 267 of file exprValueFieldTag.H.

◆ operator==()

bool operator== ( const exprValueFieldTag & rhs) const

Compare (uniformity,value) for equality.

Definition at line 220 of file exprValueFieldTag.C.

References exprValueFieldTag(), and Foam::rhs().

Here is the call graph for this function:

◆ operator!=()

bool operator!= ( const exprValueFieldTag & rhs) const
inline

Compare (uniformity,value) for inequality.

Definition at line 277 of file exprValueFieldTag.H.

References exprValueFieldTag(), and Foam::rhs().

Here is the call graph for this function:

◆ operator<()

bool operator< ( const exprValueFieldTag & rhs) const

Compare (uniformity,value).

Definition at line 237 of file exprValueFieldTag.C.

References compare(), exprValueFieldTag(), and Foam::rhs().

Here is the call graph for this function:

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