fvExprDriver Class Referenceabstract

Base driver for parsing value expressions associated with an fvMesh. More...

Inheritance diagram for fvExprDriver:
[legend]
Collaboration diagram for fvExprDriver:
[legend]

Public Member Functions

 TypeName ("fvExprDriver")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, fvExprDriver, dictionary,(const dictionary &dict, const fvMesh &mesh),(dict, mesh))
 
 declareRunTimeSelectionTable (autoPtr, fvExprDriver, idName,(const word &ident, const fvMesh &mesh),(ident, mesh))
 
 fvExprDriver (bool cacheReadFields=false, bool searchInMemory=true, bool searchFiles=false, const dictionary &dict=dictionary::null)
 Null constructor, and null construct with search preferences. More...
 
 fvExprDriver (const fvExprDriver &)
 Copy construct. More...
 
 fvExprDriver (const dictionary &dict)
 Construct from a dictionary. More...
 
virtual autoPtr< fvExprDriverclone () const =0
 Clone. More...
 
virtual ~fvExprDriver ()
 Destructor. More...
 
virtual label size () const =0
 The underlying field size for the expression. More...
 
virtual label pointSize () const =0
 The underlying point field size for the expression. More...
 
const TimerunTime () const
 The Time associated with the mesh. More...
 
virtual word timeName () const
 The current time name. More...
 
virtual scalar timeValue () const
 The current time value. More...
 
bool cacheSets () const
 Status of cache-sets (static variable) More...
 
virtual void clearVariables ()
 Clear temporary variables and resets from expression strings. More...
 
virtual bool hasVariable (const word &name) const
 True if named variable exists. More...
 
virtual const exprResultvariable (const word &name) const
 Return const-access to the named variable. More...
 
template<class Type >
bool isVariableOrField (const word &name, bool isPointVal=false, label expectSize=-1) const
 Test for existence of a local/global variable or a field. More...
 
template<class Type >
tmp< Field< Type > > getVariable (const word &name, label expectSize, const bool mandatory=true) const
 Retrieve local/global variable as a tmp field. More...
 
word getFieldClassName (const word &name) const
 Lookup the field class name (memory or read from disk) More...
 
topoSetSource::sourceType topoSetType (const word &name) const
 Return cell/face/point set type or unknown. More...
 
topoSetSource::sourceType topoZoneType (const word &name) const
 Return cell/face/point zone type or unknown. More...
 
topoSetSource::sourceType topoSourceType (const word &name) const
 Return cell/face/point zone/set type or unknown. More...
 
labelList getTopoSetLabels (const word &name, enum topoSetSource::sourceType setType) const
 Read and return labels associated with the topo set. More...
 
bool isCellZone (const word &name) const
 Test if name is a known cellZone. More...
 
bool isFaceZone (const word &name) const
 Test if name is a known faceZone. More...
 
bool isPointZone (const word &name) const
 Test if name is a known pointZone. More...
 
bool isCellSet (const word &name) const
 Test if name is a known cellSet. More...
 
bool isFaceSet (const word &name) const
 Test if name is a known faceSet. More...
 
bool isPointSet (const word &name) const
 Test if name is a known pointSet. More...
 
virtual void evaluateVariable (const word &varName, const expressions::exprString &expr)
 
virtual void evaluateVariableRemote (string remote, const word &varName, const expressions::exprString &expr)
 
template<class Type >
bool isVariable (const word &name, bool isPointVal=false, label expectSize=-1) const
 Test existence of a local/global variable. More...
 
template<class Type >
bool foundField (const word &name) const
 Test if specified field can be found in memory or disk. More...
 
word getTypeOfField (const word &fieldName) const
 Read the IOobject for fieldName and return its headerClassName. More...
 
virtual bool readDict (const dictionary &dict)
 Read variables, tables etc. More...
 
OstreamwriteCommon (Ostream &os, bool debug=false) const
 
void createWriterAndRead (const word &name)
 Create a writer for this object. More...
 
void tryWrite () const
 
template<class GeomField >
Foam::tmp< GeomField > getOrReadField (const word &name, bool mandatory, bool getOldTime)
 
template<class GeomField >
Foam::tmp< GeomField > getOrReadPointField (const word &name, bool mandatory, bool getOldTime)
 
template<class GeomField , class Mesh >
Foam::tmp< GeomField > readAndRegister (const word &name, const Mesh &meshRef)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > getVariable (const word &name, label expectedSize, const bool mandatory) const
 
template<class GeomField , class Mesh >
Foam::tmp< GeomField > getOrReadFieldImpl (const word &name, const Mesh &meshRef, bool mandatory, bool getOldTime)
 
template<class T >
Foam::autoPtr< TgetTopoSet (const fvMesh &mesh, const word &name, SetOrigin &origin) const
 
- Public Member Functions inherited from exprDriver
 TypeName ("exprDriver")
 Runtime type information. More...
 
 exprDriver (bool cacheReadFields=false, bool searchInMemory=true, bool searchFiles=false, const dictionary &dict=dictionary::null)
 Null constructor, and null construct with search preferences. More...
 
 exprDriver (const exprDriver &)
 Copy construct. More...
 
 exprDriver (const dictionary &dict)
 Construct from a dictionary. More...
 
virtual ~exprDriver ()=default
 Destructor. More...
 
const dictionarydict () const
 The dictionary with all input data/specification. More...
 
virtual const exprResultresult () const
 Const access to expression result. More...
 
virtual exprResultresult ()
 Non-const access to expression result. More...
 
void clearResult ()
 Clear the result. More...
 
template<class Type >
tmp< Field< Type > > getResult (bool isPointVal=false)
 Return the expression result as a tmp field. More...
 
virtual word getResultType () const
 The result type as word - same as result().valueType() More...
 
scalar argValue () const
 Set special-purpose scalar reference argument. More...
 
int stashedTokenId () const
 Get "look-behind" parsing context (internal bookkeeping) More...
 
int resetStashedTokenId (int tokenId=0) const
 Reset "look-behind" parsing context (mutable operation) More...
 
void setDebugging (bool scannerDebug, bool parserDebug)
 Set the scanner/parser debug. More...
 
void setDebugging (const exprDriver &rhs)
 Set the scanner/parser debug to match the input. More...
 
void setSearchBehaviour (bool cacheReadFields, bool searchInMemory, bool searchFiles)
 Set search behaviour. More...
 
void setSearchBehaviour (const exprDriver &rhs)
 Set search behaviour to be identical to rhs. More...
 
bool debugScanner () const
 Read access to scanner debug. More...
 
bool debugParser () const
 Read access to parser debug. More...
 
bool cacheReadFields () const
 
bool searchInMemory () const
 
bool searchFiles () const
 
bool prevIterIsOldTime () const
 
virtual void setArgument (const scalar val)
 Set special-purpose scalar reference argument. More...
 
void addVariables (const expressions::exprString &expr, bool clear=true)
 Add/set string expressions for variables. More...
 
void addVariables (const UList< expressions::exprString > &list, bool clear=true)
 Add/set string expressions for variables. More...
 
template<class T >
void addUniformVariable (const word &name, const T &val)
 Add a uniform variable from an outside caller. More...
 
template<class T >
bool isLocalVariable (const word &name, bool isPointVal, label expectedSize=-1) const
 Test existence of a local variable. More...
 
template<class Type >
tmp< Field< Type > > getLocalVariable (const word &name, label expectSize, const bool mandatory=true) const
 Retrieve local/global variable as a tmp field. More...
 
virtual unsigned parse (const std::string &expr, size_t pos=0, size_t len=std::string::npos)=0
 Execute the parser. More...
 
template<class Type >
tmp< Field< Type > > evaluate (const expressions::exprString &expr, bool isPointVal=false)
 Evaluate the expression and return the field. More...
 
template<class Type >
Type evaluateUniform (const expressions::exprString &expr, bool isPointVal=false)
 Evaluate the expression and return a single value. More...
 
void evaluateVariable (const word &varName, const expressions::exprString &expr)
 
template<class Type >
tmp< Field< Type > > newField (const Type &val=pTraits< Type >::zero) const
 Return a new field with the size() More...
 
template<class Type >
tmp< Field< Type > > newPointField (const Type &val=pTraits< Type >::zero) const
 Return a new field with the pointSize() More...
 
expressions::exprString readExpression (const word &name)
 
label setVariableStrings (const dictionary &dict, bool mandatory=false)
 Read "variables" and assigns to the list of expression strings. More...
 
OstreamwriteVariableStrings (Ostream &os, const word &keyword="") const
 Write "variables". More...
 
template<class Type >
void addUniformVariable (const word &name, const Type &val)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > evaluate (const expressions::exprString &expr, bool isPointVal)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > getResult (bool isPointVal)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > newField (const Type &val) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > newPointField (const Type &val) const
 

Static Public Member Functions

static const fvMeshdefaultMesh ()
 Get the default mesh, if one is defined. More...
 
static const fvMeshresetDefaultMesh (const fvMesh &mesh, const bool force=false)
 Set the default mesh (if not already set) More...
 
static autoPtr< fvExprDriverNew (const dictionary &dict, const fvMesh &mesh)
 Return a reference to the selected value driver. More...
 
static autoPtr< fvExprDriverNew (const dictionary &dict)
 Return a reference to the selected value driver. More...
 
static autoPtr< fvExprDriverNew (const word &type, const word &id, const fvMesh &mesh)
 Return a reference to the selected value driver. More...
 
- Static Public Member Functions inherited from exprDriver
static expressions::exprString readExpression (const word &name, const dictionary &dict)
 Read an expression string and do substitutions. More...
 
static List< expressions::exprStringreadVariableStrings (const dictionary &dict, const word &name="variables", bool mandatory=false)
 Read the list of variable strings. More...
 

Protected Types

enum  SetOrigin {
  INVALID = 0, NEW, FILE, MEMORY,
  CACHE
}
 The origin of the topoSet. More...
 

Protected Member Functions

virtual const fvMeshmesh () const =0
 The mesh we are attached to. More...
 
void setGlobalScopes (const wordUList &scopes)
 Define scopes for global variables. More...
 
virtual exprResultvariable (const word &name)
 Non-const access to the named variable (sub-classes only) More...
 
template<class T >
bool isGlobalVariable (const word &name, bool isPointVal, label expectedSize=-1) const
 Test existence of a global variable. More...
 
const exprResultlookupGlobal (const word &name) const
 Return the global variable if available or a null result. More...
 
template<class Type >
bool isField (const word &name, bool isPointVal=false, label expectSize=-1) const
 Test for the existence of a mesh field. More...
 
template<class GeomField >
tmp< GeomField > getOrReadField (const word &name, bool mandatory=true, bool getOldTime=false)
 Retrieve field from memory or disk. More...
 
template<class GeomField >
tmp< GeomField > getOrReadPointField (const word &name, bool mandatory=true, bool getOldTime=false)
 Retrieve point field from memory or disk. More...
 
template<class GeomField , class MeshRef >
tmp< GeomField > getOrReadFieldImpl (const word &name, const MeshRef &meshRef, bool mandatory=true, bool getOldTime=false)
 Retrieve field from memory or disk (implementation) More...
 
template<class GeomField , class MeshRef >
tmp< GeomField > readAndRegister (const word &name, const MeshRef &meshRef)
 Helper function for getOrReadField. More...
 
void fill_random (scalarField &field, label seed=0, const bool gaussian=false) const
 Create a random field. More...
 
template<class T >
autoPtr< TgetTopoSet (const fvMesh &mesh, const word &setName, SetOrigin &origin) const
 Get topoSet. More...
 
template<class T >
bool updateSet (autoPtr< T > &setPtr, const word &setName, SetOrigin origin) const
 Update topoSet. More...
 
virtual void updateSpecialVariables (bool force=false)
 Examine current variable values and update stored variables. More...
 
virtual bool hasDataToWrite () const
 Do we need a data file to be written. More...
 
virtual void prepareData (dictionary &dict) const
 
virtual void getData (const dictionary &dict)
 Read data from dictionary, normally via the reader/writer. More...
 
- Protected Member Functions inherited from exprDriver
void fill_random (scalarField &field, label seed=0, const bool gaussian=false) const
 Fill a random field. More...
 
virtual bool update ()
 Update things. More...
 
virtual exprResult getRemoteResult (const exprDriver &other) const
 Get the result from another driver. More...
 
void operator= (const exprDriver &)=delete
 No copy assignment. More...
 

Static Protected Member Functions

static const fvMeshregionMesh (const dictionary &dict, const fvMesh &mesh, bool readIfNecessary)
 
template<class T >
static word defaultBoundaryType (const T &)
 Default boundary type is calculated. More...
 
template<class Type >
static word defaultBoundaryType (const GeometricField< Type, fvPatchField, volMesh > &)
 Default boundary type for volume fields is zeroGradient. More...
 
template<class T >
static void correctField (T &)
 Apply correctBoundaryConditions (volume fields only) More...
 
template<class Type >
static void correctField (GeometricField< Type, fvPatchField, volMesh > &fld)
 
- Static Protected Member Functions inherited from exprDriver
template<typename TableType >
static bool readTable (const word &name, const dictionary &dict, HashTable< TableType > &tbl, bool clear=true)
 Read an interpolation table. More...
 
template<class TableType >
static void writeTable (Ostream &os, const word &name, const HashTable< TableType > &tbl)
 Write an interpolation table. More...
 
template<class Type >
static Type weightedAverage (const scalarField &weights, const Field< Type > &fld)
 The (global) weighted average of a field, with stabilisation. More...
 
template<class Type >
static Type weightedSum (const scalarField &weights, const Field< Type > &fld)
 The (global) weighted sum (integral) of a field. More...
 
static point getPositionOfMinimum (const scalarField &vals, const pointField &locs)
 Return the location of the min value. More...
 
static point getPositionOfMaximum (const scalarField &vals, const pointField &locs)
 Return the location of the max value. More...
 

Friends

class exprDriverWriter
 

Additional Inherited Members

- Protected Attributes inherited from exprDriver
const dictionarydict_
 The dictionary with all input data/specification. More...
 
exprResult result_
 The result. More...
 
List< expressions::exprStringvariableStrings_
 Variable definitions, as read from a dictionary. More...
 
HashTable< exprResultvariables_
 The variables table. More...
 
scalar arg1Value_
 Special-purpose scalar reference argument. More...
 
int stashedTokenId_
 Internal bookkeeping as "look-behind" parsing context. More...
 
bool debugScanner_
 Request debugging for scanner. More...
 
bool debugParser_
 Request debugging for parser. More...
 
bool allowShadowing_
 Allow variable names to mask field names. More...
 
bool prevIterIsOldTime_
 Use value of previous iteration when oldTime is requested. More...
 
bool cacheReadFields_
 Keep fields read from disc in memory. More...
 
bool searchInMemory_
 Search in registry before looking on disk. More...
 
bool searchFiles_
 Search on disk (eg, for a standalone application) More...
 

Detailed Description

Base driver for parsing value expressions associated with an fvMesh.

Largely based on code and ideas from swak4foam

Properties

Property Description Required Default
variables List of variables for expressions no ()
delayedVariables List of delayed variables no ()
storedVariables List of stored variables no ()
globalScopes Scopes for global variables no ()
allowShadowing Allow variables to shadow field names no false

Debug Properties

Property Description Required Default
debugBaseDriver Debug level (int) for base driver no
debugScanner Add debug for scanner no false
debugParser Add debug for parser no false
Source files

Definition at line 138 of file fvExprDriver.H.

Member Enumeration Documentation

◆ SetOrigin

enum SetOrigin
protected

The origin of the topoSet.

Enumerator
INVALID 
NEW 
FILE 
MEMORY 
CACHE 

Definition at line 340 of file fvExprDriver.H.

Constructor & Destructor Documentation

◆ fvExprDriver() [1/3]

fvExprDriver ( bool  cacheReadFields = false,
bool  searchInMemory = true,
bool  searchFiles = false,
const dictionary dict = dictionary::null 
)
explicit

Null constructor, and null construct with search preferences.

Definition at line 96 of file fvExprDriver.C.

◆ fvExprDriver() [2/3]

fvExprDriver ( const fvExprDriver rhs)

Copy construct.

Definition at line 121 of file fvExprDriver.C.

◆ fvExprDriver() [3/3]

fvExprDriver ( const dictionary dict)
explicit

Construct from a dictionary.

Definition at line 137 of file fvExprDriver.C.

References dict.

◆ ~fvExprDriver()

~fvExprDriver ( )
virtual

Destructor.

Definition at line 155 of file fvExprDriver.C.

Member Function Documentation

◆ regionMesh()

const Foam::fvMesh & regionMesh ( const dictionary dict,
const fvMesh mesh,
bool  readIfNecessary 
)
staticprotected

Determine mesh or region mesh as specified in the dictionary with the keyword "region"

Definition at line 533 of file fvExprDriver.C.

References DebugInFunction, dict, Foam::endl(), FatalErrorInFunction, mesh, meshPtr, IOobject::MUST_READ, Foam::nl, regionName, and WarningInFunction.

Here is the call graph for this function:

◆ defaultBoundaryType() [1/2]

static word defaultBoundaryType ( const T )
inlinestaticprotected

Default boundary type is calculated.

Definition at line 213 of file fvExprDriver.H.

◆ defaultBoundaryType() [2/2]

static word defaultBoundaryType ( const GeometricField< Type, fvPatchField, volMesh > &  )
inlinestaticprotected

Default boundary type for volume fields is zeroGradient.

Definition at line 221 of file fvExprDriver.H.

◆ correctField() [1/2]

static void correctField ( T )
inlinestaticprotected

Apply correctBoundaryConditions (volume fields only)

Definition at line 231 of file fvExprDriver.H.

◆ correctField() [2/2]

static void correctField ( GeometricField< Type, fvPatchField, volMesh > &  fld)
inlinestaticprotected

Definition at line 235 of file fvExprDriver.H.

References fld.

◆ mesh()

virtual const fvMesh& mesh ( ) const
protectedpure virtual

The mesh we are attached to.

Implemented in parseDriver, and parseDriver.

◆ setGlobalScopes()

void setGlobalScopes ( const wordUList scopes)
inlineprotected

Define scopes for global variables.

Definition at line 254 of file fvExprDriver.H.

Referenced by fvExprDriver::evaluateVariableRemote().

Here is the caller graph for this function:

◆ variable() [1/2]

Foam::expressions::exprResult & variable ( const word name)
inlineprotectedvirtual

Non-const access to the named variable (sub-classes only)

Reimplemented from exprDriver.

Definition at line 59 of file fvExprDriverI.H.

References Foam::name().

Here is the call graph for this function:

◆ isGlobalVariable()

bool isGlobalVariable ( const word name,
bool  isPointVal,
label  expectedSize = -1 
) const
protected

Test existence of a global variable.

Definition at line 37 of file fvExprDriverTemplates.C.

References Foam::expressions::patchExpr::debug, DebugInfo, Foam::endl(), Foam::Info, Foam::name(), and reduce().

Here is the call graph for this function:

◆ lookupGlobal()

const Foam::expressions::exprResult & lookupGlobal ( const word name) const
protected

Return the global variable if available or a null result.

Definition at line 724 of file fvExprDriver.C.

References exprResultGlobals::get(), mesh, and exprResultGlobals::New().

Here is the call graph for this function:

◆ isField()

bool isField ( const word name,
bool  isPointVal = false,
label  expectSize = -1 
) const
protected

Test for the existence of a mesh field.

Parameters
expectSizeignored

Definition at line 198 of file fvExprDriverTemplates.C.

References Foam::expressions::patchExpr::debug, and Foam::Info.

◆ getOrReadField() [1/2]

tmp<GeomField> getOrReadField ( const word name,
bool  mandatory = true,
bool  getOldTime = false 
)
inlineprotected

Retrieve field from memory or disk.

◆ getOrReadPointField() [1/2]

tmp<GeomField> getOrReadPointField ( const word name,
bool  mandatory = true,
bool  getOldTime = false 
)
inlineprotected

Retrieve point field from memory or disk.

◆ getOrReadFieldImpl() [1/2]

tmp<GeomField> getOrReadFieldImpl ( const word name,
const MeshRef &  meshRef,
bool  mandatory = true,
bool  getOldTime = false 
)
protected

Retrieve field from memory or disk (implementation)

◆ readAndRegister() [1/2]

tmp<GeomField> readAndRegister ( const word name,
const MeshRef &  meshRef 
)
inlineprotected

Helper function for getOrReadField.

◆ fill_random()

void fill_random ( scalarField field,
label  seed = 0,
const bool  gaussian = false 
) const
protected

Create a random field.

Parameters
fieldthe field to populate
seedthe seed value. If zero or negative, use as an offset to the current timeIndex
gaussiangenerate a Gaussian distribution

Definition at line 35 of file fvExprDriverFields.C.

References field(), runTime, and timeIndex.

Here is the call graph for this function:

◆ getTopoSet() [1/2]

autoPtr<T> getTopoSet ( const fvMesh mesh,
const word setName,
SetOrigin origin 
) const
protected

Get topoSet.

◆ updateSet()

bool updateSet ( autoPtr< T > &  setPtr,
const word setName,
SetOrigin  origin 
) const
inlineprotected

Update topoSet.

Definition at line 518 of file fvExprDriverTemplates.C.

◆ updateSpecialVariables()

void updateSpecialVariables ( bool  force = false)
protectedvirtual

Examine current variable values and update stored variables.

Reimplemented from exprDriver.

Definition at line 264 of file fvExprDriver.C.

References DebugInfo, Foam::endl(), forAllIters, mesh, Foam::nl, and update().

Here is the call graph for this function:

◆ hasDataToWrite()

bool hasDataToWrite ( ) const
protectedvirtual

Do we need a data file to be written.

Definition at line 732 of file fvExprDriver.C.

◆ prepareData()

void prepareData ( dictionary dict) const
protectedvirtual

Prepare/update special variables and add to dictionary, normally via the reader/writer

Definition at line 748 of file fvExprDriver.C.

References dict, and exprDriver::update().

Here is the call graph for this function:

◆ getData()

void getData ( const dictionary dict)
protectedvirtual

Read data from dictionary, normally via the reader/writer.

Definition at line 739 of file fvExprDriver.C.

References dict.

Referenced by exprDriverWriter::readData().

Here is the caller graph for this function:

◆ defaultMesh()

const Foam::fvMesh & defaultMesh ( )
static

Get the default mesh, if one is defined.

Definition at line 61 of file fvExprDriver.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.

Here is the call graph for this function:

◆ resetDefaultMesh()

const Foam::fvMesh * resetDefaultMesh ( const fvMesh mesh,
const bool  force = false 
)
static

Set the default mesh (if not already set)

Parameters
forceForce reset, even if already set

Definition at line 77 of file fvExprDriver.C.

References mesh.

◆ TypeName()

TypeName ( "fvExprDriver"  )

Runtime type information.

◆ declareRunTimeSelectionTable() [1/2]

declareRunTimeSelectionTable ( autoPtr  ,
fvExprDriver  ,
dictionary  ,
(const dictionary &dict, const fvMesh &mesh ,
(dict, mesh  
)

◆ declareRunTimeSelectionTable() [2/2]

declareRunTimeSelectionTable ( autoPtr  ,
fvExprDriver  ,
idName  ,
(const word &ident, const fvMesh &mesh ,
(ident, mesh  
)

◆ New() [1/3]

Foam::autoPtr< Foam::expressions::fvExprDriver > New ( const dictionary dict,
const fvMesh mesh 
)
static

Return a reference to the selected value driver.

Definition at line 49 of file fvExprDriverNew.C.

References DebugInFunction, dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, and mesh.

Referenced by fvExprDriver::evaluateVariableRemote().

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

◆ New() [2/3]

Foam::autoPtr< Foam::expressions::fvExprDriver > New ( const dictionary dict)
static

Return a reference to the selected value driver.

Definition at line 35 of file fvExprDriverNew.C.

References dict, and Foam::New().

Here is the call graph for this function:

◆ New() [3/3]

Foam::autoPtr< Foam::expressions::fvExprDriver > New ( const word type,
const word id,
const fvMesh mesh 
)
static

Return a reference to the selected value driver.

Definition at line 79 of file fvExprDriverNew.C.

References DebugInFunction, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInLookup, and mesh.

Here is the call graph for this function:

◆ clone()

virtual autoPtr<fvExprDriver> clone ( ) const
pure virtual

Clone.

Implemented in parseDriver, and parseDriver.

◆ size()

virtual label size ( ) const
pure virtual

The underlying field size for the expression.

Reimplemented from exprDriver.

Implemented in parseDriver, and parseDriver.

◆ pointSize()

virtual label pointSize ( ) const
pure virtual

The underlying point field size for the expression.

Reimplemented from exprDriver.

Implemented in parseDriver, and parseDriver.

◆ runTime()

const Foam::Time & runTime ( ) const

The Time associated with the mesh.

Definition at line 246 of file fvExprDriver.C.

References mesh.

◆ timeName()

Foam::word timeName ( ) const
virtual

The current time name.

Definition at line 252 of file fvExprDriver.C.

References runTime.

◆ timeValue()

Foam::scalar timeValue ( ) const
virtual

The current time value.

Definition at line 258 of file fvExprDriver.C.

References runTime.

◆ cacheSets()

bool cacheSets ( ) const
inline

Status of cache-sets (static variable)

Definition at line 498 of file fvExprDriver.H.

◆ clearVariables()

void clearVariables ( )
virtual

Clear temporary variables and resets from expression strings.

Reimplemented from exprDriver.

Definition at line 355 of file fvExprDriver.C.

References DebugInfo, Foam::endl(), forAllIters, mesh, and update().

Here is the call graph for this function:

◆ hasVariable()

bool hasVariable ( const word name) const
inlinevirtual

True if named variable exists.

Reimplemented from exprDriver.

Definition at line 34 of file fvExprDriverI.H.

References Foam::name().

Here is the call graph for this function:

◆ variable() [2/2]

const Foam::expressions::exprResult & variable ( const word name) const
inlinevirtual

Return const-access to the named variable.

Reimplemented from exprDriver.

Definition at line 44 of file fvExprDriverI.H.

References Foam::name().

Here is the call graph for this function:

◆ isVariableOrField()

bool isVariableOrField ( const word name,
bool  isPointVal = false,
label  expectSize = -1 
) const
inline

Test for existence of a local/global variable or a field.

Definition at line 90 of file fvExprDriverI.H.

References Foam::name().

Here is the call graph for this function:

◆ getVariable() [1/2]

tmp<Field<Type> > getVariable ( const word name,
label  expectSize,
const bool  mandatory = true 
) const

Retrieve local/global variable as a tmp field.

Parameters
nameThe name of the local/global field
expectSizeThe size check on the variable, -1 to ignore
mandatoryA missing variable is Fatal, or return an invalid tmp

◆ getFieldClassName()

Foam::word getFieldClassName ( const word name) const

Lookup the field class name (memory or read from disk)

Return empty if the name cannot be resolved.

Definition at line 592 of file fvExprDriver.C.

References mesh, Foam::name(), and word::null.

Here is the call graph for this function:

◆ topoSetType()

Foam::topoSetSource::sourceType topoSetType ( const word name) const

Return cell/face/point set type or unknown.

Definition at line 616 of file fvExprDriver.C.

References topoSet::findIOobject(), IOobject::headerClassName(), and mesh.

Here is the call graph for this function:

◆ topoZoneType()

Foam::topoSetSource::sourceType topoZoneType ( const word name) const

Return cell/face/point zone type or unknown.

Definition at line 638 of file fvExprDriver.C.

References mesh.

◆ topoSourceType()

Foam::topoSetSource::sourceType topoSourceType ( const word name) const

Return cell/face/point zone/set type or unknown.

Definition at line 660 of file fvExprDriver.C.

◆ getTopoSetLabels()

Foam::labelList getTopoSetLabels ( const word name,
enum topoSetSource::sourceType  setType 
) const

Read and return labels associated with the topo set.

Definition at line 38 of file fvExprDriverIO.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, IOobject::headerClassName(), mesh, Foam::name(), Foam::nl, and zoneID.

Here is the call graph for this function:

◆ isCellZone()

bool isCellZone ( const word name) const

Test if name is a known cellZone.

Definition at line 704 of file fvExprDriver.C.

References mesh, and Foam::name().

Here is the call graph for this function:

◆ isFaceZone()

bool isFaceZone ( const word name) const

Test if name is a known faceZone.

Definition at line 710 of file fvExprDriver.C.

References mesh, and Foam::name().

Here is the call graph for this function:

◆ isPointZone()

bool isPointZone ( const word name) const

Test if name is a known pointZone.

Definition at line 716 of file fvExprDriver.C.

References mesh, and Foam::name().

Here is the call graph for this function:

◆ isCellSet()

bool isCellSet ( const word name) const

Test if name is a known cellSet.

Definition at line 674 of file fvExprDriver.C.

◆ isFaceSet()

bool isFaceSet ( const word name) const

Test if name is a known faceSet.

Definition at line 684 of file fvExprDriver.C.

◆ isPointSet()

bool isPointSet ( const word name) const

Test if name is a known pointSet.

Definition at line 694 of file fvExprDriver.C.

◆ evaluateVariable()

void evaluateVariable ( const word varName,
const expressions::exprString expr 
)
virtual

Evaluate the expression and save as the specified named variable

Definition at line 381 of file fvExprDriver.C.

References DebugInfo, Foam::endl(), IOobject::headerClassName(), mesh, Foam::nl, and WarningInFunction.

Here is the call graph for this function:

◆ evaluateVariableRemote()

void evaluateVariableRemote ( string  remote,
const word varName,
const expressions::exprString expr 
)
virtual

Evaluate an expression on a remote and save as the specified named variable

The fully qualified form of the remote is given as follows

    type'name/region

If not specified, the default type is "patch", which means the following are equivalent

    patch'name/region
    name/region

If region is identical to the current region, it can be omitted:

    patch'name
    name   (default is patch)

Reimplemented from exprDriver.

Definition at line 429 of file fvExprDriver.C.

References objectRegistry::cfindObject(), DebugInfo, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, exprResult::isUniform(), mesh, fvExprDriver::New(), Foam::nl, exprDriver::parse(), regionName, fvExprDriver::setGlobalScopes(), exprDriver::setSearchBehaviour(), exprResult::testIfSingleValue(), fvMesh::time(), and word::validate().

Here is the call graph for this function:

◆ isVariable()

bool isVariable ( const word name,
bool  isPointVal = false,
label  expectSize = -1 
) const
inline

Test existence of a local/global variable.

Definition at line 74 of file fvExprDriverI.H.

References Foam::name().

Here is the call graph for this function:

◆ foundField()

bool foundField ( const word name) const

Test if specified field can be found in memory or disk.

Definition at line 135 of file fvExprDriverTemplates.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), IOobject::headerClassName(), Foam::Info, mesh, Foam::name(), and Foam::nl.

Here is the call graph for this function:

◆ getTypeOfField()

Foam::word getTypeOfField ( const word fieldName) const

Read the IOobject for fieldName and return its headerClassName.

Empty if the field could not be found.

Definition at line 583 of file fvExprDriver.C.

References mesh.

◆ readDict()

bool readDict ( const dictionary dict)
virtual

Read variables, tables etc.

Also usable for objects not constructed from a dictionary.

Reimplemented from exprDriver.

Reimplemented in parseDriver.

Definition at line 162 of file fvExprDriver.C.

References dict, Foam::endl(), keyType::LITERAL, exprDriver::readDict(), entry::stream(), and WarningInFunction.

Here is the call graph for this function:

◆ writeCommon()

Foam::Ostream & writeCommon ( Ostream os,
bool  debug = false 
) const

Write "variables", "storedVariables", "delayedVariables", "globalScopes" if they are present.

Definition at line 208 of file fvExprDriverIO.C.

References Foam::expressions::patchExpr::debug, forAllConstIters(), and Ostream::writeEntry().

Here is the call graph for this function:

◆ createWriterAndRead()

void createWriterAndRead ( const word name)

Create a writer for this object.

Definition at line 262 of file fvExprDriverIO.C.

References Foam::name(), and Foam::type().

Here is the call graph for this function:

◆ tryWrite()

void tryWrite ( ) const

Write data if appropriate Should enable exact restarts

Definition at line 271 of file fvExprDriverIO.C.

References mesh.

◆ getOrReadField() [2/2]

Foam::tmp<GeomField> getOrReadField ( const word name,
bool  mandatory,
bool  getOldTime 
)
inline

Definition at line 108 of file fvExprDriverI.H.

References mesh, and Foam::name().

Here is the call graph for this function:

◆ getOrReadPointField() [2/2]

Foam::tmp<GeomField> getOrReadPointField ( const word name,
bool  mandatory,
bool  getOldTime 
)
inline

Definition at line 127 of file fvExprDriverI.H.

References mesh, Foam::name(), and Foam::New().

Here is the call graph for this function:

◆ readAndRegister() [2/2]

Foam::tmp<GeomField> readAndRegister ( const word name,
const Mesh &  meshRef 
)
inline

Definition at line 146 of file fvExprDriverI.H.

References DebugInfo, Foam::name(), and Foam::nl.

Here is the call graph for this function:

◆ getVariable() [2/2]

Foam::tmp<Foam::Field<Type> > getVariable ( const word name,
label  expectedSize,
const bool  mandatory 
) const

Definition at line 76 of file fvExprDriverTemplates.C.

References tmp< T >::cref(), exprResult::cref(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::gAverage(), exprResult::isUniform(), Foam::name(), Foam::New(), Foam::nl, Foam::returnReduce(), tmp< T >::valid(), and WarningInFunction.

Here is the call graph for this function:

◆ getOrReadFieldImpl() [2/2]

Foam::tmp<GeomField> getOrReadFieldImpl ( const word name,
const Mesh &  meshRef,
bool  mandatory,
bool  getOldTime 
)

Definition at line 228 of file fvExprDriverTemplates.C.

◆ getTopoSet() [2/2]

Foam::autoPtr<T> getTopoSet ( const fvMesh mesh,
const word name,
SetOrigin origin 
) const

Definition at line 427 of file fvExprDriverTemplates.C.

Friends And Related Function Documentation

◆ exprDriverWriter

friend class exprDriverWriter
friend

Definition at line 380 of file fvExprDriver.H.


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