Driver for patch expressions. More...
#include <patchExprDriver.H>


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. | |
| parseDriver (const fvPatch &p, const parseDriver &driver, const dictionary &dict) | |
| Construct for specified patch with copy of driver context. | |
| parseDriver (const word &patchName, const fvMesh &mesh) | |
| Construct with patchName for the given mesh. | |
| parseDriver (const dictionary &dict, const fvMesh &mesh) | |
| Construct with "patch" (mandatory) and "region" (optional) 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. | |
| virtual unsigned | parse (const std::string &expr, size_t pos=0, size_t len=std::string::npos) |
| Execute the parser. | |
| template<class Type> | |
| void | setResult (Field< Type > *ptr, bool pointVal=false) |
| Set result. | |
| template<class Type> | |
| tmp< Field< Type > > | getVariableIfAvailable (const word &fldName) const |
| Retrieve variable as field if possible. | |
| template<class Type> | |
| tmp< Field< Type > > | getField (const word &fldName) |
| Return named field. | |
| template<class Type> | |
| tmp< Field< Type > > | getVolField (const word &fldName) |
| Retrieve field (vol field). | |
| template<class Type> | |
| tmp< Field< Type > > | getSurfaceField (const word &fldName) |
| Retrieve field (surface field). | |
| template<class Type> | |
| tmp< Field< Type > > | getPointField (const word &fldName) |
| Retrieve field (point field). | |
| template<class Type> | |
| tmp< Field< Type > > | patchInternalField (const word &fldName) |
| Return internal field next to patch. | |
| template<class Type> | |
| tmp< Field< Type > > | patchNeighbourField (const word &fldName) |
| Return patchField on the opposite patch of a coupled patch. | |
| template<class Type> | |
| tmp< Field< Type > > | patchNormalField (const word &fldName) |
| Return surface normal field (snGrad). | |
| template<class Type> | |
| tmp< Field< Type > > | faceToPoint (const Field< Type > &field) const |
| Interpolate face to point. | |
| template<class Type> | |
| tmp< Field< Type > > | pointToFace (const Field< Type > &field) const |
| Interpolate point to face values. | |
| template<class Type> | |
| Type | areaAverage (const Field< Type > &fld) const |
| The area-weighted average of a field. | |
| template<class Type> | |
| Type | areaSum (const Field< Type > &fld) const |
| The area-weighted sum of a field. | |
| tmp< scalarField > | field_faceArea () const |
| The face area magnitudes [magSf] - (swak = area). | |
| tmp< vectorField > | field_faceCentre () const |
| The face centres - (swak = pos). | |
| tmp< vectorField > | field_areaNormal () const |
| The face areas with their vector direction [Sf] - (swak = face). | |
| tmp< vectorField > | field_unitNormal () const |
| The face unit normal direction [nf] - (expression: normal). | |
| tmp< vectorField > | field_pointField () const |
| The patch point locations - (swak = pts). | |
| tmp< boolField > | field_cellSet (const word &name) const |
| Cell selection (set). | |
| tmp< boolField > | field_cellZone (const word &name) const |
| Cell selection (zone). | |
| tmp< boolField > | field_faceSet (const word &name) const |
| Face selection (set). | |
| tmp< boolField > | field_faceZone (const word &name) const |
| Face selection (zone). | |
| tmp< scalarField > | field_rand (label seed=0, bool gaussian=false) const |
| A uniform random field. | |
| tmp< scalarField > | field_randGaussian (label seed=0) const |
| A Gaussian random field. | |
| template<> | |
| tmp< Field< bool > > | getSurfaceField (const word &fldName) |
| Retrieve field (surface field: bool). | |
| template<> | |
| tmp< Field< bool > > | getPointField (const word &fldName) |
| Retrieve field (point field: bool). | |
| 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 > > | getSurfaceField (const word &name) |
| template<class Type> | |
| Foam::tmp< Foam::Field< Type > > | getPointField (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. | |
| 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. | |
| virtual bool | readDict (const dictionary &dict) |
| Read variables, tables etc. | |
| 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 | |
| tmp< boolField > | field_cellSelection (const word &name, enum topoSetSource::sourceType setType) const |
| Cell selections (as logical). | |
| tmp< boolField > | field_faceSelection (const word &name, enum topoSetSource::sourceType setType) const |
| Face 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 fvPatch & | patch_ |
| The referenced patch. | |
| 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 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 area normal vectors | 0 | |
normal | The face unit normal 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 |
patchExpr for scanner (2), parser (4) or dictionary controls as per Foam::expressions::exprDriver.Definition at line 161 of file patchExprDriver.H.
|
delete |
References parseDriver().
Referenced by operator=(), parseDriver(), parseDriver(), parseDriver(), and parseDriver().


|
explicit |
Construct for specified patch, with dictionary information.
Definition at line 95 of file patchExprDriver.C.
References exprDriver::dict(), fvExprDriver::fvExprDriver(), genericRagelLemonDriver::genericRagelLemonDriver(), p, patch_, exprDriver::resetDb(), and exprDriver::resetTimeReference().

| parseDriver | ( | const fvPatch & | p, |
| const parseDriver & | driver, | ||
| const dictionary & | dict ) |
Construct for specified patch with copy of driver context.
Definition at line 110 of file patchExprDriver.C.
References exprDriver::dict(), fvExprDriver::fvExprDriver(), genericRagelLemonDriver::genericRagelLemonDriver(), p, parseDriver(), patch_, exprDriver::resetDb(), exprDriver::resetTimeReference(), and Foam::rhs().

Construct with patchName for the given mesh.
Definition at line 126 of file patchExprDriver.C.
References Foam::lookupFvPatch(), mesh(), and parseDriver().

| parseDriver | ( | const dictionary & | dict, |
| const fvMesh & | mesh ) |
Construct with "patch" (mandatory) and "region" (optional) specified in dictionary.
Definition at line 136 of file patchExprDriver.C.
References exprDriver::dict(), mesh(), and parseDriver().

|
virtualdefault |
Destructor.
|
protected |
Cell selections (as logical).
Definition at line 52 of file patchExprDriverFields.C.
References topoSetSource::CELLSET_SOURCE, topoSetSource::CELLZONE_SOURCE, Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, HashTable< T, Key, Hash >::found(), fvExprDriver::getTopoSetLabels(), Foam::name(), tmp< T >::New(), Foam::nl, patch_, exprDriver::result(), and size().
Referenced by field_cellZone().


|
protected |
Face selections (as logical).
Definition at line 97 of file patchExprDriverFields.C.
References Foam::exit(), topoSetSource::FACESET_SOURCE, topoSetSource::FACEZONE_SOURCE, Foam::FatalError, FatalErrorInFunction, forAll, HashTable< T, Key, Hash >::found(), fvExprDriver::getTopoSetLabels(), Foam::name(), tmp< T >::New(), Foam::nl, patch_, exprDriver::result(), and size().
Referenced by field_faceSet(), and field_faceZone().


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

|
inlinevirtual |
The mesh we are attached to.
Implements fvExprDriver.
Definition at line 266 of file patchExprDriver.H.
References patch_.
Referenced by operator=(), parseDriver(), and parseDriver().

|
inlinevirtual |
The natural field size for the expression.
Implements fvExprDriver.
Definition at line 274 of file patchExprDriver.H.
References patch_.
Referenced by field_cellSelection(), field_faceSelection(), field_rand(), getPointField(), and getVariableIfAvailable().

|
inlinevirtual |
The point field size for the expression.
Implements fvExprDriver.
Definition at line 282 of file patchExprDriver.H.
References patch_.
Referenced by getVariableIfAvailable().

|
inline |
Field size associated with different geometric field types.
Definition at line 23 of file patchExprDriverI.H.
References Foam::expressions::FACE_DATA, patch_, and Foam::expressions::POINT_DATA.
|
virtual |
Execute the parser.
The return value currently has no meaning.
Implements exprDriver.
Definition at line 148 of file patchExprDriver.C.
References exprDriver::debugScanner(), Foam::pos(), and scanner::process().

|
inline |
Set result.
Definition at line 319 of file patchExprDriver.H.
References exprDriver::result(), and exprResult::setResult().

Retrieve variable as field if possible.
Test tmp for validity to determine success of the operation.
Referenced by getField(), patchInternalField(), patchNeighbourField(), and patchNormalField().

Retrieve field (vol field).
Retrieve field (surface field).
Retrieve field (point field).
Return internal field next to patch.
Return patchField on the opposite patch of a coupled patch.
Return surface normal field (snGrad).
|
inline |
The area-weighted average of a field.
Definition at line 400 of file patchExprDriver.H.
References fld(), Foam::gWeightedAverage(), and patch_.

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

| Foam::tmp< Foam::scalarField > field_faceArea | ( | ) | const |
The face area magnitudes [magSf] - (swak = area).
Definition at line 143 of file patchExprDriverFields.C.
References patch_.
| Foam::tmp< Foam::vectorField > field_faceCentre | ( | ) | const |
The face centres - (swak = pos).
Definition at line 150 of file patchExprDriverFields.C.
References patch_.
| Foam::tmp< Foam::vectorField > field_areaNormal | ( | ) | const |
The face areas with their vector direction [Sf] - (swak = face).
Definition at line 157 of file patchExprDriverFields.C.
References patch_.
| Foam::tmp< Foam::vectorField > field_unitNormal | ( | ) | const |
The face unit normal direction [nf] - (expression: normal).
Definition at line 164 of file patchExprDriverFields.C.
References patch_.
| Foam::tmp< Foam::vectorField > field_pointField | ( | ) | const |
The patch point locations - (swak = pts).
Definition at line 171 of file patchExprDriverFields.C.
References patch_.
|
inline |
Cell selection (zone).
Definition at line 58 of file patchExprDriverI.H.
References topoSetSource::CELLZONE_SOURCE, field_cellSelection(), and Foam::name().

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

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

| 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(), tmp< T >::New(), and size().
Referenced by field_randGaussian().


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

Retrieve field (surface field: bool).
Retrieve field (point field: bool).
| Foam::tmp< Foam::Field< bool > > getSurfaceField | ( | const word & | name | ) |
Definition at line 1 of file patchExprDriverFields.C.
| Foam::tmp< Foam::Field< bool > > getPointField | ( | const word & | name | ) |
Definition at line 1 of file patchExprDriverFields.C.
References fvExprDriver::getVariable(), Foam::name(), and size().

| Foam::tmp< Foam::Field< Type > > getVariableIfAvailable | ( | const word & | name | ) | const |
Definition at line 27 of file patchExprDriverTemplates.C.
References refPtr< T >::cref(), Foam::endl(), Foam::gAverage(), fvExprDriver::hasVariable(), fvExprDriver::isGlobalVariable(), Foam::isType(), fvExprDriver::lookupGlobal(), Foam::name(), fvExprDriver::New(), pointSize(), Foam::returnReduceAnd(), size(), UList< T >::size(), refPtr< T >::valid(), fvExprDriver::variable(), and WarningInFunction.

| Foam::tmp< Foam::Field< Type > > getVolField | ( | const word & | name | ) |
Definition at line 77 of file patchExprDriverTemplates.C.
References Foam::getField(), and Foam::name().

| Foam::tmp< Foam::Field< Type > > getSurfaceField | ( | const word & | name | ) |
Definition at line 85 of file patchExprDriverTemplates.C.
References Foam::getField(), and Foam::name().

| Foam::tmp< Foam::Field< Type > > getPointField | ( | const word & | name | ) |
Definition at line 93 of file patchExprDriverTemplates.C.
References Foam::getField(), and Foam::name().

| Foam::tmp< Foam::Field< Type > > getField | ( | const word & | name | ) |
Definition at line 101 of file patchExprDriverTemplates.C.
References exprDriver::cfindContextIOobject(), objectRegistry::cfindIOobject(), tmp< T >::cref(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), found, fvExprDriver::getTypeOfField(), getVariableIfAvailable(), mesh, Foam::name(), MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New(), Foam::New(), Foam::nl, patch_, fvExprDriver::readAndRegister(), exprDriver::searchFiles(), objectRegistry::sortedNames(), objectRegistry::thisDb(), FieldBase::typeName, and tmp< T >::valid().

| Foam::tmp< Foam::Field< Type > > patchInternalField | ( | const word & | name | ) |
Definition at line 219 of file patchExprDriverTemplates.C.
References exprDriver::cfindContextIOobject(), objectRegistry::cfindIOobject(), tmp< T >::cref(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), found, fvExprDriver::getTypeOfField(), getVariableIfAvailable(), mesh, Foam::name(), MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New(), Foam::New(), Foam::nl, patch_, fvExprDriver::readAndRegister(), exprDriver::searchFiles(), objectRegistry::sortedNames(), objectRegistry::thisDb(), FieldBase::typeName, and tmp< T >::valid().

| Foam::tmp< Foam::Field< Type > > patchNeighbourField | ( | const word & | name | ) |
Definition at line 316 of file patchExprDriverTemplates.C.
References exprDriver::cfindContextIOobject(), objectRegistry::cfindIOobject(), tmp< T >::cref(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), found, fvExprDriver::getTypeOfField(), getVariableIfAvailable(), mesh, Foam::name(), Foam::New(), Foam::nl, patch_, fvExprDriver::readAndRegister(), exprDriver::searchFiles(), objectRegistry::sortedNames(), objectRegistry::thisDb(), FieldBase::typeName, and tmp< T >::valid().

| Foam::tmp< Foam::Field< Type > > patchNormalField | ( | const word & | name | ) |
Definition at line 391 of file patchExprDriverTemplates.C.
References exprDriver::cfindContextIOobject(), objectRegistry::cfindIOobject(), tmp< T >::cref(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), found, fvExprDriver::getTypeOfField(), getVariableIfAvailable(), mesh, Foam::name(), Foam::New(), Foam::nl, patch_, fvExprDriver::readAndRegister(), exprDriver::searchFiles(), objectRegistry::sortedNames(), objectRegistry::thisDb(), FieldBase::typeName, and tmp< T >::valid().

| Foam::tmp< Foam::Field< Type > > faceToPoint | ( | const Field< Type > & | field | ) | const |
Definition at line 466 of file patchExprDriverTemplates.C.
References PrimitivePatchInterpolation< Patch >::faceToPointInterpolate(), field(), and patch_.

| Foam::tmp< Foam::Field< Type > > pointToFace | ( | const Field< Type > & | field | ) | const |
Definition at line 479 of file patchExprDriverTemplates.C.
References field(), patch_, and PrimitivePatchInterpolation< Patch >::pointToFaceInterpolate().

| Foam::tmp< Foam::VolumeField< Type > > getVolField | ( | const word & | fldName, |
| bool | getOldTime ) |
Definition at line 173 of file volumeExprDriverTemplates.C.
References fvExprDriver::getOrReadField().

| Foam::tmp< Foam::SurfaceField< Type > > getSurfaceField | ( | const word & | fldName, |
| bool | getOldTime ) |
Definition at line 190 of file volumeExprDriverTemplates.C.
References fvExprDriver::getOrReadField().

| Foam::tmp< Foam::PointField< Type > > getPointField | ( | const word & | fldName, |
| bool | getOldTime ) |
Definition at line 207 of file volumeExprDriverTemplates.C.
References fvExprDriver::getOrReadPointField().

| Foam::tmp< Foam::Field< Type > > getField | ( | const word & | name | ) | const |
Definition at line 25 of file fieldExprDriverTemplates.C.
References refPtr< T >::cref(), Foam::endl(), Foam::gAverage(), exprDriver::hasVariable(), Foam::isType(), Foam::name(), Foam::New(), pointSize(), Foam::returnReduceAnd(), size(), UList< T >::size(), exprDriver::variable(), and WarningInFunction.

|
protected |
The referenced patch.
Definition at line 182 of file patchExprDriver.H.
Referenced by areaAverage(), areaSum(), faceToPoint(), field_areaNormal(), field_cellSelection(), field_faceArea(), field_faceCentre(), field_faceSelection(), field_pointField(), field_unitNormal(), getField(), mesh(), parseDriver(), parseDriver(), patchInternalField(), patchNeighbourField(), patchNormalField(), pointSize(), pointToFace(), size(), and size().