parseDriver Class Reference

Driver for patch expressions. More...

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

Public Member Functions

 ClassName ("patchExpr::driver")
 
 parseDriver (const parseDriver &)=delete
 
void operator= (const parseDriver &)=delete
 
 parseDriver (const fvPatch &p, const dictionary &dict=dictionary::null)
 Construct for specified patch, with dictionary information. More...
 
 parseDriver (const fvPatch &p, const parseDriver &driver, const dictionary &dict)
 Construct for specified patch with copy of driver context. More...
 
 parseDriver (const word &patchName, const fvMesh &mesh)
 Construct with patchName for the given mesh. More...
 
 parseDriver (const dictionary &dict, const fvMesh &mesh)
 
virtual ~parseDriver ()=default
 Destructor. More...
 
virtual const fvMeshmesh () const
 The mesh we are attached to. More...
 
virtual label size () const
 The natural field size for the expression. More...
 
virtual label pointSize () const
 The point field size for the expression. More...
 
label size (const FieldAssociation geoType) const
 Field size associated with different geometric field types. More...
 
virtual unsigned parse (const std::string &expr, size_t pos=0, size_t len=std::string::npos)
 Execute the parser. More...
 
template<class Type >
void setResult (Field< Type > *ptr, bool pointVal=false)
 Set result. More...
 
template<class Type >
tmp< Field< Type > > getVariableIfAvailable (const word &fldName) const
 Retrieve variable as field if possible. More...
 
template<class Type >
tmp< Field< Type > > getField (const word &fldName)
 Return named field. More...
 
template<class Type >
tmp< Field< Type > > getVolField (const word &fldName)
 Retrieve field (vol field) More...
 
template<class Type >
tmp< Field< Type > > getSurfaceField (const word &fldName)
 Retrieve field (surface field) More...
 
template<class Type >
tmp< Field< Type > > getPointField (const word &fldName)
 Retrieve field (point field) More...
 
template<class Type >
tmp< Field< Type > > patchInternalField (const word &fldName)
 Return internal field next to patch. More...
 
template<class Type >
tmp< Field< Type > > patchNeighbourField (const word &fldName)
 Return patchField on the opposite patch of a coupled patch. More...
 
template<class Type >
tmp< Field< Type > > patchNormalField (const word &fldName)
 Return surface normal field (snGrad) More...
 
template<class Type >
tmp< Field< Type > > faceToPoint (const Field< Type > &field) const
 Interpolate face to point. More...
 
template<class Type >
tmp< Field< Type > > pointToFace (const Field< Type > &field) const
 Interpolate point to face values. More...
 
template<class Type >
Type areaAverage (const Field< Type > &fld) const
 The area-weighted average of a field. More...
 
template<class Type >
Type areaSum (const Field< Type > &fld) const
 The area-weighted sum of a field. More...
 
tmp< scalarFieldfield_faceArea () const
 The face area magnitudes [magSf] - (swak = area) More...
 
tmp< vectorFieldfield_faceCentre () const
 The face centres - (swak = pos) More...
 
tmp< vectorFieldfield_areaNormal () const
 The face areas with their vector direction [Sf] - (swak = face) More...
 
tmp< vectorFieldfield_pointField () const
 The patch point locations - (swak = pts) More...
 
tmp< boolFieldfield_cellSet (const word &name) const
 Cell selection (set) More...
 
tmp< boolFieldfield_cellZone (const word &name) const
 Cell selection (zone) More...
 
tmp< boolFieldfield_faceSet (const word &name) const
 Face selection (set) More...
 
tmp< boolFieldfield_faceZone (const word &name) const
 Face selection (zone) More...
 
tmp< scalarFieldfield_rand (label seed=0, bool gaussian=false) const
 A uniform random field. More...
 
tmp< scalarFieldfield_randGaussian (label seed=0) const
 A Gaussian random field. More...
 
template<>
tmp< Field< bool > > getSurfaceField (const word &fldName)
 Retrieve field (surface field: bool) More...
 
template<>
tmp< Field< bool > > getPointField (const word &fldName)
 Retrieve field (point field: bool) More...
 
template<>
Foam::tmp< Foam::Field< bool > > getSurfaceField (const word &name)
 
template<>
Foam::tmp< Foam::Field< bool > > getPointField (const word &name)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > getVariableIfAvailable (const word &name) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > getVolField (const word &name)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > getField (const word &name)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > patchInternalField (const word &name)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > patchNeighbourField (const word &name)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > patchNormalField (const word &name)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > faceToPoint (const Field< Type > &field) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > pointToFace (const Field< Type > &field) const
 
template<class Type >
Foam::tmp< Foam::VolumeField< Type > > getVolField (const word &fldName, bool getOldTime)
 
template<class Type >
Foam::tmp< Foam::SurfaceField< Type > > getSurfaceField (const word &fldName, bool getOldTime)
 
template<class Type >
Foam::tmp< Foam::PointField< Type > > getPointField (const word &fldName, bool getOldTime)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > getField (const word &name) const
 
- Public Member Functions inherited from genericRagelLemonDriver
 genericRagelLemonDriver ()
 Construct null. More...
 
 genericRagelLemonDriver (const genericRagelLemonDriver &rhs)=default
 Copy construct. More...
 
 genericRagelLemonDriver (genericRagelLemonDriver &&rhs)=default
 Move construct. More...
 
virtual ~genericRagelLemonDriver ()=default
 Destructor. More...
 
void clear ()
 Reset references. More...
 
const std::string & content () const
 Get reference to the input buffer content. More...
 
void content (const std::string &s, size_t pos=0, size_t len=std::string::npos)
 
std::string::const_iterator cbegin () const
 Iterator to begin of content (sub)string. More...
 
std::string::const_iterator cend () const
 Iterator to end of content (sub)string. More...
 
size_t parsePosition () const
 The relative parse position with the content (sub)string. More...
 
size_t & parsePosition ()
 The relative parse position with the content (sub)string. More...
 
OstreamprintBuffer (Ostream &os) const
 Output the input buffer string content. More...
 
void reportFatal (const std::string &msg) const
 Report FatalError. More...
 
void reportFatal (const std::string &msg, size_t pos) const
 Report FatalError at parser position. More...
 
- Public Member Functions inherited from fvExprDriver
 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 (enum exprDriver::searchControls search=exprDriver::searchControls::DEFAULT_SEARCH, const dictionary &dict=dictionary::null)
 Default construct, and default construct with search preferences. More...
 
 fvExprDriver (const fvExprDriver &rhs, const dictionary &dict)
 Copy construct with dictionary reference. More...
 
 fvExprDriver (const dictionary &dict)
 Construct from a dictionary. More...
 
virtual autoPtr< fvExprDriverclone ()=delete
 Not generally clonable. More...
 
virtual ~fvExprDriver ()
 Destructor. More...
 
virtual label size () const =0
 The natural field size for the expression. More...
 
virtual label pointSize () const =0
 The point field size for the expression. More...
 
bool cacheSets () const
 Status of cache-sets (static variable) More...
 
virtual void clearVariables ()
 Clear temporary variables, reset 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, const bool wantPointData=false, const 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, const 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...
 
refPtr< labelListgetTopoSetLabels (const word &name, enum topoSetSource::sourceType setType) const
 Get the 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 wantPointData=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, const bool mandatory, const bool getOldTime)
 
template<class GeomField >
Foam::tmp< GeomField > getOrReadPointField (const word &name, const bool mandatory, const 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, const 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 (const exprDriver &)=delete
 No copy construct. More...
 
void operator= (const exprDriver &)=delete
 No copy assignment. More...
 
 exprDriver (enum searchControls search=searchControls::DEFAULT_SEARCH, const dictionary &dict=dictionary::null)
 Default construct, and default construct with search preferences. More...
 
 exprDriver (const exprDriver &rhs, const dictionary &dict)
 Copy construct with new dictionary reference. More...
 
 exprDriver (const dictionary &dict)
 Construct from a dictionary. More...
 
virtual ~exprDriver ()=default
 Destructor. More...
 
virtual label size () const
 The natural field size for the expression. More...
 
virtual label pointSize () const
 The point field size for the expression. More...
 
const TimeStatetimeState () const noexcept
 Reference to the current time-state (can be nullptr) More...
 
virtual scalar timeValue () const
 The current time value. More...
 
virtual scalar deltaT () const
 The current deltaT value. More...
 
const dictionarydict () const noexcept
 The dictionary with all input data/specification. More...
 
const exprResultresult () const noexcept
 Const access to expression result. More...
 
exprResultresult () noexcept
 Non-const access to expression result. More...
 
void clearResult ()
 Clear the result. More...
 
template<class Type >
tmp< Field< Type > > getResult (bool wantPointData=false)
 Return the expression result as a tmp field. More...
 
const wordgetResultType () const noexcept
 The result type as word - same as result().valueType() More...
 
void resetDb (const objectRegistry *obrPtr=nullptr)
 Reset the objectRegistry (for functions) More...
 
void resetDb (const objectRegistry &db)
 Reset the objectRegistry (for functions) More...
 
scalar argValue () const noexcept
 Get special-purpose scalar reference argument. More...
 
int stashedTokenId () const noexcept
 Get "look-behind" parsing context (internal bookkeeping) More...
 
int resetStashedTokenId (int tokenId=0) const noexcept
 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...
 
bool setCaching (bool on) noexcept
 Toggle CACHE_READ_FIELDS control. More...
 
void setSearchBehaviour (enum searchControls search, const bool caching=false)
 
void setSearchBehaviour (const exprDriver &rhs)
 Set search behaviour to be identical to rhs. More...
 
bool debugScanner () const noexcept
 Read access to scanner debug. More...
 
bool debugParser () const noexcept
 Read access to parser debug. More...
 
bool prevIterIsOldTime () const
 
virtual void clearVariables ()
 Clear temporary variables, reset from expression strings. More...
 
void setArgument (const scalar val) noexcept
 Set special-purpose scalar reference argument. 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...
 
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...
 
bool hasContextObjects () const
 True if any context fields are defined. More...
 
const regIOobjectcfindContextIOobject (const word &name) const
 Find named context field, if it exists. More...
 
template<class ObjType >
const ObjType * cfindContextObject (const word &name) const
 Find context field object of specified type. More...
 
void addContextObject (const word &name, const regIOobject *)
 Add the object to the context. More...
 
void addContextObject (const regIOobject *)
 Add the object to the context. More...
 
void removeContextObject (const word &name)
 Remove the object from the context. More...
 
void removeContextObject (const regIOobject *)
 Remove the object from the context. More...
 
const contextObjectTableTypecontextObjects () const noexcept
 Read access to the object context. More...
 
contextObjectTableTypecontextObjects () noexcept
 Write access to the object context. More...
 
template<class Type >
bool isFunction (const word &name) const
 Named mapping with given type exists. More...
 
template<class Type >
Type getFunctionValue (const word &name, const scalar x) const
 
template<class Type >
void fillFunctionValues (Field< Type > &result, const word &name, const scalarField &input) const
 Fill result with values remapped according to the named Function1. More...
 
template<class T >
bool isLocalVariable (const word &name, bool wantPointData=false, 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 wantPointData=false)
 Evaluate the expression and return the field. More...
 
template<class Type >
Type evaluateUniform (const expressions::exprString &expr, bool wantPointData=false)
 Evaluate the expression and return a single value. More...
 
void evaluateVariable (const word &varName, const expressions::exprString &expr)
 
virtual void evaluateVariableRemote (string remote, 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)
 
virtual bool readDict (const dictionary &dict)
 Read variables, tables etc. More...
 
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 wantPointData)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > getResult (bool wantPointData)
 
template<class Type >
const Foam::Function1< Type > * getFunction1Ptr (const word &name, const HashTable< refPtr< Function1< Type > > > &tbl, wordList *listFailure)
 
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
 

Protected Member Functions

tmp< boolFieldfield_cellSelection (const word &name, enum topoSetSource::sourceType setType) const
 Cell selections (as logical) More...
 
tmp< boolFieldfield_faceSelection (const word &name, enum topoSetSource::sourceType setType) const
 Face selections (as logical) More...
 
- Protected Member Functions inherited from fvExprDriver
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, const bool wantPointData=false, const 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, const bool wantPointData=false, const label expectSize=-1) const
 Test for the existence of a mesh field. More...
 
template<class GeomField >
tmp< GeomField > getOrReadField (const word &name, const bool mandatory=true, const bool getOldTime=false)
 Retrieve field from memory or disk. More...
 
template<class GeomField >
tmp< GeomField > getOrReadPointField (const word &name, const bool mandatory=true, const 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, const bool mandatory=true, const 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...
 
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
bool searchRegistry () const noexcept
 
bool searchFiles () const noexcept
 
bool cacheReadFields () const noexcept
 
void resetTimeReference (const TimeState *ts)
 Reset the time-state reference. More...
 
void resetTimeReference (const TimeState &ts)
 Reset the time-state reference. More...
 
void writeFunctions (Ostream &os) const
 Write scalar/vector Function1 entries in dictionary format. More...
 
virtual exprResultvariable (const word &name)
 Non-const access to the named variable (sub-classes only) More...
 
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 void updateSpecialVariables (bool force=false)
 Examine current variable values and update stored variables. More...
 
virtual exprResult getRemoteResult (const exprDriver &other) const
 Get the result from another driver. More...
 

Protected Attributes

const fvPatchpatch_
 The referenced patch. More...
 
- Protected Attributes inherited from genericRagelLemonDriver
std::reference_wrapper< const std::string > content_
 Reference to the input string. More...
 
size_t start_
 Start position within input string. More...
 
size_t length_
 Length of input (sub)string. More...
 
size_t position_
 The last known parser position. More...
 
- 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...
 
HashTable< refPtr< Function1< scalar > > > scalarFuncs_
 
HashTable< refPtr< Function1< vector > > > vectorFuncs_
 
contextObjectTableType contextObjects_
 Externally defined context fields. More...
 
scalar arg1Value_
 Special-purpose scalar reference argument. More...
 
const TimeStatetimeStatePtr_
 Reference to the time-state. More...
 
const objectRegistryobrPtr_
 Pointer to an object registry (for functions etc). 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...
 
searchControls searchCtrl_
 Registry/disk/caching control. More...
 

Additional Inherited Members

- Public Types inherited from genericRagelLemonDriver
typedef size_t location_type
 Type for linear addressing within parse content. More...
 
- Public Types inherited from exprDriver
enum  searchControls {
  NO_SEARCH = 0 , SEARCH_REGISTRY = 1 , SEARCH_FILES = 2 , CACHE_READ_FIELDS = 4 ,
  DEFAULT_SEARCH = (SEARCH_REGISTRY)
}
 Search/caching controls. More...
 
typedef HashTable< const regIOobject * > contextObjectTableType
 Externally defined context fields. More...
 
- Static Public Member Functions inherited from fvExprDriver
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 inherited from fvExprDriver
enum  SetOrigin {
  INVALID = 0 , NEW , FILE , MEMORY ,
  CACHE
}
 The origin of the topoSet. More...
 
- Static Protected Member Functions inherited from fvExprDriver
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 VolumeField< Type > &)
 
template<class T >
static void correctField (T &)
 Apply correctBoundaryConditions (volume fields only) More...
 
template<class Type >
static void correctField (VolumeField< Type > &fld)
 
- Static Protected Member Functions inherited from exprDriver
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...
 

Detailed Description

Driver for patch expressions.

In addition to the standard mathematical functions, operations and logical and relational operations, the patch expressions support the following driver-specific functions:

Functions

Function Description Number of arguments
pos The face centres 0
pts The face points 0
area The face area magnitudes 0
weightAverage Area weighted average 1
weightSum Area weighted sum 1
face The face areaNormal vectors 0
point A point-field point value 1
faceToPoint Interpolate face values onto points 1
pointToFace Interpolate point values onto faces 1
rand Random field 0/1
snGrad Surface normal field 0
internalField Internal field next to patch 0
neighbourField patch field on opposite side of coupled patch 0
Note
Use namespace debug switch patchExpr for scanner (2), parser (4) or dictionary controls as per Foam::expressions::exprDriver.
Source files

Definition at line 159 of file patchExprDriver.H.

Constructor & Destructor Documentation

◆ parseDriver() [1/5]

parseDriver ( const parseDriver )
delete

◆ parseDriver() [2/5]

parseDriver ( const fvPatch p,
const dictionary dict = dictionary::null 
)
explicit

Construct for specified patch, with dictionary information.

Definition at line 102 of file patchExprDriver.C.

References fvPatch::boundaryMesh(), fvBoundaryMesh::mesh(), parseDriver::patch_, exprDriver::resetDb(), exprDriver::resetTimeReference(), and fvMesh::thisDb().

Here is the call graph for this function:

◆ parseDriver() [3/5]

parseDriver ( const fvPatch p,
const parseDriver driver,
const dictionary dict 
)

Construct for specified patch with copy of driver context.

Definition at line 117 of file patchExprDriver.C.

References fvPatch::boundaryMesh(), fvBoundaryMesh::mesh(), parseDriver::patch_, exprDriver::resetDb(), exprDriver::resetTimeReference(), and fvMesh::thisDb().

Here is the call graph for this function:

◆ parseDriver() [4/5]

parseDriver ( const word patchName,
const fvMesh mesh 
)

Construct with patchName for the given mesh.

Definition at line 133 of file patchExprDriver.C.

◆ parseDriver() [5/5]

parseDriver ( const dictionary dict,
const fvMesh mesh 
)

Construct with "patch" (mandatory) and "region" (optional) specified in dictionary

Definition at line 143 of file patchExprDriver.C.

◆ ~parseDriver()

virtual ~parseDriver ( )
virtualdefault

Destructor.

Member Function Documentation

◆ field_cellSelection()

Foam::tmp< Foam::boolField > field_cellSelection ( const word name,
enum topoSetSource::sourceType  setType 
) const
protected

Cell selections (as logical)

Definition at line 59 of file patchExprDriverFields.C.

References topoSetSource::CELLSET_SOURCE, topoSetSource::CELLZONE_SOURCE, Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, HashTable< T, Key, Hash >::found(), Foam::name(), Time::New(), and Foam::nl.

Here is the call graph for this function:

◆ field_faceSelection()

Foam::tmp< Foam::boolField > field_faceSelection ( const word name,
enum topoSetSource::sourceType  setType 
) const
protected

Face selections (as logical)

Definition at line 104 of file patchExprDriverFields.C.

References Foam::exit(), topoSetSource::FACESET_SOURCE, topoSetSource::FACEZONE_SOURCE, Foam::FatalError, FatalErrorInFunction, forAll, HashTable< T, Key, Hash >::found(), Foam::name(), Time::New(), and Foam::nl.

Here is the call graph for this function:

◆ ClassName()

ClassName ( "patchExpr::driver"  )

◆ operator=()

void operator= ( const parseDriver )
delete

◆ mesh()

virtual const fvMesh & mesh ( ) const
inlinevirtual

The mesh we are attached to.

Implements fvExprDriver.

Definition at line 246 of file patchExprDriver.H.

References fvPatch::boundaryMesh(), fvBoundaryMesh::mesh(), and parseDriver::patch_.

Here is the call graph for this function:

◆ size() [1/2]

virtual label size ( ) const
inlinevirtual

The natural field size for the expression.

Implements fvExprDriver.

Definition at line 252 of file patchExprDriver.H.

References fvPatch::patch(), and parseDriver::patch_.

Referenced by parseDriver::getPointField(), and parseDriver::getVariableIfAvailable().

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

◆ pointSize()

virtual label pointSize ( ) const
inlinevirtual

The point field size for the expression.

Implements fvExprDriver.

Definition at line 258 of file patchExprDriver.H.

References PrimitivePatch< FaceList, PointField >::nPoints(), fvPatch::patch(), and parseDriver::patch_.

Referenced by parseDriver::getVariableIfAvailable().

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

◆ size() [2/2]

Foam::label size ( const FieldAssociation  geoType) const
inline

Field size associated with different geometric field types.

Definition at line 30 of file patchExprDriverI.H.

References Foam::expressions::FACE_DATA, PrimitivePatch< FaceList, PointField >::nPoints(), fvPatch::patch(), parseDriver::patch_, and Foam::expressions::POINT_DATA.

Here is the call graph for this function:

◆ parse()

unsigned parse ( const std::string &  expr,
size_t  pos = 0,
size_t  len = std::string::npos 
)
virtual

Execute the parser.

The return value currently has no meaning.

Implements exprDriver.

Definition at line 155 of file patchExprDriver.C.

References parseDriver::parse(), Foam::pos(), and scanner::process().

Referenced by parseDriver::parse().

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

◆ setResult()

void setResult ( Field< Type > *  ptr,
bool  pointVal = false 
)
inline

Set result.

Definition at line 286 of file patchExprDriver.H.

References exprDriver::result(), and exprResult::setResult().

Here is the call graph for this function:

◆ getVariableIfAvailable() [1/2]

tmp< Field< Type > > getVariableIfAvailable ( const word fldName) const

Retrieve variable as field if possible.

Test tmp for validity to determine success of the operation.

◆ getField() [1/3]

tmp< Field< Type > > getField ( const word fldName)

Return named field.

◆ getVolField() [1/3]

tmp< Field< Type > > getVolField ( const word fldName)

Retrieve field (vol field)

◆ getSurfaceField() [1/4]

tmp< Field< Type > > getSurfaceField ( const word fldName)

Retrieve field (surface field)

◆ getPointField() [1/4]

tmp< Field< Type > > getPointField ( const word fldName)

Retrieve field (point field)

◆ patchInternalField() [1/2]

tmp< Field< Type > > patchInternalField ( const word fldName)

Return internal field next to patch.

◆ patchNeighbourField() [1/2]

tmp< Field< Type > > patchNeighbourField ( const word fldName)

Return patchField on the opposite patch of a coupled patch.

◆ patchNormalField() [1/2]

tmp< Field< Type > > patchNormalField ( const word fldName)

Return surface normal field (snGrad)

◆ faceToPoint() [1/2]

tmp< Field< Type > > faceToPoint ( const Field< Type > &  field) const

Interpolate face to point.

◆ pointToFace() [1/2]

tmp< Field< Type > > pointToFace ( const Field< Type > &  field) const

Interpolate point to face values.

◆ areaAverage()

Type areaAverage ( const Field< Type > &  fld) const
inline

The area-weighted average of a field.

Definition at line 344 of file patchExprDriver.H.

References fld(), fvPatch::magSf(), parseDriver::patch_, and exprDriver::weightedAverage().

Here is the call graph for this function:

◆ areaSum()

Type areaSum ( const Field< Type > &  fld) const
inline

The area-weighted sum of a field.

Definition at line 351 of file patchExprDriver.H.

References fld(), fvPatch::magSf(), parseDriver::patch_, and exprDriver::weightedSum().

Here is the call graph for this function:

◆ field_faceArea()

Foam::tmp< Foam::scalarField > field_faceArea ( ) const

The face area magnitudes [magSf] - (swak = area)

Definition at line 150 of file patchExprDriverFields.C.

◆ field_faceCentre()

Foam::tmp< Foam::vectorField > field_faceCentre ( ) const

The face centres - (swak = pos)

Definition at line 157 of file patchExprDriverFields.C.

◆ field_areaNormal()

Foam::tmp< Foam::vectorField > field_areaNormal ( ) const

The face areas with their vector direction [Sf] - (swak = face)

Definition at line 164 of file patchExprDriverFields.C.

◆ field_pointField()

Foam::tmp< Foam::vectorField > field_pointField ( ) const

The patch point locations - (swak = pts)

Definition at line 171 of file patchExprDriverFields.C.

◆ field_cellSet()

Foam::tmp< Foam::volScalarField > field_cellSet ( const word name) const
inline

Cell selection (set)

Definition at line 51 of file patchExprDriverI.H.

References topoSetSource::CELLSET_SOURCE, and Foam::name().

Here is the call graph for this function:

◆ field_cellZone()

Foam::tmp< Foam::boolField > field_cellZone ( const word name) const
inline

Cell selection (zone)

Definition at line 65 of file patchExprDriverI.H.

References topoSetSource::CELLZONE_SOURCE, and Foam::name().

Here is the call graph for this function:

◆ field_faceSet()

Foam::tmp< Foam::boolField > field_faceSet ( const word name) const
inline

Face selection (set)

Definition at line 79 of file patchExprDriverI.H.

References topoSetSource::FACESET_SOURCE, and Foam::name().

Here is the call graph for this function:

◆ field_faceZone()

Foam::tmp< Foam::boolField > field_faceZone ( const word name) const
inline

Face selection (zone)

Definition at line 93 of file patchExprDriverI.H.

References topoSetSource::FACEZONE_SOURCE, and Foam::name().

Here is the call graph for this function:

◆ field_rand()

Foam::tmp< Foam::scalarField > field_rand ( label  seed = 0,
bool  gaussian = false 
) const

A uniform random field.

Definition at line 178 of file patchExprDriverFields.C.

References exprDriver::fill_random(), and Time::New().

Referenced by parseDriver::field_randGaussian().

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

◆ field_randGaussian()

tmp< scalarField > field_randGaussian ( label  seed = 0) const
inline

A Gaussian random field.

Definition at line 386 of file patchExprDriver.H.

References parseDriver::field_rand().

Here is the call graph for this function:

◆ getSurfaceField() [2/4]

Foam::tmp< Foam::Field< Type > > getSurfaceField ( const word fldName)

Retrieve field (surface field: bool)

Definition at line 92 of file patchExprDriverTemplates.C.

References Foam::name().

Here is the call graph for this function:

◆ getPointField() [2/4]

Foam::tmp< Foam::Field< Type > > getPointField ( const word fldName)

Retrieve field (point field: bool)

Definition at line 100 of file patchExprDriverTemplates.C.

References Foam::name().

Here is the call graph for this function:

◆ getSurfaceField() [3/4]

Foam::tmp< Foam::Field< bool > > getSurfaceField ( const word name)

Definition at line 1 of file patchExprDriverFields.C.

◆ getPointField() [3/4]

Foam::tmp< Foam::Field< bool > > getPointField ( const word name)

Definition at line 1 of file patchExprDriverFields.C.

References Foam::name(), and parseDriver::size().

Here is the call graph for this function:

◆ getVariableIfAvailable() [2/2]

Foam::tmp< Foam::Field< Type > > getVariableIfAvailable ( const word name) const

Definition at line 34 of file patchExprDriverTemplates.C.

References refPtr< T >::cref(), Foam::endl(), Foam::gAverage(), fvExprDriver::hasVariable(), fvExprDriver::lookupGlobal(), Foam::name(), fvExprDriver::New(), parseDriver::pointSize(), Foam::returnReduce(), parseDriver::size(), UList< T >::size(), refPtr< T >::valid(), fvExprDriver::variable(), and WarningInFunction.

Here is the call graph for this function:

◆ getVolField() [2/3]

Foam::tmp< Foam::Field< Type > > getVolField ( const word name)

Definition at line 84 of file patchExprDriverTemplates.C.

References Foam::name().

Here is the call graph for this function:

◆ getField() [2/3]

Foam::tmp< Foam::Field< Type > > getField ( const word name)

Definition at line 108 of file patchExprDriverTemplates.C.

References exprDriver::cfindContextIOobject(), objectRegistry::cfindIOobject(), tmp< T >::cref(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), found, mesh, Foam::name(), Time::New(), Foam::New(), Foam::nl, objectRegistry::sortedNames(), and tmp< T >::valid().

Here is the call graph for this function:

◆ patchInternalField() [2/2]

Foam::tmp< Foam::Field< Type > > patchInternalField ( const word name)

Definition at line 226 of file patchExprDriverTemplates.C.

References exprDriver::cfindContextIOobject(), objectRegistry::cfindIOobject(), tmp< T >::cref(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), found, mesh, Foam::name(), Time::New(), Foam::New(), Foam::nl, objectRegistry::sortedNames(), and tmp< T >::valid().

Here is the call graph for this function:

◆ patchNeighbourField() [2/2]

Foam::tmp< Foam::Field< Type > > patchNeighbourField ( const word name)

Definition at line 323 of file patchExprDriverTemplates.C.

References exprDriver::cfindContextIOobject(), objectRegistry::cfindIOobject(), tmp< T >::cref(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), found, mesh, Foam::name(), Foam::New(), Foam::nl, objectRegistry::sortedNames(), and tmp< T >::valid().

Here is the call graph for this function:

◆ patchNormalField() [2/2]

Foam::tmp< Foam::Field< Type > > patchNormalField ( const word name)

Definition at line 398 of file patchExprDriverTemplates.C.

References exprDriver::cfindContextIOobject(), objectRegistry::cfindIOobject(), tmp< T >::cref(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), found, mesh, Foam::name(), Foam::New(), Foam::nl, objectRegistry::sortedNames(), and tmp< T >::valid().

Here is the call graph for this function:

◆ faceToPoint() [2/2]

Foam::tmp< Foam::Field< Type > > faceToPoint ( const Field< Type > &  field) const

Definition at line 473 of file patchExprDriverTemplates.C.

References PrimitivePatchInterpolation< Patch >::faceToPointInterpolate(), and field().

Here is the call graph for this function:

◆ pointToFace() [2/2]

Foam::tmp< Foam::Field< Type > > pointToFace ( const Field< Type > &  field) const

Definition at line 486 of file patchExprDriverTemplates.C.

References field(), and PrimitivePatchInterpolation< Patch >::pointToFaceInterpolate().

Here is the call graph for this function:

◆ getVolField() [3/3]

Foam::tmp< Foam::VolumeField< Type > > getVolField ( const word fldName,
bool  getOldTime 
)

Definition at line 180 of file volumeExprDriverTemplates.C.

◆ getSurfaceField() [4/4]

Foam::tmp< Foam::SurfaceField< Type > > getSurfaceField ( const word fldName,
bool  getOldTime 
)

Definition at line 197 of file volumeExprDriverTemplates.C.

◆ getPointField() [4/4]

Foam::tmp< Foam::PointField< Type > > getPointField ( const word fldName,
bool  getOldTime 
)

Definition at line 214 of file volumeExprDriverTemplates.C.

◆ getField() [3/3]

Foam::tmp< Foam::Field< Type > > getField ( const word name) const

Definition at line 32 of file fieldExprDriverTemplates.C.

References refPtr< T >::cref(), Foam::endl(), Foam::gAverage(), exprDriver::hasVariable(), Foam::name(), Foam::New(), parseDriver::pointSize(), Foam::returnReduce(), parseDriver::size(), UList< T >::size(), exprDriver::variable(), and WarningInFunction.

Here is the call graph for this function:

Member Data Documentation

◆ patch_


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