A stack of polymorphic fields. Can be used to build a list of results one at a time. More...
#include <exprResultStack.H>


Public Member Functions | |
| TypeName ("exprResultStack") | |
| Runtime type information. | |
| exprResultStack () | |
| Default construct. | |
| exprResultStack (const exprResultStack &rhs) | |
| Copy construct. | |
| exprResultStack (const dictionary &dict) | |
| Construct from a dictionary. | |
| virtual autoPtr< exprResult > | clone () const |
| Clone. | |
| virtual | ~exprResultStack ()=default |
| Destructor. | |
| exprResult | pop () |
| Pop the last value as an expression result. | |
| void | push (const exprResult &result) |
| Push an expression result value. | |
| void | operator= (const exprResultStack &rhs) |
| Copy assignment. | |
| void | operator= (const exprResult &rhs) |
| Copy assignment. | |
| Public Member Functions inherited from exprResult | |
| TypeName ("exprResult") | |
| Runtime type information. | |
| declareRunTimeSelectionTable (autoPtr, exprResult, dictionary,(const dictionary &dict),(dict)) | |
| declareRunTimeSelectionTable (autoPtr, exprResult, empty,(),()) | |
| exprResult () | |
| Default construct. | |
| exprResult (const exprResult &expr) | |
| Copy construct. | |
| exprResult (exprResult &&expr) | |
| Move construct. | |
| exprResult (const dictionary &dict, const bool singleValueOnly=false, const bool valueReqd=false) | |
| Construct from a dictionary. | |
| exprResult (Istream &is) | |
| Construct from Istream as dictionary content. | |
| template<class Type> | |
| exprResult (const Field< Type > &fld) | |
| Construct by copying a field. | |
| template<class Type> | |
| exprResult (Field< Type > &&fld) | |
| Construct by moving a field. | |
| template<class Type> | |
| exprResult (autoPtr< Type > &&obj) | |
| Construct for an IOobject. | |
| template<class Type> | |
| exprResult (const dimensioned< Type > &dt) | |
| Construct from a dimensioned value. | |
| exprResult (const bool &val) | |
| Construct from single value of bool. | |
| exprResult (const scalar &val) | |
| Construct from single value of scalar. | |
| exprResult (const vector &val) | |
| Construct from single value of vector. | |
| exprResult (const tensor &val) | |
| Construct from single value of tensor. | |
| exprResult (const symmTensor &val) | |
| Construct from single value of symmTensor. | |
| exprResult (const sphericalTensor &val) | |
| Construct from single value of sphericalTensor. | |
| virtual | ~exprResult () |
| Destructor. | |
| bool | hasValue () const |
| Has a value? | |
| const word & | valueType () const noexcept |
| Basic type for the field or single value. | |
| bool | isPointData (const bool wantPointData=true) const |
| True if representing point data, or test for same value as wantPointData argument. | |
| bool | isUniform () const |
| True if single, uniform value. | |
| template<class Type> | |
| bool | isType () const |
| True if valueType corresponds to the given Type. | |
| template<class Type> | |
| Type | getValue () const |
| Return a single value when isUniform() is true, or Zero when it is non-uniform or if the type mismatches, which means that it can generally be considered as failsafe. | |
| template<class Type> | |
| const Field< Type > * | getField () const |
| Return a read pointer to the field data if the type matches, nullptr otherwise. Can generally be considered as failsafe. | |
| bool | is_bool () const |
| True if valueType is a bool. | |
| label | size () const |
| The field or object size. | |
| const void * | dataAddress () const |
| The address of the field data content. | |
| void | clear () |
| Clear (zero) the result. | |
| void | noReset () noexcept |
| Change reset behaviour. | |
| void | allowReset () noexcept |
| Change reset behaviour. | |
| void | testIfSingleValue (const bool parRun=UPstream::parRun()) |
| Test if field corresponds to a single-value and thus uniform. | |
| template<class Type> | |
| void | setResult (Field< Type > *, bool wantPointData=false) |
| Set result field, taking ownership of the pointer. | |
| template<class Type> | |
| void | setResult (const Field< Type > &, bool wantPointData=false) |
| Set result field, taking copy of the field contents. | |
| template<class Type> | |
| void | setResult (Field< Type > &&, bool wantPointData=false) |
| Set result field, moving field contents. | |
| template<class Type> | |
| void | setResult (const Type &val, const label size) |
| Set uniform result field of given size. | |
| template<class Type> | |
| void | setSingleValue (const Type &val) |
| Set single-value uniform result. | |
| template<class Type> | |
| const Field< Type > & | cref () const |
| Return const reference to the field. | |
| template<class Type> | |
| Field< Type > & | ref () |
| Return non-const reference to the field. | |
| template<class Type> | |
| Field< Type > & | constCast () const |
| Return non-const reference to the field, casting away constness. | |
| template<class Type> | |
| tmp< Field< Type > > | getResult (bool cacheCopy=false) |
| Return tmp field of the contents, optionally keeping a copy in cache. | |
| exprResult | getUniform (const label size, const bool noWarn, const bool parRun=UPstream::parRun()) const |
| Construct a uniform field from the current results. | |
| template<template< class > class BinaryOp, class Type> | |
| Type | getReduced (const BinaryOp< Type > &bop, const Type &initial=pTraits< Type >::zero) |
| Get a reduced result. | |
| void | writeEntry (const word &keyword, Ostream &os) const |
| Forwarding to Field::writeEntry. | |
| void | writeDict (Ostream &os, const bool subDict=true) const |
| Write entry as dictionary contents. | |
| void | writeField (Ostream &os, const word &keyword="") const |
| Write the field, optionally as an entry. | |
| void | writeValue (Ostream &os) const |
| Write the single value, or the first value from field. | |
| virtual void | operator= (exprResult &&rhs) |
| Move assignment. | |
| exprResult & | operator*= (const scalar &b) |
| Scalar multiplication. | |
| exprResult & | operator+= (const exprResult &b) |
| Addition of results. | |
| template<class Type> | |
| const Foam::Field< Type > * | getField () const |
| template<class Type> | |
| Foam::tmp< Foam::Field< Type > > | getResult (bool cacheCopy) |
| template<class Type> | |
| const Foam::Field< Type > & | cref () const |
| template<class Type> | |
| Foam::Field< Type > & | ref () |
| template<class Type> | |
| Foam::Field< Type > & | constCast () const |
Additional Inherited Members | |
| Static Public Member Functions inherited from exprResult | |
| static autoPtr< exprResult > | New (const dictionary &dict) |
| Return a reference to the selected value driver. | |
| static autoPtr< exprResult > | New (Istream &is) |
| Construct from Istream as dictionary content. | |
| Static Public Attributes inherited from exprResult | |
| static const exprResult | null |
| An empty result. | |
| Protected Member Functions inherited from exprResult | |
| virtual expressions::exprResult & | target () |
| Simulate virtual templated methods. | |
| virtual void | resetImpl () |
| Reset at new timestep according to the derived class type. | |
| bool | reset (bool force=false) |
| Reset at new timestep according to type. | |
| void | needsReset (bool val) |
| Adjusts the internal needsReset value. | |
A stack of polymorphic fields. Can be used to build a list of results one at a time.
Definition at line 51 of file exprResultStack.H.
| exprResultStack | ( | ) |
Default construct.
Definition at line 56 of file exprResultStack.C.
References exprResult::exprResult(), and exprResult::needsReset().
Referenced by clone(), exprResultStack(), exprResultStoredStack::exprResultStoredStack(), exprResultStoredStack::exprResultStoredStack(), exprResultStoredStack::exprResultStoredStack(), operator=(), TypeName(), and ~exprResultStack().


| exprResultStack | ( | const exprResultStack & | rhs | ) |
Copy construct.
Definition at line 64 of file exprResultStack.C.
References exprResult::exprResult(), exprResultStack(), exprResult::needsReset(), and Foam::rhs().

|
explicit |
Construct from a dictionary.
Definition at line 75 of file exprResultStack.C.
References dict, exprResult::exprResult(), and exprResult::needsReset().

|
virtualdefault |
Destructor.
References exprResult::exprResult(), exprResultStack(), and Foam::rhs().

| TypeName | ( | "exprResultStack" | ) |
Runtime type information.
References dict, exprResultStack(), and Foam::rhs().

|
inlinevirtual |
Clone.
Reimplemented from exprResult.
Reimplemented in exprResultStoredStack.
Definition at line 102 of file exprResultStack.H.
References exprResultStack().

| Foam::expressions::exprResult pop | ( | ) |
Pop the last value as an expression result.
Definition at line 89 of file exprResultStack.C.
References Foam::abort(), Foam::endl(), exprResult::exprResult(), Foam::FatalError, FatalErrorInFunction, Foam::nl, exprResult::size(), and exprResult::valueType().

| void push | ( | const exprResult & | result | ) |
Push an expression result value.
Definition at line 122 of file exprResultStack.C.
References Foam::abort(), DebugInFunction, exprResult::exprResult(), Foam::FatalError, FatalErrorInFunction, exprResult::hasValue(), Foam::nl, exprResult::operator=(), and exprResult::valueType().
Referenced by operator=().


| void operator= | ( | const exprResultStack & | rhs | ) |
Copy assignment.
Definition at line 164 of file exprResultStack.C.
References exprResult::exprResult(), exprResultStack(), and Foam::rhs().
Referenced by exprResultStoredStack::operator=().


|
virtual |
Copy assignment.
Reimplemented from exprResult.
Definition at line 178 of file exprResultStack.C.
References DebugInFunction, exprResult::exprResult(), Foam::nl, push(), and Foam::rhs().
