Driver for volume, surface, point field expressions. More...
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. More... | |
parseDriver (const fvMesh &mesh, const parseDriver &driver, const dictionary &dict) | |
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 | ~parseDriver ()=default |
Destructor. More... | |
virtual const fvMesh & | mesh () const |
The mesh we are attached to. More... | |
virtual label | size () const |
The natural field size for the expression. More... | |
virtual label | pointSize () const |
The point field size for the expression. More... | |
label | size (const FieldAssociation geoType) const |
Field size associated with different geometric field types. More... | |
bool | hasDimensions () const noexcept |
Apply dimensions() to geometric fields. More... | |
const dimensionSet & | dimensions () const noexcept |
The preferred result dimensions (if any) More... | |
void | clearField () |
Clear out local copies of the field. 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 noexcept |
The result type-name. More... | |
FieldAssociation | fieldAssociation () const noexcept |
The geometric field association. More... | |
bool | isLogical () const noexcept |
A logical (bool-like) field. Actually stored as a scalar. More... | |
bool | isVolumeData () const noexcept |
A volume field. More... | |
bool | isFaceData () const noexcept |
A surface field. More... | |
bool | isPointData () const noexcept |
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 |
autoPtr< regIOobject > | dupZeroField () const |
A zero-initialized field with the same type as the result field. More... | |
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 |
![]() | |
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... | |
![]() | |
TypeName ("fvExprDriver") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, fvExprDriver, dictionary,(const dictionary &dict, const fvMesh &mesh),(dict, mesh)) | |
declareRunTimeSelectionTable (autoPtr, fvExprDriver, idName,(const word &ident, const fvMesh &mesh),(ident, mesh)) | |
fvExprDriver (enum exprDriver::searchControls search=exprDriver::searchControls::DEFAULT_SEARCH, const dictionary &dict=dictionary::null) | |
Default construct, and default construct with search preferences. More... | |
fvExprDriver (const fvExprDriver &rhs, const dictionary &dict) | |
Copy construct with dictionary reference. More... | |
fvExprDriver (const dictionary &dict) | |
Construct from a dictionary. More... | |
virtual autoPtr< fvExprDriver > | clone ()=delete |
Not generally clonable. More... | |
virtual | ~fvExprDriver () |
Destructor. More... | |
bool | cacheSets () const |
Status of cache-sets (static variable) More... | |
virtual void | clearVariables () |
Clear temporary variables, reset from expression strings. More... | |
virtual bool | hasVariable (const word &name) const |
True if named variable exists. More... | |
virtual const exprResult & | variable (const word &name) const |
Return const-access to the named variable. More... | |
template<class Type > | |
bool | isVariableOrField (const word &name, const bool wantPointData=false, const label expectSize=-1) const |
Test for existence of a local/global variable or a field. More... | |
template<class Type > | |
tmp< Field< Type > > | getVariable (const word &name, const label expectSize, const bool mandatory=true) const |
Retrieve local/global variable as a tmp field. More... | |
word | getFieldClassName (const word &name) const |
Lookup the field class name (memory or read from disk) More... | |
topoSetSource::sourceType | topoSetType (const word &name) const |
Return cell/face/point set type or unknown. More... | |
topoSetSource::sourceType | topoZoneType (const word &name) const |
Return cell/face/point zone type or unknown. More... | |
topoSetSource::sourceType | topoSourceType (const word &name) const |
Return cell/face/point zone/set type or unknown. More... | |
refPtr< labelList > | getTopoSetLabels (const word &name, enum topoSetSource::sourceType setType) const |
Get the labels associated with the topo set. More... | |
bool | isCellZone (const word &name) const |
Test if name is a known cellZone. More... | |
bool | isFaceZone (const word &name) const |
Test if name is a known faceZone. More... | |
bool | isPointZone (const word &name) const |
Test if name is a known pointZone. More... | |
bool | isCellSet (const word &name) const |
Test if name is a known cellSet. More... | |
bool | isFaceSet (const word &name) const |
Test if name is a known faceSet. More... | |
bool | isPointSet (const word &name) const |
Test if name is a known pointSet. More... | |
virtual void | evaluateVariable (const word &varName, const expressions::exprString &expr) |
virtual void | evaluateVariableRemote (string remote, const word &varName, const expressions::exprString &expr) |
template<class Type > | |
bool | isVariable (const word &name, bool wantPointData=false, label expectSize=-1) const |
Test existence of a local/global variable. More... | |
template<class Type > | |
bool | foundField (const word &name) const |
Test if specified field can be found in memory or disk. More... | |
word | getTypeOfField (const word &fieldName) const |
Read the IOobject for fieldName and return its headerClassName. More... | |
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, 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 |
![]() | |
TypeName ("exprDriver") | |
Runtime type information. More... | |
exprDriver (const exprDriver &)=delete | |
No copy construct. More... | |
void | operator= (const exprDriver &)=delete |
No copy assignment. More... | |
exprDriver (enum searchControls search=searchControls::DEFAULT_SEARCH, const dictionary &dict=dictionary::null) | |
Default construct, and default construct with search preferences. More... | |
exprDriver (const exprDriver &rhs, const dictionary &dict) | |
Copy construct with new dictionary reference. More... | |
exprDriver (const dictionary &dict) | |
Construct from a dictionary. More... | |
virtual | ~exprDriver ()=default |
Destructor. More... | |
const TimeState * | timeState () const noexcept |
Reference to the current time-state (can be nullptr) More... | |
virtual scalar | timeValue () const |
The current time value. More... | |
virtual scalar | deltaT () const |
The current deltaT value. More... | |
const dictionary & | dict () const noexcept |
The dictionary with all input data/specification. More... | |
const exprResult & | result () const noexcept |
Const access to expression result. More... | |
exprResult & | result () noexcept |
Non-const access to expression result. More... | |
void | clearResult () |
Clear the result. More... | |
template<class Type > | |
tmp< Field< Type > > | getResult (bool wantPointData=false) |
Return the expression result as a tmp field. More... | |
const word & | getResultType () const noexcept |
The result type as word - same as result().valueType() More... | |
void | resetDb (const objectRegistry *obrPtr=nullptr) |
Reset the objectRegistry (for functions) More... | |
void | resetDb (const objectRegistry &db) |
Reset the objectRegistry (for functions) More... | |
scalar | argValue () const noexcept |
Get special-purpose scalar reference argument. More... | |
int | stashedTokenId () const noexcept |
Get "look-behind" parsing context (internal bookkeeping) More... | |
int | resetStashedTokenId (int tokenId=0) const noexcept |
Reset "look-behind" parsing context (mutable operation) More... | |
void | setDebugging (bool scannerDebug, bool parserDebug) |
Set the scanner/parser debug. More... | |
void | setDebugging (const exprDriver &rhs) |
Set the scanner/parser debug to match the input. More... | |
bool | setCaching (bool on) noexcept |
Toggle CACHE_READ_FIELDS control. More... | |
void | setSearchBehaviour (enum searchControls search, const bool caching=false) |
void | setSearchBehaviour (const exprDriver &rhs) |
Set search behaviour to be identical to rhs. More... | |
bool | debugScanner () const noexcept |
Read access to scanner debug. More... | |
bool | debugParser () const noexcept |
Read access to parser debug. More... | |
bool | prevIterIsOldTime () const |
void | setArgument (const scalar val) noexcept |
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... | |
bool | hasContextObjects () const |
True if any context fields are defined. More... | |
const regIOobject * | cfindContextIOobject (const word &name) const |
Find named context field, if it exists. More... | |
template<class ObjType > | |
const ObjType * | cfindContextObject (const word &name) const |
Find context field object of specified type. More... | |
void | addContextObject (const word &name, const regIOobject *) |
Add the object to the context. More... | |
void | addContextObject (const regIOobject *) |
Add the object to the context. More... | |
void | removeContextObject (const word &name) |
Remove the object from the context. More... | |
void | removeContextObject (const regIOobject *) |
Remove the object from the context. More... | |
const contextObjectTableType & | contextObjects () const noexcept |
Read access to the object context. More... | |
contextObjectTableType & | contextObjects () noexcept |
Write access to the object context. More... | |
template<class Type > | |
bool | isFunction (const word &name) const |
Named mapping with given type exists. More... | |
template<class Type > | |
Type | getFunctionValue (const word &name, const scalar x) const |
template<class Type > | |
void | fillFunctionValues (Field< Type > &result, const word &name, const scalarField &input) const |
Fill result with values remapped according to the named Function1. More... | |
template<class T > | |
bool | isLocalVariable (const word &name, bool wantPointData=false, label expectedSize=-1) const |
Test existence of a local variable. More... | |
template<class Type > | |
tmp< Field< Type > > | getLocalVariable (const word &name, label expectSize, const bool mandatory=true) const |
Retrieve local/global variable as a tmp field. More... | |
template<class Type > | |
tmp< Field< Type > > | evaluate (const expressions::exprString &expr, bool wantPointData=false) |
Evaluate the expression and return the field. More... | |
template<class Type > | |
Type | evaluateUniform (const expressions::exprString &expr, bool wantPointData=false) |
Evaluate the expression and return a single value. More... | |
void | evaluateVariable (const word &varName, const expressions::exprString &expr) |
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 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. 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... | |
![]() | |
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, const bool wantPointData=false, const 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, const bool wantPointData=false, const label expectSize=-1) const |
Test for the existence of a mesh field. More... | |
template<class GeomField > | |
tmp< GeomField > | getOrReadField (const word &name, const bool mandatory=true, const bool getOldTime=false) |
Retrieve field from memory or disk. More... | |
template<class GeomField > | |
tmp< GeomField > | getOrReadPointField (const word &name, const bool mandatory=true, const bool getOldTime=false) |
Retrieve point field from memory or disk. More... | |
template<class GeomField , class MeshRef > | |
tmp< GeomField > | getOrReadFieldImpl (const word &name, const MeshRef &meshRef, const bool mandatory=true, const bool getOldTime=false) |
Retrieve field from memory or disk (implementation) More... | |
template<class GeomField , class MeshRef > | |
tmp< GeomField > | readAndRegister (const word &name, const MeshRef &meshRef) |
Helper function for getOrReadField. More... | |
template<class T > | |
autoPtr< 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... | |
![]() | |
bool | searchRegistry () const noexcept |
bool | searchFiles () const noexcept |
bool | cacheReadFields () const noexcept |
void | resetTimeReference (const TimeState *ts) |
Reset the time-state reference. More... | |
void | resetTimeReference (const TimeState &ts) |
Reset the time-state reference. More... | |
void | writeFunctions (Ostream &os) const |
Write scalar/vector Function1 entries in dictionary format. More... | |
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... | |
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... | |
bool | hasDimensions_ |
Requested use of dimensions. More... | |
expressions::FieldAssociation | fieldGeoType_ |
A volume/surface/point field. More... | |
dimensionSet | resultDimensions_ |
The result dimensions. More... | |
![]() | |
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... | |
![]() | |
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... | |
HashTable< refPtr< Function1< scalar > > > | scalarFuncs_ |
HashTable< refPtr< Function1< vector > > > | vectorFuncs_ |
contextObjectTableType | contextObjects_ |
Externally defined context fields. More... | |
scalar | arg1Value_ |
Special-purpose scalar reference argument. More... | |
const TimeState * | timeStatePtr_ |
Reference to the time-state. More... | |
const objectRegistry * | obrPtr_ |
Pointer to an object registry (for functions etc). More... | |
int | stashedTokenId_ |
Internal bookkeeping as "look-behind" parsing context. More... | |
bool | debugScanner_ |
Request debugging for scanner. More... | |
bool | debugParser_ |
Request debugging for parser. More... | |
bool | allowShadowing_ |
Allow variable names to mask field names. More... | |
bool | prevIterIsOldTime_ |
Use value of previous iteration when oldTime is requested. More... | |
searchControls | searchCtrl_ |
Registry/disk/caching control. More... | |
Additional Inherited Members | |
![]() | |
typedef size_t | location_type |
Type for linear addressing within parse content. More... | |
![]() | |
enum | searchControls { NO_SEARCH = 0, SEARCH_REGISTRY = 1, SEARCH_FILES = 2, CACHE_READ_FIELDS = 4, DEFAULT_SEARCH = (SEARCH_REGISTRY) } |
Search/caching controls. More... | |
typedef HashTable< const regIOobject * > | contextObjectTableType |
Externally defined context fields. More... | |
![]() | |
static 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 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... | |
![]() | |
enum | SetOrigin { INVALID = 0, NEW, FILE, MEMORY, CACHE } |
The origin of the topoSet. More... | |
![]() | |
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 > &) |
template<class T > | |
static void | correctField (T &) |
Apply correctBoundaryConditions (volume fields only) More... | |
template<class Type > | |
static void | correctField (GeometricField< Type, fvPatchField, volMesh > &fld) |
![]() | |
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 230 of file volumeExprDriver.H.
|
delete |
|
explicit |
Construct for specified mesh, with dictionary information.
Definition at line 87 of file volumeExprDriver.C.
parseDriver | ( | const fvMesh & | mesh, |
const parseDriver & | driver, | ||
const dictionary & | dict | ||
) |
Construct for specified mesh with copy of driver context.
Definition at line 107 of file volumeExprDriver.C.
parseDriver | ( | const word & | meshName, |
const fvMesh & | mesh | ||
) |
Construct with meshName for the given mesh.
Definition at line 128 of file volumeExprDriver.C.
parseDriver | ( | const dictionary & | dict, |
const fvMesh & | mesh | ||
) |
Construct with patchName and region specified in dictionary.
Definition at line 140 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 77 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 153 of file volumeExprDriverFields.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld, mesh, Foam::name(), Foam::New(), Foam::nl, and Foam::Zero.
ClassName | ( | "volumeExpr::driver" | ) |
|
delete |
|
inlinevirtual |
The mesh we are attached to.
Implements fvExprDriver.
Definition at line 342 of file volumeExprDriver.H.
References parseDriver::mesh_.
Referenced by parseDriver::field_cellVolume().
|
inlinevirtual |
The natural field size for the expression.
Implements fvExprDriver.
Definition at line 348 of file volumeExprDriver.H.
References parseDriver::mesh_, and primitiveMesh::nCells().
|
inlinevirtual |
The point field size for the expression.
Implements fvExprDriver.
Definition at line 354 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::FACE_DATA, Foam::expressions::POINT_DATA, and Foam::expressions::VOLUME_DATA.
|
inlinenoexcept |
Apply dimensions() to geometric fields.
Definition at line 53 of file volumeExprDriverI.H.
References parseDriver::hasDimensions_.
|
inlinenoexcept |
The preferred result dimensions (if any)
Definition at line 61 of file volumeExprDriverI.H.
void clearField | ( | ) |
Clear out local copies of the field.
Definition at line 197 of file volumeExprDriver.C.
References parseDriver::fieldGeoType_, parseDriver::isLogical_, Foam::expressions::NO_DATA, parseDriver::resultField_, and parseDriver::resultType_.
|
virtual |
Read variables, tables etc.
Adds support for "dimensions"
Reimplemented from fvExprDriver.
Definition at line 161 of file volumeExprDriver.C.
References dict.
|
virtual |
Execute the parser.
The return value currently has no meaning.
Implements exprDriver.
Definition at line 183 of file volumeExprDriver.C.
References 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 400 of file volumeExprDriver.H.
|
inlinenoexcept |
The geometric field association.
Definition at line 406 of file volumeExprDriver.H.
References parseDriver::fieldGeoType_.
|
inlinenoexcept |
A logical (bool-like) field. Actually stored as a scalar.
Definition at line 412 of file volumeExprDriver.H.
References parseDriver::isLogical_.
|
inlinenoexcept |
A volume field.
Definition at line 418 of file volumeExprDriver.H.
References parseDriver::fieldGeoType_, and Foam::expressions::VOLUME_DATA.
|
inlinenoexcept |
A surface field.
Definition at line 424 of file volumeExprDriver.H.
References Foam::expressions::FACE_DATA, and parseDriver::fieldGeoType_.
|
inlinenoexcept |
A point field.
Definition at line 430 of file volumeExprDriver.H.
References parseDriver::fieldGeoType_, and Foam::expressions::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
Foam::autoPtr< Foam::regIOobject > dupZeroField | ( | ) | const |
A zero-initialized field with the same type as the result field.
Definition at line 209 of file volumeExprDriver.C.
References doLocalCode, Foam::expressions::FACE_DATA, Foam::expressions::POINT_DATA, and Foam::expressions::VOLUME_DATA.
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::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 Foam::expressions::FACE_DATA, and GeometricField< Type, PatchField, GeoMesh >::primitiveField().
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::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 541 of file volumeExprDriver.H.
References fld, and exprDriver::weightedAverage().
|
inline |
The volume-weighted sum of a field.
Definition at line 551 of file volumeExprDriver.H.
References fld, and exprDriver::weightedSum().
|
inline |
The area-weighted average of a field.
Definition at line 561 of file volumeExprDriver.H.
References fld, and exprDriver::weightedAverage().
|
inline |
The area-weighted sum of a field.
Definition at line 575 of file volumeExprDriver.H.
References fld, and exprDriver::weightedSum().
Foam::tmp< Foam::volScalarField > field_cellVolume | ( | ) | const |
The cell volumes - (swak = vol)
Definition at line 194 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 207 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 214 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 227 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 240 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 253 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 83 of file volumeExprDriverI.H.
References Foam::name().
|
inline |
Face selection (set)
Definition at line 97 of file volumeExprDriverI.H.
References Foam::name().
|
inline |
Face selection (zone)
Definition at line 111 of file volumeExprDriverI.H.
References Foam::name().
|
inline |
Point selection (set)
Definition at line 125 of file volumeExprDriverI.H.
References Foam::name().
|
inline |
Point selection (zone)
Definition at line 139 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 267 of file volumeExprDriverFields.C.
References Foam::dimless, exprDriver::fill_random(), mesh, and GeometricField< scalar, fvPatchField, volMesh >::New().
Referenced by parseDriver::field_randGaussian().
|
inline |
A Gaussian random field.
Definition at line 628 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 Foam::New().
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > newSurfaceField | ( | const Type & | val | ) | const |
Definition at line 262 of file volumeExprDriverTemplates.C.
References Foam::dimless, mesh, and Foam::New().
Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> > newPointField | ( | const Type & | val | ) | const |
Definition at line 280 of file volumeExprDriverTemplates.C.
References Foam::dimless, mesh, Foam::New(), and MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New().
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > cellToFace | ( | const GeometricField< Type, fvPatchField, volMesh > & | field | ) | const |
Definition at line 298 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 309 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 321 of file volumeExprDriverTemplates.C.
References field(), forAll, and Foam::interpolatePointToCell().
|
protected |
The referenced mesh.
Definition at line 240 of file volumeExprDriver.H.
Referenced by parseDriver::mesh(), parseDriver::pointSize(), and parseDriver::size().
|
protected |
The results (volume, surface, point)
Definition at line 243 of file volumeExprDriver.H.
Referenced by parseDriver::clearField(), and parseDriver::isResultType().
|
protected |
The result type-name.
Normally volScalarField, surfaceVectorField etc, but Scalar is modified for logical as volScalarField etc
Definition at line 248 of file volumeExprDriver.H.
Referenced by parseDriver::clearField().
|
protected |
A logical (bool-like) field (but actually a scalar)
Definition at line 251 of file volumeExprDriver.H.
Referenced by parseDriver::clearField(), and parseDriver::isLogical().
|
protected |
Requested use of dimensions.
Definition at line 254 of file volumeExprDriver.H.
Referenced by parseDriver::hasDimensions().
|
protected |
A volume/surface/point field.
Definition at line 257 of file volumeExprDriver.H.
Referenced by parseDriver::clearField(), parseDriver::fieldAssociation(), parseDriver::isFaceData(), parseDriver::isPointData(), and parseDriver::isVolumeData().
|
protected |
The result dimensions.
Definition at line 260 of file volumeExprDriver.H.