Driver for volume, surface, point field expressions. More...
Public Member Functions | |
| ClassName ("volumeExpr::driver") | |
| parseDriver (const fvMesh &mesh, bool cacheReadFields=false) | |
| Construct for specified mesh. More... | |
| parseDriver (const fvMesh &mesh, const dictionary &dict) | |
| Construct for specified mesh with given dictionary. More... | |
| parseDriver (const fvMesh &mesh, const parseDriver &driver) | |
| Construct for specified mesh with copy of driver context. More... | |
| parseDriver (const word &meshName, const fvMesh &mesh) | |
| Construct with meshName for the given mesh. More... | |
| parseDriver (const dictionary &dict, const fvMesh &mesh) | |
| Construct with patchName and region specified in dictionary. More... | |
| virtual autoPtr< expressions::fvExprDriver > | clone () const |
| Clone. More... | |
| virtual | ~parseDriver ()=default |
| Destructor. More... | |
| virtual const fvMesh & | mesh () const |
| The mesh we are attached to. More... | |
| virtual label | size () const |
| The underlying field size for the expression. More... | |
| virtual label | pointSize () const |
| The underlying point field size for the expression. More... | |
| label | size (const FieldAssociation geoType) const |
| Field size associated with different geometric field types. More... | |
| virtual bool | readDict (const dictionary &dict) |
| Read variables, tables etc. More... | |
| virtual unsigned | parse (const std::string &expr, size_t pos=0, size_t len=std::string::npos) |
| Execute the parser. More... | |
| const word & | resultType () const |
| The result type-name. More... | |
| FieldAssociation | fieldAssociation () const |
| The geometric field association. More... | |
| bool | isLogical () const |
| A logical (bool-like) field. Actually stored as a scalar. More... | |
| bool | isVolumeData () const |
| A volume field. More... | |
| bool | isSurfaceData () const |
| A surface field. More... | |
| bool | isPointData () const |
| A point field. More... | |
| template<class GeoField > | |
| const GeoField * | isResultType () const |
| Test if stored result pointer is the specified type. More... | |
| template<class GeoField > | |
| const GeoField * | isResultType (bool logical, bool dieOnNull=false) const |
| template<class Type > | |
| void | setResult (GeometricField< Type, fvPatchField, volMesh > *ptr, bool logical=false) |
| Set result (vol field) More... | |
| template<class Type > | |
| void | setResult (GeometricField< Type, fvsPatchField, surfaceMesh > *ptr, bool logical=false) |
| Set result (surface field) More... | |
| template<class Type > | |
| void | setResult (GeometricField< Type, pointPatchField, pointMesh > *ptr, bool logical=false) |
| Set result (point field) More... | |
| template<class Type > | |
| tmp< GeometricField< Type, fvPatchField, volMesh > > | newVolField (const Type &val=pTraits< Type >::zero) const |
| Return a new volume field with the mesh size. More... | |
| template<class Type > | |
| tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > | newSurfaceField (const Type &val=pTraits< Type >::zero) const |
| Return a new surface field with the mesh nInternalFaces size. More... | |
| template<class Type > | |
| tmp< GeometricField< Type, pointPatchField, pointMesh > > | newPointField (const Type &val=pTraits< Type >::zero) const |
| Return a new point field with the mesh nPoints size. More... | |
| template<class Type > | |
| tmp< GeometricField< Type, fvPatchField, volMesh > > | getVolField (const word &fldName, bool getOldTime=false) |
| Retrieve field (vol field) More... | |
| template<class Type > | |
| tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > | getSurfaceField (const word &fldName, bool getOldTime=false) |
| Retrieve field (surface field) More... | |
| template<class Type > | |
| tmp< GeometricField< Type, pointPatchField, pointMesh > > | getPointField (const word &fldName, bool getOldTime=false) |
| Retrieve field (surface field) More... | |
| template<class Type > | |
| tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > | cellToFace (const GeometricField< Type, fvPatchField, volMesh > &field) const |
| Interpolate cell to face values. More... | |
| template<class Type > | |
| tmp< GeometricField< Type, pointPatchField, pointMesh > > | cellToPoint (const GeometricField< Type, fvPatchField, volMesh > &field) const |
| Interpolate cell to point values. More... | |
| template<class Type > | |
| tmp< GeometricField< Type, fvPatchField, volMesh > > | pointToCell (const GeometricField< Type, pointPatchField, pointMesh > &field) const |
| Interpolate point to cell values. More... | |
| template<class Type > | |
| Type | volAverage (GeometricField< Type, fvPatchField, volMesh > &fld) const |
| The volume-weighted average of a field. More... | |
| template<class Type > | |
| Type | volSum (GeometricField< Type, fvPatchField, volMesh > &fld) const |
| The volume-weighted sum of a field. More... | |
| template<class Type > | |
| Type | areaAverage (GeometricField< Type, fvsPatchField, surfaceMesh > &fld) const |
| The area-weighted average of a field. More... | |
| template<class Type > | |
| Type | areaSum (GeometricField< Type, fvsPatchField, surfaceMesh > &fld) const |
| The area-weighted sum of a field. More... | |
| tmp< volScalarField > | field_cellVolume () const |
| The cell volumes - (swak = vol) More... | |
| tmp< volVectorField > | field_cellCentre () const |
| The cell centres - (swak = pos) More... | |
| tmp< surfaceScalarField > | field_faceArea () const |
| The face area magnitudes [magSf] - (swak = area) More... | |
| tmp< surfaceVectorField > | field_faceCentre () const |
| The face centres - (swak = fpos) More... | |
| tmp< surfaceVectorField > | field_areaNormal () const |
| The face areas with their vector direction [Sf] - (swak = face) More... | |
| tmp< pointVectorField > | field_pointField () const |
| The mesh point locations - (swak = pts) More... | |
| tmp< volScalarField > | field_cellSet (const word &name) const |
| Cell selection (set) More... | |
| tmp< volScalarField > | field_cellZone (const word &name) const |
| Cell selection (zone) More... | |
| tmp< surfaceScalarField > | field_faceSet (const word &name) const |
| Face selection (set) More... | |
| tmp< surfaceScalarField > | field_faceZone (const word &name) const |
| Face selection (zone) More... | |
| tmp< pointScalarField > | field_pointSet (const word &name) const |
| Point selection (set) More... | |
| tmp< pointScalarField > | field_pointZone (const word &name) const |
| Point selection (zone) More... | |
| tmp< volScalarField > | field_rand (label seed=0, bool gaussian=false) const |
| A uniform random field. More... | |
| tmp< volScalarField > | field_randGaussian (label seed=0) const |
| A Gaussian random field. More... | |
| template<class GeomField > | |
| const GeomField * | isResultType () const |
| template<class GeomField > | |
| const GeomField * | isResultType (bool logical, bool dieOnNull) const |
| template<class Type > | |
| Foam::tmp< Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > > | newVolField (const Type &val) const |
| template<class Type > | |
| Foam::tmp< Foam::GeometricField< Type, Foam::fvsPatchField, Foam::surfaceMesh > > | newSurfaceField (const Type &val) const |
| template<class Type > | |
| Foam::tmp< Foam::GeometricField< Type, Foam::pointPatchField, Foam::pointMesh > > | newPointField (const Type &val) const |
| template<class Type > | |
| Foam::tmp< Foam::GeometricField< Type, Foam::fvsPatchField, Foam::surfaceMesh > > | cellToFace (const GeometricField< Type, fvPatchField, volMesh > &field) const |
| template<class Type > | |
| Foam::tmp< Foam::GeometricField< Type, Foam::pointPatchField, Foam::pointMesh > > | cellToPoint (const GeometricField< Type, fvPatchField, volMesh > &field) const |
| template<class Type > | |
| Foam::tmp< Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > > | pointToCell (const GeometricField< Type, pointPatchField, pointMesh > &field) 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... | |
| Ostream & | printBuffer (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 (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 | ~fvExprDriver () |
| Destructor. More... | |
| const Time & | runTime () 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 exprResult & | variable (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... | |
| Ostream & | writeCommon (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< T > | getTopoSet (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 dictionary & | dict () const |
| The dictionary with all input data/specification. More... | |
| virtual const exprResult & | result () const |
| Const access to expression result. More... | |
| virtual exprResult & | result () |
| 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... | |
| 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... | |
| Ostream & | writeVariableStrings (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 |
Protected Member Functions | |
| template<class Type > | |
| void | setInternalFieldResult (const Field< Type > &fld) |
| Deep-copy the internalField as a result. More... | |
| tmp< volScalarField > | field_cellSelection (const word &name, enum topoSetSource::sourceType setType) const |
| Cell selections (as logical) More... | |
| tmp< surfaceScalarField > | field_faceSelection (const word &name, enum topoSetSource::sourceType setType) const |
| Face selections (as logical) More... | |
| tmp< pointScalarField > | field_pointSelection (const word &name, enum topoSetSource::sourceType setType) const |
| Point selections (as logical) More... | |
| parseDriver (const parseDriver &)=delete | |
| void | operator= (const parseDriver &)=delete |
Protected Member Functions inherited from fvExprDriver | |
| void | setGlobalScopes (const wordUList &scopes) |
| Define scopes for global variables. More... | |
| virtual exprResult & | variable (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 exprResult & | lookupGlobal (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< T > | getTopoSet (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... | |
Protected Attributes | |
| const fvMesh & | mesh_ |
| The referenced mesh. More... | |
| autoPtr< regIOobject > | resultField_ |
| The results (volume, surface, point) More... | |
| word | resultType_ |
| The result type-name. More... | |
| bool | isLogical_ |
| A logical (bool-like) field (but actually a scalar) More... | |
| enum FieldAssociation | fieldGeoType_ |
| A volume/surface/point field. More... | |
| dimensionSet | resultDimension_ |
| The result dimensions. 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 dictionary & | dict_ |
| The dictionary with all input data/specification. More... | |
| exprResult | result_ |
| The result. More... | |
| List< expressions::exprString > | variableStrings_ |
| Variable definitions, as read from a dictionary. More... | |
| HashTable< exprResult > | variables_ |
| 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... | |
Additional Inherited Members | |
Public Types inherited from genericRagelLemonDriver | |
| typedef size_t | location_type |
| Type for linear addressing within parse content. More... | |
Static Public Member Functions inherited from fvExprDriver | |
| static const fvMesh & | defaultMesh () |
| Get the default mesh, if one is defined. More... | |
| static const fvMesh * | resetDefaultMesh (const fvMesh &mesh, const bool force=false) |
| Set the default mesh (if not already set) More... | |
| static autoPtr< fvExprDriver > | New (const dictionary &dict, const fvMesh &mesh) |
| Return a reference to the selected value driver. More... | |
| static autoPtr< fvExprDriver > | New (const dictionary &dict) |
| Return a reference to the selected value driver. More... | |
| static autoPtr< fvExprDriver > | New (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::exprString > | readVariableStrings (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 fvMesh & | regionMesh (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... | |
Driver for volume, surface, point field expressions.
| 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 229 of file volumeExprDriver.H.
|
protecteddelete |
|
explicit |
Construct for specified mesh.
Definition at line 87 of file volumeExprDriver.C.
| parseDriver | ( | const fvMesh & | mesh, |
| const dictionary & | dict | ||
| ) |
Construct for specified mesh with given dictionary.
Definition at line 103 of file volumeExprDriver.C.
| parseDriver | ( | const fvMesh & | mesh, |
| const parseDriver & | driver | ||
| ) |
Construct for specified mesh with copy of driver context.
Definition at line 119 of file volumeExprDriver.C.
| parseDriver | ( | const word & | meshName, |
| const fvMesh & | mesh | ||
| ) |
Construct with meshName for the given mesh.
Definition at line 135 of file volumeExprDriver.C.
| parseDriver | ( | const dictionary & | dict, |
| const fvMesh & | mesh | ||
| ) |
Construct with patchName and region specified in dictionary.
Definition at line 147 of file volumeExprDriver.C.
|
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 38 of file volumeExprDriverTemplates.C.
References Foam::FieldOps::assign(), Foam::HashSetOps::bools(), and fld.
|
protected |
Cell selections (as logical)
Definition at line 36 of file volumeExprDriverFields.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld, mesh, Foam::name(), Foam::New(), Foam::nl, and Foam::Zero.
|
protected |
Face selections (as logical)
Definition at line 76 of file volumeExprDriverFields.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld, mesh, Foam::name(), Foam::New(), Foam::nl, WarningInFunction, and Foam::Zero.
|
protected |
Point selections (as logical)
Definition at line 151 of file volumeExprDriverFields.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld, mesh, Foam::name(), Foam::New(), Foam::nl, and Foam::Zero.
|
protecteddelete |
| ClassName | ( | "volumeExpr::driver" | ) |
|
inlinevirtual |
Clone.
Implements fvExprDriver.
Definition at line 324 of file volumeExprDriver.H.
References parseDriver::parseDriver().
|
inlinevirtual |
The mesh we are attached to.
Implements fvExprDriver.
Definition at line 340 of file volumeExprDriver.H.
References parseDriver::mesh_.
Referenced by parseDriver::field_cellVolume().
|
inlinevirtual |
The underlying field size for the expression.
Implements fvExprDriver.
Definition at line 346 of file volumeExprDriver.H.
References parseDriver::mesh_, and primitiveMesh::nCells().
|
inlinevirtual |
The underlying point field size for the expression.
Implements fvExprDriver.
Definition at line 352 of file volumeExprDriver.H.
References parseDriver::mesh_, and primitiveMesh::nPoints().
|
inline |
Field size associated with different geometric field types.
Definition at line 31 of file volumeExprDriverI.H.
References Foam::expressions::patchExpr::POINT_DATA, Foam::expressions::patchExpr::SURFACE_DATA, and Foam::expressions::volumeExpr::VOLUME_DATA.
|
virtual |
Read variables, tables etc.
Adds support for "dimensions"
Reimplemented from fvExprDriver.
Definition at line 165 of file volumeExprDriver.C.
References dict.
|
virtual |
Execute the parser.
The return value currently has no meaning.
Implements exprDriver.
Definition at line 179 of file volumeExprDriver.C.
References Foam::pos(), and scanner::process().
|
inline |
The result type-name.
Normally volScalarField, surfaceVectorField etc, but Scalar is modified for logical as volScalarField etc
Definition at line 388 of file volumeExprDriver.H.
|
inline |
The geometric field association.
Definition at line 394 of file volumeExprDriver.H.
References parseDriver::fieldGeoType_.
|
inline |
A logical (bool-like) field. Actually stored as a scalar.
Definition at line 400 of file volumeExprDriver.H.
References parseDriver::isLogical_.
|
inline |
A volume field.
Definition at line 406 of file volumeExprDriver.H.
References parseDriver::fieldGeoType_, and Foam::expressions::volumeExpr::VOLUME_DATA.
|
inline |
A surface field.
Definition at line 412 of file volumeExprDriver.H.
References parseDriver::fieldGeoType_, and Foam::expressions::patchExpr::SURFACE_DATA.
|
inline |
A point field.
Definition at line 418 of file volumeExprDriver.H.
References parseDriver::fieldGeoType_, and Foam::expressions::patchExpr::POINT_DATA.
| const GeoField* isResultType | ( | ) | const |
Test if stored result pointer is the specified type.
Test if stored result pointer is the specified type and matches the specified logical type
| void setResult | ( | GeometricField< Type, fvPatchField, volMesh > * | ptr, |
| bool | logical = false |
||
| ) |
Set result (vol field)
Definition at line 64 of file volumeExprDriverTemplates.C.
References GeometricField< Type, PatchField, GeoMesh >::primitiveField(), and Foam::expressions::volumeExpr::VOLUME_DATA.
| void setResult | ( | GeometricField< Type, fvsPatchField, surfaceMesh > * | ptr, |
| bool | logical = false |
||
| ) |
Set result (surface field)
Definition at line 93 of file volumeExprDriverTemplates.C.
References GeometricField< Type, PatchField, GeoMesh >::primitiveField(), and Foam::expressions::patchExpr::SURFACE_DATA.
| void setResult | ( | GeometricField< Type, pointPatchField, pointMesh > * | ptr, |
| bool | logical = false |
||
| ) |
Set result (point field)
Definition at line 122 of file volumeExprDriverTemplates.C.
References Foam::expressions::patchExpr::POINT_DATA, and GeometricField< Type, PatchField, GeoMesh >::primitiveField().
| tmp<GeometricField<Type, fvPatchField, volMesh> > newVolField | ( | const Type & | val = pTraits< Type >::zero | ) | const |
Return a new volume field with the mesh size.
| tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > newSurfaceField | ( | const Type & | val = pTraits< Type >::zero | ) | const |
Return a new surface field with the mesh nInternalFaces size.
| tmp<GeometricField<Type, pointPatchField, pointMesh> > newPointField | ( | const Type & | val = pTraits< Type >::zero | ) | const |
Return a new point field with the mesh nPoints size.
| tmp<GeometricField<Type, fvPatchField, volMesh> > getVolField | ( | const word & | fldName, |
| bool | getOldTime = false |
||
| ) |
Retrieve field (vol field)
| tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > getSurfaceField | ( | const word & | fldName, |
| bool | getOldTime = false |
||
| ) |
Retrieve field (surface field)
| tmp<GeometricField<Type, pointPatchField, pointMesh> > getPointField | ( | const word & | fldName, |
| bool | getOldTime = false |
||
| ) |
Retrieve field (surface field)
| tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > cellToFace | ( | const GeometricField< Type, fvPatchField, volMesh > & | field | ) | const |
Interpolate cell to face values.
| tmp<GeometricField<Type, pointPatchField, pointMesh> > cellToPoint | ( | const GeometricField< Type, fvPatchField, volMesh > & | field | ) | const |
Interpolate cell to point values.
| tmp<GeometricField<Type, fvPatchField, volMesh> > pointToCell | ( | const GeometricField< Type, pointPatchField, pointMesh > & | field | ) | const |
Interpolate point to cell values.
|
inline |
The volume-weighted average of a field.
Definition at line 526 of file volumeExprDriver.H.
References fld, and exprDriver::weightedAverage().
|
inline |
The volume-weighted sum of a field.
Definition at line 536 of file volumeExprDriver.H.
References fld, and exprDriver::weightedSum().
|
inline |
The area-weighted average of a field.
Definition at line 546 of file volumeExprDriver.H.
References fld, and exprDriver::weightedAverage().
|
inline |
The area-weighted sum of a field.
Definition at line 560 of file volumeExprDriver.H.
References fld, and exprDriver::weightedSum().
| Foam::tmp< Foam::volScalarField > field_cellVolume | ( | ) | const |
The cell volumes - (swak = vol)
Definition at line 191 of file volumeExprDriverFields.C.
References Foam::dimVol, parseDriver::mesh(), and GeometricField< scalar, fvPatchField, volMesh >::New().
| Foam::tmp< Foam::volVectorField > field_cellCentre | ( | ) | const |
The cell centres - (swak = pos)
Definition at line 204 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 211 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 224 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 237 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 250 of file volumeExprDriverFields.C.
References Foam::dimless, mesh, MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New(), GeometricField< vector, pointPatchField, pointMesh >::New(), and points.
|
inline |
Cell selection (set)
|
inline |
Cell selection (zone)
Definition at line 69 of file volumeExprDriverI.H.
References Foam::name().
|
inline |
Face selection (set)
Definition at line 83 of file volumeExprDriverI.H.
References Foam::name().
|
inline |
Face selection (zone)
Definition at line 97 of file volumeExprDriverI.H.
References Foam::name().
|
inline |
Point selection (set)
Definition at line 111 of file volumeExprDriverI.H.
References Foam::name().
|
inline |
Point selection (zone)
Definition at line 125 of file volumeExprDriverI.H.
References Foam::name().
| Foam::tmp< Foam::volScalarField > field_rand | ( | label | seed = 0, |
| bool | gaussian = false |
||
| ) | const |
A uniform random field.
Definition at line 264 of file volumeExprDriverFields.C.
References Foam::dimless, fld, mesh, and GeometricField< scalar, fvPatchField, volMesh >::New().
Referenced by parseDriver::field_randGaussian().
|
inline |
A Gaussian random field.
Definition at line 613 of file volumeExprDriver.H.
References parseDriver::field_rand().
| const GeomField* isResultType | ( | ) | const |
Definition at line 151 of file volumeExprDriverTemplates.C.
References parseDriver::resultField_.
Definition at line 160 of file volumeExprDriverTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
| Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > newVolField | ( | const Type & | val | ) | const |
Definition at line 244 of file volumeExprDriverTemplates.C.
References Foam::dimless, mesh, and GeometricField< Type, PatchField, GeoMesh >::New().
| Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > newSurfaceField | ( | const Type & | val | ) | const |
Definition at line 260 of file volumeExprDriverTemplates.C.
References Foam::dimless, mesh, and GeometricField< Type, PatchField, GeoMesh >::New().
| Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> > newPointField | ( | const Type & | val | ) | const |
Definition at line 276 of file volumeExprDriverTemplates.C.
References Foam::dimless, mesh, MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New(), and GeometricField< Type, PatchField, GeoMesh >::New().
| Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > cellToFace | ( | const GeometricField< Type, fvPatchField, volMesh > & | field | ) | const |
Definition at line 292 of file volumeExprDriverTemplates.C.
References field(), and Foam::fvc::interpolate().
| Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> > cellToPoint | ( | const GeometricField< Type, fvPatchField, volMesh > & | field | ) | const |
Definition at line 303 of file volumeExprDriverTemplates.C.
References field(), volPointInterpolation::interpolate(), and mesh.
| Foam::tmp<Foam::GeometricField<Type,Foam::fvPatchField,Foam::volMesh> > pointToCell | ( | const GeometricField< Type, pointPatchField, pointMesh > & | field | ) | const |
Definition at line 315 of file volumeExprDriverTemplates.C.
References field(), forAll, and Foam::interpolatePointToCell().
|
protected |
The referenced mesh.
Definition at line 239 of file volumeExprDriver.H.
Referenced by parseDriver::mesh(), parseDriver::pointSize(), and parseDriver::size().
|
protected |
The results (volume, surface, point)
Definition at line 242 of file volumeExprDriver.H.
Referenced by parseDriver::isResultType().
|
protected |
The result type-name.
Normally volScalarField, surfaceVectorField etc, but Scalar is modified for logical as volScalarField etc
Definition at line 247 of file volumeExprDriver.H.
|
protected |
A logical (bool-like) field (but actually a scalar)
Definition at line 250 of file volumeExprDriver.H.
Referenced by parseDriver::isLogical().
|
protected |
A volume/surface/point field.
Definition at line 253 of file volumeExprDriver.H.
Referenced by parseDriver::fieldAssociation(), parseDriver::isPointData(), parseDriver::isSurfaceData(), and parseDriver::isVolumeData().
|
protected |
The result dimensions.
Definition at line 256 of file volumeExprDriver.H.