exprResultDelayed Class Reference

An exprResult with an additional delay before evaluation. More...

Inheritance diagram for exprResultDelayed:
Collaboration diagram for exprResultDelayed:

Public Member Functions

 TypeNameNoDebug ("exprResultDelayed")
 Runtime type information. More...
 
 exprResultDelayed ()
 Default construct. More...
 
 exprResultDelayed (const exprResultDelayed &)
 Copy construct. More...
 
 exprResultDelayed (const dictionary &dict)
 Construct from a dictionary. More...
 
virtual autoPtr< exprResultclone () const
 Clone. More...
 
virtual ~exprResultDelayed ()=default
 Destructor. More...
 
const wordname () const noexcept
 The expression name. More...
 
const expressions::exprStringstartupValueExpression () const noexcept
 The initial value expression. More...
 
bool updateReadValue (const scalar &timeVal)
 Update the read-value. More...
 
void setReadValue (const exprResult &val)
 Set the readValue with a calculated value. More...
 
void storeValue (const scalar &timeVal)
 Add a stored value. More...
 
void writeDict (Ostream &os) const
 
void operator= (const exprResultDelayed &rhs)
 Copy assignment. More...
 
void operator= (const exprResult &rhs)
 Copy assignment. More...
 
void operator= (exprResult &&rhs)
 Move assignment. More...
 
bool operator!= (const exprResultDelayed &rhs) const noexcept
 Compare for inequality (need by Ulist) More...
 
- Public Member Functions inherited from exprResult
 TypeName ("exprResult")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, exprResult, dictionary,(const dictionary &dict),(dict))
 
 declareRunTimeSelectionTable (autoPtr, exprResult, empty,(),())
 
 exprResult ()
 Default construct. More...
 
 exprResult (const exprResult &expr)
 Copy construct. More...
 
 exprResult (exprResult &&expr)
 Move construct. More...
 
 exprResult (const dictionary &dict, const bool singleValueOnly=false, const bool valueReqd=false)
 Construct from a dictionary. More...
 
 exprResult (Istream &is)
 Construct from Istream as dictionary content. More...
 
template<class Type >
 exprResult (const Field< Type > &fld)
 Construct by copying a field. More...
 
template<class Type >
 exprResult (Field< Type > &&fld)
 Construct by moving a field. More...
 
template<class Type >
 exprResult (autoPtr< Type > &&obj)
 Construct for an IOobject. More...
 
template<class Type >
 exprResult (const dimensioned< Type > &dt)
 Construct from a dimensioned value. More...
 
 exprResult (const bool &val)
 Construct from single value of bool. More...
 
 exprResult (const scalar &val)
 Construct from single value of scalar. More...
 
 exprResult (const vector &val)
 Construct from single value of vector. More...
 
 exprResult (const tensor &val)
 Construct from single value of tensor. More...
 
 exprResult (const symmTensor &val)
 Construct from single value of symmTensor. More...
 
 exprResult (const sphericalTensor &val)
 Construct from single value of sphericalTensor. More...
 
virtual ~exprResult ()
 Destructor. More...
 
bool hasValue () const
 Has a value? More...
 
const wordvalueType () const noexcept
 Basic type for the field or single value. More...
 
bool isPointData (const bool wantPointData=true) const
 True if representing point data, or test for same value as wantPointData argument. More...
 
bool isUniform () const
 True if single, uniform value. More...
 
template<class Type >
bool isType () const
 True if valueType corresponds to the given Type. More...
 
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. More...
 
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. More...
 
bool is_bool () const
 True if valueType is a bool. More...
 
label size () const
 The field or object size. More...
 
const void * dataAddress () const
 The address of the field data content. More...
 
void clear ()
 Clear (zero) the result. More...
 
void noReset () noexcept
 Change reset behaviour. More...
 
void allowReset () noexcept
 Change reset behaviour. More...
 
void testIfSingleValue (const bool parRun=Pstream::parRun())
 Test if field corresponds to a single-value and thus uniform. More...
 
template<class Type >
void setResult (Field< Type > *, bool wantPointData=false)
 Set result field, taking ownership of the pointer. More...
 
template<class Type >
void setResult (const Field< Type > &, bool wantPointData=false)
 Set result field, taking copy of the field contents. More...
 
template<class Type >
void setResult (Field< Type > &&, bool wantPointData=false)
 Set result field, moving field contents. More...
 
template<class Type >
void setResult (const Type &val, const label size)
 Set uniform result field of given size. More...
 
template<class Type >
void setSingleValue (const Type &val)
 Set single-value uniform result. More...
 
template<class Type >
const Field< Type > & cref () const
 Return const reference to the field. More...
 
template<class Type >
Field< Type > & ref ()
 Return non-const reference to the field. More...
 
template<class Type >
Field< Type > & constCast () const
 Return non-const reference to the field, casting away constness. More...
 
template<class Type >
tmp< Field< Type > > getResult (bool cacheCopy=false)
 Return tmp field of the contents, optionally keeping a copy in cache. More...
 
exprResult getUniform (const label size, const bool noWarn, const bool parRun=Pstream::parRun()) const
 Construct a uniform field from the current results. More...
 
template<template< class > class BinaryOp, class Type >
Type getReduced (const BinaryOp< Type > &bop, const Type &initial=pTraits< Type >::zero)
 Get a reduced result. More...
 
void writeEntry (const word &keyword, Ostream &os) const
 Forwarding to Field::writeEntry. More...
 
void writeDict (Ostream &os, const bool subDict=true) const
 Write entry as dictionary contents. More...
 
void writeField (Ostream &os, const word &keyword="") const
 Write the field, optionally as an entry. More...
 
void writeValue (Ostream &os) const
 Write the single value, or the first value from field. More...
 
exprResultoperator*= (const scalar &b)
 Scalar multiplication. More...
 
exprResultoperator+= (const exprResult &b)
 Addition of results. More...
 
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
 

Protected Member Functions

expressions::exprResulttarget ()
 Simulate virtual templated methods. More...
 
- Protected Member Functions inherited from exprResult
virtual void resetImpl ()
 Reset at new timestep according to the derived class type. More...
 
bool reset (bool force=false)
 Reset at new timestep according to type. More...
 
void needsReset (bool val)
 Adjusts the internal needsReset value. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from exprResult
static autoPtr< exprResultNew (const dictionary &dict)
 Return a reference to the selected value driver. More...
 
static autoPtr< exprResultNew (Istream &is)
 Construct from Istream as dictionary content. More...
 
- Static Public Attributes inherited from exprResult
static const exprResult null
 An empty result. More...
 

Detailed Description

An exprResult with an additional delay before evaluation.


Dictionary parameters

Property Description Required Default
name The result name yes
delay The delay before starting yes
storeInterval The storage interval (time) yes
startupValue The initial startup value yes
value The expression result (dictionary) no
storedValues The list of stored values yes
Source files

Definition at line 97 of file exprResultDelayed.H.

Constructor & Destructor Documentation

◆ exprResultDelayed() [1/3]

Default construct.

Definition at line 58 of file exprResultDelayed.C.

Referenced by exprResultDelayed::clone().

Here is the caller graph for this function:

◆ exprResultDelayed() [2/3]

Copy construct.

Definition at line 70 of file exprResultDelayed.C.

◆ exprResultDelayed() [3/3]

exprResultDelayed ( const dictionary dict)

Construct from a dictionary.

Definition at line 85 of file exprResultDelayed.C.

References dict, entry::isStream(), keyType::LITERAL, and entry::stream().

Here is the call graph for this function:

◆ ~exprResultDelayed()

virtual ~exprResultDelayed ( )
virtualdefault

Destructor.

Member Function Documentation

◆ target()

expressions::exprResult& target ( )
inlineprotectedvirtual

Simulate virtual templated methods.

Reimplemented from exprResult.

Definition at line 149 of file exprResultDelayed.H.

◆ TypeNameNoDebug()

TypeNameNoDebug ( "exprResultDelayed"  )

Runtime type information.

◆ clone()

virtual autoPtr<exprResult> clone ( ) const
inlinevirtual

Clone.

Reimplemented from exprResult.

Definition at line 180 of file exprResultDelayed.H.

References exprResultDelayed::exprResultDelayed().

Here is the call graph for this function:

◆ name()

const word& name ( ) const
inlinenoexcept

The expression name.

Definition at line 200 of file exprResultDelayed.H.

◆ startupValueExpression()

const expressions::exprString& startupValueExpression ( ) const
inlinenoexcept

The initial value expression.

Definition at line 208 of file exprResultDelayed.H.

◆ updateReadValue()

bool updateReadValue ( const scalar &  timeVal)

Update the read-value.

return true if there was a valid value. this does not do the work of setReadValue because we have no access to the Parser

Definition at line 107 of file exprResultDelayed.C.

References Foam::endl(), Foam::exit(), f(), Foam::FatalError, FatalErrorInFunction, Foam::name(), and Foam::nl.

Here is the call graph for this function:

◆ setReadValue()

void setReadValue ( const exprResult val)

Set the readValue with a calculated value.

Definition at line 166 of file exprResultDelayed.C.

References exprResult::operator=().

Here is the call graph for this function:

◆ storeValue()

void storeValue ( const scalar &  timeVal)

Add a stored value.

Definition at line 175 of file exprResultDelayed.C.

References append().

Here is the call graph for this function:

◆ writeDict()

void writeDict ( Ostream os) const

Definition at line 232 of file exprResultDelayed.C.

References os().

Here is the call graph for this function:

◆ operator=() [1/3]

void operator= ( const exprResultDelayed rhs)

Copy assignment.

Definition at line 259 of file exprResultDelayed.C.

References exprResult::operator=().

Here is the call graph for this function:

◆ operator=() [2/3]

void operator= ( const exprResult rhs)
virtual

Copy assignment.

Reimplemented from exprResult.

Definition at line 280 of file exprResultDelayed.C.

◆ operator=() [3/3]

void operator= ( exprResult &&  rhs)
virtual

Move assignment.

Reimplemented from exprResult.

Definition at line 289 of file exprResultDelayed.C.

◆ operator!=()

bool operator!= ( const exprResultDelayed rhs) const
inlinenoexcept

Compare for inequality (need by Ulist)

Definition at line 258 of file exprResultDelayed.H.


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