Driver for volume, surface, point field expressions. More...
#include <volumeExprDriver.H>


Public Member Functions | |
| ClassName ("volumeExpr::driver") | |
| parseDriver (const parseDriver &)=delete | |
| void | operator= (const parseDriver &)=delete |
| parseDriver (const fvMesh &mesh, const dictionary &dict=dictionary::null) | |
| Construct for specified mesh, with dictionary information. | |
| parseDriver (const fvMesh &mesh, const parseDriver &driver, const dictionary &dict) | |
| Construct for specified mesh with copy of driver context. | |
| parseDriver (const word &meshName, const fvMesh &mesh) | |
| Construct with meshName for the given mesh. | |
| parseDriver (const dictionary &dict, const fvMesh &mesh) | |
| Construct with patchName and region specified in dictionary. | |
| virtual | ~parseDriver ()=default |
| Destructor. | |
| virtual const fvMesh & | mesh () const |
| The mesh we are attached to. | |
| virtual label | size () const |
| The natural field size for the expression. | |
| virtual label | pointSize () const |
| The point field size for the expression. | |
| label | size (const FieldAssociation geoType) const |
| Field size associated with different geometric field types. | |
| bool | hasDimensions () const noexcept |
| Apply dimensions() to geometric fields. | |
| const dimensionSet & | dimensions () const noexcept |
| The preferred result dimensions (if any). | |
| void | clearField () |
| Clear out local copies of the field. | |
| virtual bool | readDict (const dictionary &dict) |
| Read variables, tables etc. | |
| virtual unsigned | parse (const std::string &expr, size_t pos=0, size_t len=std::string::npos) |
| Execute the parser. | |
| const word & | resultType () const noexcept |
| The result type-name. | |
| FieldAssociation | fieldAssociation () const noexcept |
| The geometric field association. | |
| bool | isLogical () const noexcept |
| A logical (bool-like) field. Actually stored as a scalar. | |
| bool | isVolumeData () const noexcept |
| A volume field. | |
| bool | isFaceData () const noexcept |
| A surface field. | |
| bool | isPointData () const noexcept |
| A point field. | |
| template<class GeoField> | |
| const GeoField * | isResultType () const |
| Test if stored result pointer is the specified type. | |
| template<class GeoField> | |
| const GeoField * | isResultType (bool logical, bool dieOnNull=false) const |
| Test if stored result pointer is the specified type and matches the specified logical type. | |
| autoPtr< regIOobject > | dupZeroField () const |
| A zero-initialized field with the same type as the result field. | |
| template<class Type> | |
| void | setResult (VolumeField< Type > *ptr, bool logical=false) |
| Set result (vol field). | |
| template<class Type> | |
| void | setResult (SurfaceField< Type > *ptr, bool logical=false) |
| Set result (surface field). | |
| template<class Type> | |
| void | setResult (PointField< Type > *ptr, bool logical=false) |
| Set result (point field). | |
| template<class Type> | |
| tmp< VolumeField< Type > > | newVolField (const Type &val=pTraits< Type >::zero) const |
| Return a new volume field with the mesh size. | |
| template<class Type> | |
| tmp< SurfaceField< Type > > | newSurfaceField (const Type &val=pTraits< Type >::zero) const |
| Return a new surface field with the mesh nInternalFaces size. | |
| template<class Type> | |
| tmp< PointField< Type > > | newPointField (const Type &val=pTraits< Type >::zero) const |
| Return a new point field with the mesh nPoints size. | |
| template<class Type> | |
| tmp< VolumeField< Type > > | getVolField (const word &fldName, bool getOldTime=false) |
| Retrieve field (vol field). | |
| template<class Type> | |
| tmp< SurfaceField< Type > > | getSurfaceField (const word &fldName, bool getOldTime=false) |
| Retrieve field (surface field). | |
| template<class Type> | |
| tmp< PointField< Type > > | getPointField (const word &fldName, bool getOldTime=false) |
| Retrieve field (surface field). | |
| template<class Type> | |
| tmp< SurfaceField< Type > > | cellToFace (const VolumeField< Type > &field) const |
| Interpolate cell to face values. | |
| template<class Type> | |
| tmp< PointField< Type > > | cellToPoint (const VolumeField< Type > &field) const |
| Interpolate cell to point values. | |
| template<class Type> | |
| tmp< VolumeField< Type > > | pointToCell (const PointField< Type > &field) const |
| Interpolate point to cell values. | |
| template<class Type> | |
| Type | volAverage (VolumeField< Type > &fld) const |
| The volume-weighted average of a field. | |
| template<class Type> | |
| Type | volSum (VolumeField< Type > &fld) const |
| The volume-weighted sum of a field. | |
| template<class Type> | |
| Type | areaAverage (SurfaceField< Type > &fld) const |
| The area-weighted average of a field. | |
| template<class Type> | |
| Type | areaSum (SurfaceField< Type > &fld) const |
| The area-weighted sum of a field. | |
| tmp< volScalarField > | field_cellVolume () const |
| The cell volumes - (swak = vol). | |
| tmp< volVectorField > | field_cellCentre () const |
| The cell centres - (swak = pos). | |
| tmp< surfaceScalarField > | field_faceArea () const |
| The face area magnitudes [magSf] - (swak = area). | |
| tmp< surfaceVectorField > | field_faceCentre () const |
| The face centres - (swak = fpos). | |
| tmp< surfaceVectorField > | field_areaNormal () const |
| The face areas with their vector direction [Sf] - (swak = face). | |
| tmp< pointVectorField > | field_pointField () const |
| The mesh point locations - (swak = pts). | |
| tmp< volScalarField > | field_cellSet (const word &name) const |
| Cell selection (set). | |
| tmp< volScalarField > | field_cellZone (const word &name) const |
| Cell selection (zone). | |
| tmp< surfaceScalarField > | field_faceSet (const word &name) const |
| Face selection (set). | |
| tmp< surfaceScalarField > | field_faceZone (const word &name) const |
| Face selection (zone). | |
| tmp< pointScalarField > | field_pointSet (const word &name) const |
| Point selection (set). | |
| tmp< pointScalarField > | field_pointZone (const word &name) const |
| Point selection (zone). | |
| tmp< volScalarField > | field_rand (label seed=0, bool gaussian=false) const |
| A uniform random field. | |
| tmp< volScalarField > | field_randGaussian (label seed=0) const |
| A Gaussian random field. | |
| template<class GeomField> | |
| const GeomField * | isResultType () const |
| template<class GeomField> | |
| const GeomField * | isResultType (bool logical, bool dieOnNull) const |
| template<class Type> | |
| Foam::tmp< Foam::VolumeField< Type > > | newVolField (const Type &val) const |
| template<class Type> | |
| Foam::tmp< Foam::SurfaceField< Type > > | newSurfaceField (const Type &val) const |
| template<class Type> | |
| Foam::tmp< Foam::PointField< Type > > | newPointField (const Type &val) const |
| template<class Type> | |
| Foam::tmp< Foam::SurfaceField< Type > > | cellToFace (const VolumeField< Type > &field) const |
| template<class Type> | |
| Foam::tmp< Foam::PointField< Type > > | cellToPoint (const VolumeField< Type > &field) const |
| template<class Type> | |
| Foam::tmp< Foam::VolumeField< Type > > | pointToCell (const PointField< Type > &field) const |
| Public Member Functions inherited from genericRagelLemonDriver | |
| genericRagelLemonDriver () | |
| Construct null. | |
| genericRagelLemonDriver (const genericRagelLemonDriver &rhs)=default | |
| Copy construct. | |
| genericRagelLemonDriver (genericRagelLemonDriver &&rhs)=default | |
| Move construct. | |
| virtual | ~genericRagelLemonDriver ()=default |
| Destructor. | |
| void | clear () |
| Reset references. | |
| const std::string & | content () const |
| Get reference to the input buffer content. | |
| void | content (const std::string &s, size_t pos=0, size_t len=std::string::npos) |
| Set reference to the input buffer content, which acts like a std::string_view. | |
| std::string::const_iterator | cbegin () const |
| Iterator to begin of content (sub)string. | |
| std::string::const_iterator | cend () const |
| Iterator to end of content (sub)string. | |
| size_t | parsePosition () const |
| The relative parse position with the content (sub)string. | |
| size_t & | parsePosition () |
| The relative parse position with the content (sub)string. | |
| Ostream & | printBuffer (Ostream &os) const |
| Output the input buffer string content. | |
| void | reportFatal (const std::string &msg) const |
| Report FatalError. | |
| void | reportFatal (const std::string &msg, size_t pos) const |
| Report FatalError at parser position. | |
| Public Member Functions inherited from fvExprDriver | |
| TypeName ("fvExprDriver") | |
| Runtime type information. | |
| 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. | |
| fvExprDriver (const fvExprDriver &rhs, const dictionary &dict) | |
| Copy construct with dictionary reference. | |
| fvExprDriver (const dictionary &dict) | |
| Construct from a dictionary. | |
| virtual autoPtr< fvExprDriver > | clone ()=delete |
| Not generally clonable. | |
| virtual | ~fvExprDriver () |
| Destructor. | |
| bool | cacheSets () const |
| Status of cache-sets (static variable). | |
| virtual void | clearVariables () |
| Clear temporary variables, reset from expression strings. | |
| virtual bool | hasVariable (const word &name) const |
| True if named variable exists. | |
| virtual const exprResult & | variable (const word &name) const |
| Return const-access to the named variable. | |
| 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. | |
| 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. | |
| word | getFieldClassName (const word &name) const |
| Lookup the field class name (memory or read from disk). | |
| topoSetSource::sourceType | topoSetType (const word &name) const |
| Return cell/face/point set type or unknown. | |
| topoSetSource::sourceType | topoZoneType (const word &name) const |
| Return cell/face/point zone type or unknown. | |
| topoSetSource::sourceType | topoSourceType (const word &name) const |
| Return cell/face/point zone/set type or unknown. | |
| refPtr< labelList > | getTopoSetLabels (const word &name, enum topoSetSource::sourceType setType) const |
| Get the labels associated with the topo set. | |
| bool | isCellZone (const word &name) const |
| Test if name is a known cellZone. | |
| bool | isFaceZone (const word &name) const |
| Test if name is a known faceZone. | |
| bool | isPointZone (const word &name) const |
| Test if name is a known pointZone. | |
| bool | isCellSet (const word &name) const |
| Test if name is a known cellSet. | |
| bool | isFaceSet (const word &name) const |
| Test if name is a known faceSet. | |
| bool | isPointSet (const word &name) const |
| Test if name is a known pointSet. | |
| virtual void | evaluateVariable (const word &varName, const expressions::exprString &expr) |
| Evaluate the expression and save as the specified named variable. | |
| virtual void | evaluateVariableRemote (string remote, const word &varName, const expressions::exprString &expr) |
| Evaluate an expression on a remote and save as the specified named variable. | |
| template<class Type> | |
| bool | isVariable (const word &name, bool wantPointData=false, label expectSize=-1) const |
| Test existence of a local/global variable. | |
| template<class Type> | |
| bool | foundField (const word &name) const |
| Test if specified field can be found in memory or disk. | |
| word | getTypeOfField (const word &fieldName) const |
| Read the IOobject for fieldName and return its headerClassName. | |
| Ostream & | writeCommon (Ostream &os, bool debug=false) const |
| Write "variables", "storedVariables", "delayedVariables", "globalScopes" if they are present. | |
| void | createWriterAndRead (const word &name) |
| Create a writer for this object. | |
| void | tryWrite () const |
| Write data if appropriate Should enable exact restarts. | |
| 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< T > | getTopoSet (const fvMesh &mesh, const word &name, SetOrigin &origin) const |
| Public Member Functions inherited from exprDriver | |
| TypeName ("exprDriver") | |
| Runtime type information. | |
| exprDriver (const exprDriver &)=delete | |
| No copy construct. | |
| void | operator= (const exprDriver &)=delete |
| No copy assignment. | |
| exprDriver (enum searchControls search=searchControls::DEFAULT_SEARCH, const dictionary &dict=dictionary::null) | |
| Default construct, and default construct with search preferences. | |
| exprDriver (const exprDriver &rhs, const dictionary &dict) | |
| Copy construct with new dictionary reference. | |
| exprDriver (const dictionary &dict) | |
| Construct from a dictionary. | |
| virtual | ~exprDriver ()=default |
| Destructor. | |
| const TimeState * | timeState () const noexcept |
| Reference to the current time-state (can be nullptr). | |
| virtual scalar | timeValue () const |
| The current time value. | |
| virtual scalar | deltaT () const |
| The current deltaT value. | |
| const dictionary & | dict () const noexcept |
| The dictionary with all input data/specification. | |
| const exprResult & | result () const noexcept |
| Const access to expression result. | |
| exprResult & | result () noexcept |
| Non-const access to expression result. | |
| void | clearResult () |
| Clear the result. | |
| template<class Type> | |
| tmp< Field< Type > > | getResult (bool wantPointData=false) |
| Return the expression result as a tmp field. | |
| const word & | getResultType () const noexcept |
| The result type as word - same as result().valueType(). | |
| void | resetDb (const objectRegistry *obrPtr=nullptr) |
| Reset the objectRegistry (for functions). | |
| void | resetDb (const objectRegistry &db) |
| Reset the objectRegistry (for functions). | |
| scalar | argValue () const noexcept |
| Get special-purpose scalar reference argument. | |
| int | stashedTokenId () const noexcept |
| Get "look-behind" parsing context (internal bookkeeping). | |
| int | resetStashedTokenId (int tokenId=0) const noexcept |
| Reset "look-behind" parsing context (mutable operation). | |
| void | setDebugging (bool scannerDebug, bool parserDebug) |
| Set the scanner/parser debug. | |
| void | setDebugging (const exprDriver &rhs) |
| Set the scanner/parser debug to match the input. | |
| bool | setCaching (bool on) noexcept |
| Toggle CACHE_READ_FIELDS control. | |
| void | setSearchBehaviour (enum searchControls search, const bool caching=false) |
| Set search behaviour, with additional CACHE_READ_FIELDS toggle on. | |
| void | setSearchBehaviour (const exprDriver &rhs) |
| Set search behaviour to be identical to rhs. | |
| bool | debugScanner () const noexcept |
| Read access to scanner debug. | |
| bool | debugParser () const noexcept |
| Read access to parser debug. | |
| bool | prevIterIsOldTime () const |
| void | setArgument (const scalar val) noexcept |
| Set special-purpose scalar reference argument. | |
| void | addVariables (const expressions::exprString &expr, bool clear=true) |
| Add/set string expressions for variables. | |
| void | addVariables (const UList< expressions::exprString > &list, bool clear=true) |
| Add/set string expressions for variables. | |
| template<class T> | |
| void | addUniformVariable (const word &name, const T &val) |
| Add a uniform variable from an outside caller. | |
| bool | hasContextObjects () const |
| True if any context fields are defined. | |
| const regIOobject * | cfindContextIOobject (const word &name) const |
| Find named context field, if it exists. | |
| template<class ObjType> | |
| const ObjType * | cfindContextObject (const word &name) const |
| Find context field object of specified type. | |
| void | addContextObject (const word &name, const regIOobject *) |
| Add the object to the context. | |
| void | addContextObject (const regIOobject *) |
| Add the object to the context. | |
| void | removeContextObject (const word &name) |
| Remove the object from the context. | |
| void | removeContextObject (const regIOobject *) |
| Remove the object from the context. | |
| const contextObjectTableType & | contextObjects () const noexcept |
| Read access to the object context. | |
| contextObjectTableType & | contextObjects () noexcept |
| Write access to the object context. | |
| template<class Type> | |
| bool | isFunction (const word &name) const |
| Named mapping with given type exists. | |
| template<class Type> | |
| Type | getFunctionValue (const word &name, const scalar x) const |
| Evaluate named mapping for the given time/value. Zero for undefined/unknown. | |
| 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. | |
| template<class T> | |
| bool | isLocalVariable (const word &name, bool wantPointData=false, label expectedSize=-1) const |
| Test existence of a local variable. | |
| 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. | |
| template<class Type> | |
| tmp< Field< Type > > | evaluate (const expressions::exprString &expr, bool wantPointData=false) |
| Evaluate the expression and return the field. | |
| template<class Type> | |
| Type | evaluateUniform (const expressions::exprString &expr, bool wantPointData=false) |
| Evaluate the expression and return a single value. | |
| void | evaluateVariable (const word &varName, const expressions::exprString &expr) |
| Evaluate the expression and save as the specified named variable. | |
| template<class Type> | |
| tmp< Field< Type > > | newField (const Type &val=pTraits< Type >::zero) const |
| Return a new field with the size(). | |
| template<class Type> | |
| tmp< Field< Type > > | newPointField (const Type &val=pTraits< Type >::zero) const |
| Return a new field with the pointSize(). | |
| expressions::exprString | readExpression (const word &name) |
| Read an expression string (with the current dictionary) and do substitutions. | |
| label | setVariableStrings (const dictionary &dict, bool mandatory=false) |
| Read "variables" and assigns to the list of expression strings. | |
| Ostream & | writeVariableStrings (Ostream &os, const word &keyword="") const |
| Write "variables". | |
| 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 | |
| template<class Type> | |
| void | setInternalFieldResult (const Field< Type > &fld) |
| Deep-copy the internalField as a result. | |
| tmp< volScalarField > | field_cellSelection (const word &name, enum topoSetSource::sourceType setType) const |
| Cell selections (as logical). | |
| tmp< surfaceScalarField > | field_faceSelection (const word &name, enum topoSetSource::sourceType setType) const |
| Face selections (as logical). | |
| tmp< pointScalarField > | field_pointSelection (const word &name, enum topoSetSource::sourceType setType) const |
| Point selections (as logical). | |
| Protected Member Functions inherited from fvExprDriver | |
| void | setGlobalScopes (const wordUList &scopes) |
| Define scopes for global variables. | |
| virtual exprResult & | variable (const word &name) |
| Non-const access to the named variable (sub-classes only). | |
| template<class T> | |
| bool | isGlobalVariable (const word &name, const bool wantPointData=false, const label expectedSize=-1) const |
| Test existence of a global variable. | |
| const exprResult & | lookupGlobal (const word &name) const |
| Return the global variable if available or a null result. | |
| 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. | |
| template<class GeomField> | |
| tmp< GeomField > | getOrReadField (const word &name, const bool mandatory=true, const bool getOldTime=false) |
| Retrieve field from memory or disk. | |
| template<class GeomField> | |
| tmp< GeomField > | getOrReadPointField (const word &name, const bool mandatory=true, const bool getOldTime=false) |
| Retrieve point field from memory or disk. | |
| 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). | |
| template<class GeomField, class MeshRef> | |
| tmp< GeomField > | readAndRegister (const word &name, const MeshRef &meshRef) |
| Helper function for getOrReadField. | |
| template<class T> | |
| autoPtr< T > | getTopoSet (const fvMesh &mesh, const word &setName, SetOrigin &origin) const |
| Get topoSet. | |
| template<class T> | |
| bool | updateSet (autoPtr< T > &setPtr, const word &setName, SetOrigin origin) const |
| Update topoSet. | |
| virtual void | updateSpecialVariables (bool force=false) |
| Examine current variable values and update stored variables. | |
| virtual bool | hasDataToWrite () const |
| Do we need a data file to be written. | |
| virtual void | prepareData (dictionary &dict) const |
| Prepare/update special variables and add to dictionary, normally via the reader/writer. | |
| virtual void | getData (const dictionary &dict) |
| Read data from dictionary, normally via the reader/writer. | |
| 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. | |
| void | resetTimeReference (const TimeState &ts) |
| Reset the time-state reference. | |
| void | writeFunctions (Ostream &os) const |
| Write scalar/vector Function1 entries in dictionary format. | |
| void | fill_random (scalarField &field, label seed=0, const bool gaussian=false) const |
| Fill a random field. | |
| virtual bool | update () |
| Update things. | |
| virtual exprResult | getRemoteResult (const exprDriver &other) const |
| Get the result from another driver. | |
Protected Attributes | |
| const fvMesh & | mesh_ |
| The referenced mesh. | |
| autoPtr< regIOobject > | resultField_ |
| The results (volume, surface, point). | |
| word | resultType_ |
| The result type-name. | |
| bool | isLogical_ |
| A logical (bool-like) field (but actually a scalar). | |
| bool | hasDimensions_ |
| Requested use of dimensions. | |
| expressions::FieldAssociation | fieldGeoType_ |
| A volume/surface/point field. | |
| dimensionSet | resultDimensions_ |
| The result dimensions. | |
| Protected Attributes inherited from genericRagelLemonDriver | |
| std::reference_wrapper< const std::string > | content_ |
| Reference to the input string. | |
| size_t | start_ |
| Start position within input string. | |
| size_t | length_ |
| Length of input (sub)string. | |
| size_t | position_ |
| The last known parser position. | |
| Protected Attributes inherited from exprDriver | |
| const dictionary & | dict_ |
| The dictionary with all input data/specification. | |
| exprResult | result_ |
| The result. | |
| List< expressions::exprString > | variableStrings_ |
| Variable definitions, as read from a dictionary. | |
| HashTable< exprResult > | variables_ |
| The variables table. | |
| HashTable< refPtr< Function1< scalar > > > | scalarFuncs_ |
| Function1 mappings/timelines (scalar), evaluated at the simulation time or with arbitrary scalars. | |
| HashTable< refPtr< Function1< vector > > > | vectorFuncs_ |
| Function1 mappings/timelines (vector), evaluated at the simulation time or with arbitrary scalars. | |
| contextObjectTableType | contextObjects_ |
| Externally defined context fields. | |
| scalar | arg1Value_ |
| Special-purpose scalar reference argument. | |
| const TimeState * | timeStatePtr_ |
| Reference to the time-state. | |
| const objectRegistry * | obrPtr_ |
| Pointer to an object registry (for functions etc). | |
| int | stashedTokenId_ |
| Internal bookkeeping as "look-behind" parsing context. | |
| bool | debugScanner_ |
| Request debugging for scanner. | |
| bool | debugParser_ |
| Request debugging for parser. | |
| bool | allowShadowing_ |
| Allow variable names to mask field names. | |
| bool | prevIterIsOldTime_ |
| Use value of previous iteration when oldTime is requested. | |
| searchControls | searchCtrl_ |
| Registry/disk/caching control. | |
Additional Inherited Members | |
| Public Types inherited from genericRagelLemonDriver | |
| typedef size_t | location_type |
| Type for linear addressing within parse content. | |
| 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. | |
| Static Public Member Functions inherited from fvExprDriver | |
| static const fvMesh & | defaultMesh () |
| Get the default mesh, if one is defined. | |
| static const fvMesh * | resetDefaultMesh (const fvMesh &mesh, const bool force=false) |
| Set the default mesh (if not already set). | |
| static autoPtr< fvExprDriver > | New (const dictionary &dict, const fvMesh &mesh) |
| Return a reference to the selected value driver. | |
| static autoPtr< fvExprDriver > | New (const dictionary &dict) |
| Return a reference to the selected value driver. | |
| static autoPtr< fvExprDriver > | New (const word &type, const word &id, const fvMesh &mesh) |
| Return a reference to the selected value driver. | |
| Static Public Member Functions inherited from exprDriver | |
| static expressions::exprString | readExpression (const word &name, const dictionary &dict) |
| Read an expression string and do substitutions. | |
| static List< expressions::exprString > | readVariableStrings (const dictionary &dict, const word &name="variables", bool mandatory=false) |
| Read the list of variable strings. | |
| 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 fvMesh & | regionMesh (const dictionary &dict, const fvMesh &mesh, bool readIfNecessary) |
| Determine mesh or region mesh as specified in the dictionary with the keyword "region". | |
| template<class T> | |
| static word | defaultBoundaryType (const T &) |
| Default boundary type is calculated. | |
| template<class Type> | |
| static word | defaultBoundaryType (const VolumeField< Type > &) |
| Default boundary type for volume fields is zeroGradient since they are essentially just internal fields. | |
| template<class T> | |
| static void | correctField (T &) |
| Apply correctBoundaryConditions (volume fields only). | |
| template<class Type> | |
| static void | correctField (VolumeField< Type > &fld) |
| Static Protected Member Functions inherited from exprDriver | |
| static point | getPositionOfMinimum (const scalarField &vals, const pointField &locs) |
| Return the location of the min value. | |
| static point | getPositionOfMaximum (const scalarField &vals, const pointField &locs) |
| Return the location of the max value. | |
Driver for volume, surface, point field expressions.
Additional Properties
| Property | Description | Required | Default |
|---|---|---|---|
dimensions | Dimensions for the expression result | no |
In addition to the standard mathematical functions, operations and logical and relational operations, the volume expressions support the following driver-specific functions:
Functions
| Function | Description | Number of arguments | |
|---|---|---|---|
vol | The cell volumes | 0 | |
pos | The cell centres | 0 | |
pts | The cell points | 0 | |
area | The face area magnitudes | 0 | |
fpos | The face centres | 0 | |
weightAverage | Volume or area weighted average | 1 | |
weightSum | Volume or area weighted sum | 1 | |
face | The face areaNormal vectors | 0 | |
face | A surface-field face value | 1 | |
point | A point-field point value | 1 | |
cellToFace | Interpolate cell values onto faces | 1 | |
cellToPoint | Interpolate cell values onto points | 1 | |
pointToCell | Interpolate point values onto cells | 1 | |
reconstruct | Reconstruct cell vector from surface scalar | 1 | |
rand | Random field | 0/1 |
Selections
| Function | Description | Number of arguments | |
|---|---|---|---|
cset | Logical vol field corresponding to cellSet | 1 | |
fset | Logical surf field corresponding to faceSet | 1 | |
pset | Logical point field corresponding to pointSet | 1 | |
czone | Logical vol field corresponding to cellZone | 1 | |
fzone | Logical surf field corresponding to faceZone | 1 | |
pzone | Logical point field corresponding to pointZone | 1 |
volumeExpr for scanner (2), parser (4) or dictionary controls as per Foam::expressions::exprDriver.Definition at line 226 of file volumeExprDriver.H.
|
delete |
References parseDriver().
Referenced by operator=(), parseDriver(), parseDriver(), and parseDriver().


|
explicit |
Construct for specified mesh, with dictionary information.
Definition at line 79 of file volumeExprDriver.C.
References exprDriver::dict(), fieldGeoType_, fvExprDriver::fvExprDriver(), genericRagelLemonDriver::genericRagelLemonDriver(), hasDimensions_, isLogical_, mesh(), mesh_, Foam::expressions::NO_DATA, exprDriver::resetDb(), exprDriver::resetTimeReference(), resultDimensions_, and resultType_.

| parseDriver | ( | const fvMesh & | mesh, |
| const parseDriver & | driver, | ||
| const dictionary & | dict ) |
Construct for specified mesh with copy of driver context.
Definition at line 99 of file volumeExprDriver.C.
References exprDriver::dict(), fieldGeoType_, fvExprDriver::fvExprDriver(), genericRagelLemonDriver::genericRagelLemonDriver(), hasDimensions_, isLogical_, mesh(), mesh_, Foam::expressions::NO_DATA, parseDriver(), exprDriver::resetDb(), exprDriver::resetTimeReference(), resultDimensions_, resultType_, and Foam::rhs().

Construct with meshName for the given mesh.
Definition at line 120 of file volumeExprDriver.C.
References mesh(), and parseDriver().

| parseDriver | ( | const dictionary & | dict, |
| const fvMesh & | mesh ) |
Construct with patchName and region specified in dictionary.
Definition at line 132 of file volumeExprDriver.C.
References exprDriver::dict(), fieldGeoType_, fvExprDriver::fvExprDriver(), genericRagelLemonDriver::genericRagelLemonDriver(), isLogical_, mesh(), mesh_, Foam::expressions::NO_DATA, exprDriver::resetDb(), exprDriver::resetTimeReference(), resultDimensions_, and resultType_.

|
virtualdefault |
Destructor.
|
protected |
Deep-copy the internalField as a result.
Uses the isLogical() and isPointData() values to handle additional bookkeeping. For isLogical(), renames the resultType_ from '*Scalar*' to '*Logical*' (eg, volLogicalField)
Definition at line 30 of file volumeExprDriverTemplates.C.
References Foam::FieldOps::assign(), fld(), isLogical_, isPointData(), exprDriver::result(), resultType_, and exprResult::setResult().
Referenced by setResult(), setResult(), and setResult().


|
protected |
Cell selections (as logical).
Definition at line 28 of file volumeExprDriverFields.C.
References topoSetSource::CELLSET_SOURCE, topoSetSource::CELLZONE_SOURCE, Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld(), fvExprDriver::getTopoSetLabels(), mesh(), Foam::name(), GeometricField< scalar, fvPatchField, volMesh >::New(), Foam::nl, and Foam::Zero.
Referenced by field_cellZone().


|
protected |
Face selections (as logical).
Definition at line 69 of file volumeExprDriverFields.C.
References Foam::exit(), topoSetSource::FACESET_SOURCE, topoSetSource::FACEZONE_SOURCE, Foam::FatalError, FatalErrorInFunction, fld(), fvExprDriver::getTopoSetLabels(), mesh, Foam::name(), GeometricField< scalar, fvsPatchField, surfaceMesh >::New(), Foam::nl, exprDriver::result(), WarningInFunction, and Foam::Zero.
Referenced by field_faceSet(), and field_faceZone().


|
protected |
Point selections (as logical).
Definition at line 145 of file volumeExprDriverFields.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld(), fvExprDriver::getTopoSetLabels(), mesh, Foam::name(), GeometricField< scalar, pointPatchField, pointMesh >::New(), MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New(), Foam::nl, topoSetSource::POINTSET_SOURCE, topoSetSource::POINTZONE_SOURCE, and Foam::Zero.
Referenced by field_pointSet(), and field_pointZone().


| ClassName | ( | "volumeExpr::driver" | ) |
|
delete |
References exprDriver::dict(), mesh(), dictionary::null, and parseDriver().

|
inlinevirtual |
The mesh we are attached to.
Implements fvExprDriver.
Definition at line 374 of file volumeExprDriver.H.
References mesh_.
Referenced by field_cellSelection(), operator=(), parseDriver(), parseDriver(), parseDriver(), and parseDriver().

|
inlinevirtual |
The natural field size for the expression.
Implements fvExprDriver.
Definition at line 382 of file volumeExprDriver.H.
References mesh_.
|
inlinevirtual |
The point field size for the expression.
Implements fvExprDriver.
Definition at line 390 of file volumeExprDriver.H.
References mesh_.
|
inline |
Field size associated with different geometric field types.
Definition at line 23 of file volumeExprDriverI.H.
References Foam::expressions::FACE_DATA, mesh_, Foam::expressions::POINT_DATA, and Foam::expressions::VOLUME_DATA.
|
inlinenoexcept |
Apply dimensions() to geometric fields.
Definition at line 46 of file volumeExprDriverI.H.
References hasDimensions_, and Foam::noexcept.
|
inlinenoexcept |
The preferred result dimensions (if any).
Definition at line 54 of file volumeExprDriverI.H.
References Foam::noexcept, and resultDimensions_.
| void clearField | ( | ) |
Clear out local copies of the field.
Definition at line 185 of file volumeExprDriver.C.
References fieldGeoType_, isLogical_, Foam::expressions::NO_DATA, resultField_, and resultType_.
|
virtual |
Read variables, tables etc.
Adds support for "dimensions"
Reimplemented from fvExprDriver.
Definition at line 153 of file volumeExprDriver.C.
References exprDriver::dict(), hasDimensions_, fvExprDriver::readDict(), and resultDimensions_.

|
virtual |
Execute the parser.
The return value currently has no meaning.
Implements exprDriver.
Definition at line 170 of file volumeExprDriver.C.
References exprDriver::debugScanner(), Foam::pos(), and scanner::process().

|
inlinenoexcept |
The result type-name.
Normally volScalarField, surfaceVectorField etc, but Scalar is modified for logical as volScalarField etc
Definition at line 455 of file volumeExprDriver.H.
References Foam::noexcept, resultType(), and resultType_.
Referenced by resultType().


|
inlinenoexcept |
The geometric field association.
Definition at line 463 of file volumeExprDriver.H.
References fieldGeoType_, and Foam::noexcept.
|
inlinenoexcept |
A logical (bool-like) field. Actually stored as a scalar.
Definition at line 471 of file volumeExprDriver.H.
References isLogical_, and Foam::noexcept.
|
inlinenoexcept |
A volume field.
Definition at line 479 of file volumeExprDriver.H.
References fieldGeoType_, Foam::noexcept, and Foam::expressions::VOLUME_DATA.
|
inlinenoexcept |
A surface field.
Definition at line 487 of file volumeExprDriver.H.
References Foam::expressions::FACE_DATA, fieldGeoType_, and Foam::noexcept.
|
inlinenoexcept |
A point field.
Definition at line 495 of file volumeExprDriver.H.
References fieldGeoType_, Foam::noexcept, and Foam::expressions::POINT_DATA.
Referenced by setInternalFieldResult().

| const GeoField * isResultType | ( | ) | const |
Test if stored result pointer is the specified type.
| const GeoField * isResultType | ( | bool | logical, |
| bool | dieOnNull = false ) const |
Test if stored result pointer is the specified type and matches the specified logical type.
| Foam::autoPtr< Foam::regIOobject > dupZeroField | ( | ) | const |
A zero-initialized field with the same type as the result field.
Definition at line 197 of file volumeExprDriver.C.
References doLocalCode, Foam::expressions::FACE_DATA, fieldGeoType_, Foam::expressions::POINT_DATA, resultField_, and Foam::expressions::VOLUME_DATA.
| void setResult | ( | VolumeField< Type > * | ptr, |
| bool | logical = false ) |
Set result (vol field).
Definition at line 56 of file volumeExprDriverTemplates.C.
References DimensionedField< Type, GeoMesh >::dimensions(), fieldGeoType_, hasDimensions_, isLogical_, GeometricField< Type, PatchField, GeoMesh >::primitiveField(), dimensionSet::reset(), resultDimensions_, resultField_, resultType_, setInternalFieldResult(), FieldBase::typeName, and Foam::expressions::VOLUME_DATA.

| void setResult | ( | SurfaceField< Type > * | ptr, |
| bool | logical = false ) |
Set result (surface field).
Definition at line 83 of file volumeExprDriverTemplates.C.
References DimensionedField< Type, GeoMesh >::dimensions(), Foam::expressions::FACE_DATA, fieldGeoType_, hasDimensions_, isLogical_, GeometricField< Type, PatchField, GeoMesh >::primitiveField(), dimensionSet::reset(), resultDimensions_, resultField_, resultType_, setInternalFieldResult(), and FieldBase::typeName.

| void setResult | ( | PointField< Type > * | ptr, |
| bool | logical = false ) |
Set result (point field).
Definition at line 110 of file volumeExprDriverTemplates.C.
References DimensionedField< Type, GeoMesh >::dimensions(), fieldGeoType_, hasDimensions_, isLogical_, Foam::expressions::POINT_DATA, GeometricField< Type, PatchField, GeoMesh >::primitiveField(), dimensionSet::reset(), resultDimensions_, resultField_, resultType_, setInternalFieldResult(), and FieldBase::typeName.

| tmp< VolumeField< Type > > newVolField | ( | const Type & | val = pTraits< Type >::zero | ) | const |
Return a new volume field with the mesh size.
Referenced by pointToCell().

| tmp< SurfaceField< Type > > newSurfaceField | ( | const Type & | val = pTraits< Type >::zero | ) | const |
Return a new surface field with the mesh nInternalFaces size.
| tmp< PointField< Type > > newPointField | ( | const Type & | val = pTraits< Type >::zero | ) | const |
Return a new point field with the mesh nPoints size.
| tmp< VolumeField< Type > > getVolField | ( | const word & | fldName, |
| bool | getOldTime = false ) |
Retrieve field (vol field).
| tmp< SurfaceField< Type > > getSurfaceField | ( | const word & | fldName, |
| bool | getOldTime = false ) |
Retrieve field (surface field).
| tmp< PointField< Type > > getPointField | ( | const word & | fldName, |
| bool | getOldTime = false ) |
Retrieve field (surface field).
| tmp< SurfaceField< Type > > cellToFace | ( | const VolumeField< Type > & | field | ) | const |
| tmp< PointField< Type > > cellToPoint | ( | const VolumeField< Type > & | field | ) | const |
| tmp< VolumeField< Type > > pointToCell | ( | const PointField< Type > & | field | ) | const |
|
inline |
The volume-weighted average of a field.
Definition at line 616 of file volumeExprDriver.H.
References fld(), and Foam::gWeightedAverage().

|
inline |
The volume-weighted sum of a field.
Definition at line 625 of file volumeExprDriver.H.
References fld(), and Foam::gWeightedSum().

|
inline |
The area-weighted average of a field.
Definition at line 634 of file volumeExprDriver.H.
References fld(), and Foam::gWeightedAverage().

|
inline |
The area-weighted sum of a field.
Definition at line 647 of file volumeExprDriver.H.
References fld(), and Foam::gWeightedSum().

| Foam::tmp< Foam::volScalarField > field_cellVolume | ( | ) | const |
The cell volumes - (swak = vol).
Definition at line 187 of file volumeExprDriverFields.C.
References Foam::dimVol, mesh, and GeometricField< scalar, fvPatchField, volMesh >::New().

| Foam::tmp< Foam::volVectorField > field_cellCentre | ( | ) | const |
The cell centres - (swak = pos).
Definition at line 200 of file volumeExprDriverFields.C.
References C, mesh, and tmp< T >::New().

| Foam::tmp< Foam::surfaceScalarField > field_faceArea | ( | ) | const |
The face area magnitudes [magSf] - (swak = area).
Definition at line 207 of file volumeExprDriverFields.C.
References Foam::dimless, mesh, and GeometricField< scalar, fvsPatchField, surfaceMesh >::New().

| Foam::tmp< Foam::surfaceVectorField > field_faceCentre | ( | ) | const |
The face centres - (swak = fpos).
Definition at line 220 of file volumeExprDriverFields.C.
References Foam::dimless, mesh, and GeometricField< vector, fvsPatchField, surfaceMesh >::New().

| Foam::tmp< Foam::surfaceVectorField > field_areaNormal | ( | ) | const |
The face areas with their vector direction [Sf] - (swak = face).
Definition at line 233 of file volumeExprDriverFields.C.
References Foam::dimless, mesh, and GeometricField< vector, fvsPatchField, surfaceMesh >::New().

| Foam::tmp< Foam::pointVectorField > field_pointField | ( | ) | const |
The mesh point locations - (swak = pts).
Definition at line 246 of file volumeExprDriverFields.C.
References Foam::dimless, mesh, GeometricField< vector, pointPatchField, pointMesh >::New(), MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New(), and points.

|
inline |
|
inline |
Cell selection (zone).
Definition at line 75 of file volumeExprDriverI.H.
References topoSetSource::CELLZONE_SOURCE, field_cellSelection(), and Foam::name().

|
inline |
Face selection (set).
Definition at line 89 of file volumeExprDriverI.H.
References topoSetSource::FACESET_SOURCE, field_faceSelection(), and Foam::name().

|
inline |
Face selection (zone).
Definition at line 103 of file volumeExprDriverI.H.
References topoSetSource::FACEZONE_SOURCE, field_faceSelection(), and Foam::name().

|
inline |
Point selection (set).
Definition at line 117 of file volumeExprDriverI.H.
References field_pointSelection(), Foam::name(), and topoSetSource::POINTSET_SOURCE.

|
inline |
Point selection (zone).
Definition at line 131 of file volumeExprDriverI.H.
References field_pointSelection(), Foam::name(), and topoSetSource::POINTZONE_SOURCE.

| Foam::tmp< Foam::volScalarField > field_rand | ( | label | seed = 0, |
| bool | gaussian = false ) const |
A uniform random field.
Definition at line 259 of file volumeExprDriverFields.C.
References Foam::dimless, exprDriver::fill_random(), mesh, and GeometricField< scalar, fvPatchField, volMesh >::New().
Referenced by field_randGaussian().


|
inline |
A Gaussian random field.
Definition at line 726 of file volumeExprDriver.H.
References field_rand().

| const GeomField * isResultType | ( | ) | const |
Definition at line 138 of file volumeExprDriverTemplates.C.
References resultField_.
| const GeomField * isResultType | ( | bool | logical, |
| bool | dieOnNull ) const |
Definition at line 146 of file volumeExprDriverTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, isLogical_, Foam::nl, and resultField_.

| Foam::tmp< Foam::VolumeField< Type > > newVolField | ( | const Type & | val | ) | const |
Definition at line 224 of file volumeExprDriverTemplates.C.
References Foam::dimless, mesh, and GeometricField< Type, fvPatchField, volMesh >::New().

| Foam::tmp< Foam::SurfaceField< Type > > newSurfaceField | ( | const Type & | val | ) | const |
Definition at line 240 of file volumeExprDriverTemplates.C.
References Foam::dimless, mesh, and GeometricField< Type, fvsPatchField, surfaceMesh >::New().

| Foam::tmp< Foam::PointField< Type > > newPointField | ( | const Type & | val | ) | const |
Definition at line 256 of file volumeExprDriverTemplates.C.
References Foam::dimless, mesh, GeometricField< Type, pointPatchField, pointMesh >::New(), and MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New().

| Foam::tmp< Foam::SurfaceField< Type > > cellToFace | ( | const VolumeField< Type > & | field | ) | const |
Definition at line 272 of file volumeExprDriverTemplates.C.
References field(), and Foam::fvc::interpolate().

| Foam::tmp< Foam::PointField< Type > > cellToPoint | ( | const VolumeField< Type > & | field | ) | const |
Definition at line 283 of file volumeExprDriverTemplates.C.
References field(), volPointInterpolation::interpolate(), and mesh.

| Foam::tmp< Foam::VolumeField< Type > > pointToCell | ( | const PointField< Type > & | field | ) | const |
Definition at line 295 of file volumeExprDriverTemplates.C.
References field(), forAll, Foam::interpolatePointToCell(), newVolField(), and exprDriver::result().

|
protected |
The referenced mesh.
Definition at line 238 of file volumeExprDriver.H.
Referenced by mesh(), parseDriver(), parseDriver(), parseDriver(), pointSize(), size(), and size().
|
protected |
The results (volume, surface, point).
Definition at line 243 of file volumeExprDriver.H.
Referenced by clearField(), dupZeroField(), isResultType(), isResultType(), setResult(), setResult(), and setResult().
|
protected |
The result type-name.
Normally volScalarField, surfaceVectorField etc, but Scalar is modified for logical as volScalarField etc
Definition at line 251 of file volumeExprDriver.H.
Referenced by clearField(), parseDriver(), parseDriver(), parseDriver(), resultType(), setInternalFieldResult(), setResult(), setResult(), and setResult().
|
protected |
A logical (bool-like) field (but actually a scalar).
Definition at line 256 of file volumeExprDriver.H.
Referenced by clearField(), isLogical(), isResultType(), parseDriver(), parseDriver(), parseDriver(), setInternalFieldResult(), setResult(), setResult(), and setResult().
|
protected |
Requested use of dimensions.
Definition at line 261 of file volumeExprDriver.H.
Referenced by hasDimensions(), parseDriver(), parseDriver(), readDict(), setResult(), setResult(), and setResult().
|
protected |
A volume/surface/point field.
Definition at line 266 of file volumeExprDriver.H.
Referenced by clearField(), dupZeroField(), fieldAssociation(), isFaceData(), isPointData(), isVolumeData(), parseDriver(), parseDriver(), parseDriver(), setResult(), setResult(), and setResult().
|
protected |
The result dimensions.
Definition at line 271 of file volumeExprDriver.H.
Referenced by dimensions(), parseDriver(), parseDriver(), parseDriver(), readDict(), setResult(), setResult(), and setResult().