Base driver for parsing (field) values. More...
Public Types | |
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... | |
Public Member Functions | |
TypeName ("exprDriver") | |
Runtime type information. More... | |
exprDriver (const exprDriver &)=delete | |
No copy construct. More... | |
void | operator= (const exprDriver &)=delete |
No copy assignment. More... | |
exprDriver (enum searchControls search=searchControls::DEFAULT_SEARCH, const dictionary &dict=dictionary::null) | |
Default construct, and default construct with search preferences. More... | |
exprDriver (const exprDriver &rhs, const dictionary &dict) | |
Copy construct with new dictionary reference. More... | |
exprDriver (const dictionary &dict) | |
Construct from a dictionary. More... | |
virtual | ~exprDriver ()=default |
Destructor. More... | |
virtual label | size () const |
The natural field size for the expression. More... | |
virtual label | pointSize () const |
The point field size for the expression. More... | |
const 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 |
virtual void | clearVariables () |
Clear temporary variables, reset from expression strings. More... | |
void | setArgument (const scalar val) noexcept |
Set special-purpose scalar reference argument. More... | |
virtual bool | hasVariable (const word &name) const |
True if named variable exists. More... | |
virtual const exprResult & | variable (const word &name) const |
Return const-access to the named variable. More... | |
void | addVariables (const expressions::exprString &expr, bool clear=true) |
Add/set string expressions for variables. More... | |
void | addVariables (const UList< expressions::exprString > &list, bool clear=true) |
Add/set string expressions for variables. More... | |
template<class T > | |
void | addUniformVariable (const word &name, const T &val) |
Add a uniform variable from an outside caller. More... | |
bool | hasContextObjects () const |
True if any context fields are defined. More... | |
const 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... | |
virtual unsigned | parse (const std::string &expr, size_t pos=0, size_t len=std::string::npos)=0 |
Execute the parser. More... | |
template<class Type > | |
tmp< Field< Type > > | evaluate (const expressions::exprString &expr, bool wantPointData=false) |
Evaluate the expression and return the field. More... | |
template<class Type > | |
Type | evaluateUniform (const expressions::exprString &expr, bool wantPointData=false) |
Evaluate the expression and return a single value. More... | |
void | evaluateVariable (const word &varName, const expressions::exprString &expr) |
virtual void | evaluateVariableRemote (string remote, const word &varName, const expressions::exprString &expr) |
template<class Type > | |
tmp< Field< Type > > | newField (const Type &val=pTraits< Type >::zero) const |
Return a new field with the size() More... | |
template<class Type > | |
tmp< Field< Type > > | newPointField (const Type &val=pTraits< Type >::zero) const |
Return a new field with the pointSize() More... | |
expressions::exprString | readExpression (const word &name) |
virtual bool | readDict (const dictionary &dict) |
Read variables, tables etc. More... | |
label | setVariableStrings (const dictionary &dict, bool mandatory=false) |
Read "variables" and assigns to the list of expression strings. More... | |
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 |
Static Public Member Functions | |
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 Member Functions | |
bool | searchRegistry () const noexcept |
bool | searchFiles () const noexcept |
bool | cacheReadFields () const noexcept |
void | resetTimeReference (const TimeState *ts) |
Reset the time-state reference. More... | |
void | resetTimeReference (const TimeState &ts) |
Reset the time-state reference. More... | |
void | writeFunctions (Ostream &os) const |
Write scalar/vector Function1 entries in dictionary format. More... | |
virtual exprResult & | variable (const word &name) |
Non-const access to the named variable (sub-classes only) More... | |
void | fill_random (scalarField &field, label seed=0, const bool gaussian=false) const |
Fill a random field. More... | |
virtual bool | update () |
Update things. More... | |
virtual void | updateSpecialVariables (bool force=false) |
Examine current variable values and update stored variables. More... | |
virtual exprResult | getRemoteResult (const exprDriver &other) const |
Get the result from another driver. More... | |
Static Protected Member Functions | |
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... | |
Protected Attributes | |
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... | |
Base driver for parsing (field) values.
Largely based on code and ideas from swak4foam
Properties
Property | Description | Required | Default |
---|---|---|---|
variables | List of variables for expressions | no | () |
functions<scalar> | Dictionary of scalar Function1 | no | {} |
functions<vector> | Dictionary of vector Function1 | no | {} |
allowShadowing | Allow variables to shadow field names | no | false |
Debug Properties
Property | Description | Required | Default |
---|---|---|---|
debug.driver | Debug level (int) for base driver | no | |
debug.scanner | Add debug for scanner | no | false |
debug.parser | Add debug for parser | no | false |
The functions<scalar>
and functions<vector>
entries are dictionaries of Foam::Function1 definitions that can either be used to establish a time-varying quantity, to remap a field of scalar values, or both.
Definition at line 140 of file exprDriver.H.
typedef HashTable<const regIOobject*> contextObjectTableType |
Externally defined context fields.
Definition at line 158 of file exprDriver.H.
enum searchControls |
Search/caching controls.
Enumerator | |
---|---|
NO_SEARCH | |
SEARCH_REGISTRY | Search registry before disk. |
SEARCH_FILES | Search disk (eg, standalone app) |
CACHE_READ_FIELDS | Cache fields read from disk. |
DEFAULT_SEARCH |
Definition at line 147 of file exprDriver.H.
|
delete |
No copy construct.
|
explicit |
Default construct, and default construct with search preferences.
Definition at line 173 of file exprDriver.C.
exprDriver | ( | const exprDriver & | rhs, |
const dictionary & | dict | ||
) |
Copy construct with new dictionary reference.
Definition at line 200 of file exprDriver.C.
References exprDriver::dict_, exprDriver::scalarFuncs_, Foam::shallowCloneFunctions(), and exprDriver::vectorFuncs_.
|
explicit |
Construct from a dictionary.
Definition at line 237 of file exprDriver.C.
References exprDriver::dict(), and exprDriver::readDict().
|
virtualdefault |
Destructor.
|
inlineprotectednoexcept |
Definition at line 144 of file exprDriverI.H.
|
inlineprotectednoexcept |
Definition at line 150 of file exprDriverI.H.
|
inlineprotectednoexcept |
Definition at line 156 of file exprDriverI.H.
|
protected |
Reset the time-state reference.
Definition at line 130 of file exprDriver.C.
Referenced by parseDriver::parseDriver().
|
protected |
Reset the time-state reference.
Definition at line 136 of file exprDriver.C.
|
protected |
Write scalar/vector Function1 entries in dictionary format.
Definition at line 221 of file exprDriverFunctions.C.
References os().
|
inlineprotectedvirtual |
Non-const access to the named variable (sub-classes only)
Reimplemented in fvExprDriver.
Definition at line 63 of file exprDriverI.H.
References Foam::name().
Referenced by parseDriver::getField().
|
protected |
Fill a random field.
field | the field to populate |
seed | the seed value. If zero or negative, use as an offset to the current timeIndex (if a time-state is available) |
gaussian | generate a Gaussian distribution |
Definition at line 35 of file exprDriverFields.C.
References Foam::FieldOps::assign(), field(), TimeState::timeIndex(), and exprDriver::timeStatePtr_.
Referenced by parseDriver::field_rand().
|
staticprotected |
The (global) weighted average of a field, with stabilisation.
Definition at line 34 of file exprDriverTemplates.C.
References fld(), Foam::gSum(), Foam::isNull(), Foam::mag(), n, Foam::returnReduce(), s(), and Foam::Zero.
Referenced by parseDriver::areaAverage(), and parseDriver::volAverage().
|
staticprotected |
The (global) weighted sum (integral) of a field.
Definition at line 70 of file exprDriverTemplates.C.
References fld(), Foam::gSum(), and Foam::isNull().
Referenced by parseDriver::areaSum(), and parseDriver::volSum().
|
staticprotected |
Return the location of the min value.
Definition at line 67 of file exprDriverFields.C.
References Foam::FieldOps::findMinData().
|
staticprotected |
Return the location of the max value.
Definition at line 77 of file exprDriverFields.C.
References Foam::FieldOps::findMaxData().
|
protectedvirtual |
Update things.
Definition at line 321 of file exprDriver.C.
Referenced by fvExprDriver::prepareData().
|
protectedvirtual |
Examine current variable values and update stored variables.
Reimplemented in fvExprDriver.
Definition at line 327 of file exprDriver.C.
|
protectedvirtual |
Get the result from another driver.
Override to allow mapping
Definition at line 368 of file exprDriver.C.
References exprResult::getUniform(), and exprDriver::result().
TypeName | ( | "exprDriver" | ) |
Runtime type information.
|
delete |
No copy assignment.
|
inlinevirtual |
The natural field size for the expression.
Reimplemented in parseDriver, parseDriver, parseDriver, and fvExprDriver.
Definition at line 363 of file exprDriver.H.
|
inlinevirtual |
The point field size for the expression.
Reimplemented in parseDriver, parseDriver, parseDriver, and fvExprDriver.
Definition at line 369 of file exprDriver.H.
|
noexcept |
Reference to the current time-state (can be nullptr)
Definition at line 254 of file exprDriver.C.
|
virtual |
The current time value.
Definition at line 268 of file exprDriver.C.
|
virtual |
The current deltaT value.
Definition at line 282 of file exprDriver.C.
|
inlinenoexcept |
The dictionary with all input data/specification.
Definition at line 385 of file exprDriver.H.
References exprDriver::dict_.
Referenced by exprDriver::exprDriver(), fvExprDriver::fvExprDriver(), fvExprDriver::New(), and exprDriver::readExpression().
|
inlinenoexcept |
Const access to expression result.
Definition at line 391 of file exprDriver.H.
References exprDriver::result_.
Referenced by Foam::stringOps::evaluate(), exprDriver::getRemoteResult(), fvExprDriver::isGlobalVariable(), parseDriver::setInternalFieldResult(), and parseDriver::setResult().
|
inlinenoexcept |
Non-const access to expression result.
Definition at line 397 of file exprDriver.H.
References exprDriver::result_.
void clearResult | ( | ) |
Clear the result.
Definition at line 315 of file exprDriver.C.
Return the expression result as a tmp field.
This also clears the result and associated memory.
|
inlinenoexcept |
The result type as word - same as result().valueType()
Definition at line 411 of file exprDriver.H.
References exprDriver::result_, and exprResult::valueType().
void resetDb | ( | const objectRegistry * | obrPtr = nullptr | ) |
Reset the objectRegistry (for functions)
Definition at line 142 of file exprDriver.C.
References forAllIters.
Referenced by parseDriver::parseDriver().
void resetDb | ( | const objectRegistry & | db | ) |
Reset the objectRegistry (for functions)
Definition at line 165 of file exprDriver.C.
|
inlinenoexcept |
Get special-purpose scalar reference argument.
Typically available as arg()
in an expression and may correspond to table index, time value etc.
Definition at line 37 of file exprDriverI.H.
References exprDriver::arg1Value_.
|
inlinenoexcept |
Get "look-behind" parsing context (internal bookkeeping)
Definition at line 115 of file exprDriverI.H.
|
inlinenoexcept |
Reset "look-behind" parsing context (mutable operation)
Definition at line 121 of file exprDriverI.H.
Set the scanner/parser debug.
Definition at line 492 of file exprDriver.C.
void setDebugging | ( | const exprDriver & | rhs | ) |
Set the scanner/parser debug to match the input.
Definition at line 503 of file exprDriver.C.
References exprDriver::debugParser_, and exprDriver::debugScanner_.
Toggle CACHE_READ_FIELDS control.
Definition at line 513 of file exprDriver.C.
void setSearchBehaviour | ( | enum searchControls | search, |
const bool | caching = false |
||
) |
Set search behaviour, with additional CACHE_READ_FIELDS toggle on
Definition at line 541 of file exprDriver.C.
References Foam::Info, Foam::nl, and Foam::search().
void setSearchBehaviour | ( | const exprDriver & | rhs | ) |
Set search behaviour to be identical to rhs.
Definition at line 569 of file exprDriver.C.
References exprDriver::searchCtrl_.
|
inlinenoexcept |
Read access to scanner debug.
Definition at line 132 of file exprDriverI.H.
|
inlinenoexcept |
Read access to parser debug.
Definition at line 138 of file exprDriverI.H.
|
inline |
Definition at line 470 of file exprDriver.H.
References exprDriver::prevIterIsOldTime_.
|
virtual |
Clear temporary variables, reset from expression strings.
Reimplemented in fvExprDriver.
Definition at line 331 of file exprDriver.C.
|
inlinenoexcept |
Set special-purpose scalar reference argument.
Typically available as arg()
in an expression and may corrspond to table index, time value etc.
Definition at line 31 of file exprDriverI.H.
True if named variable exists.
Reimplemented in fvExprDriver.
Definition at line 43 of file exprDriverI.H.
References Foam::name().
Referenced by parseDriver::getField().
|
inlinevirtual |
Return const-access to the named variable.
Reimplemented in fvExprDriver.
Definition at line 53 of file exprDriverI.H.
References Foam::name().
void addVariables | ( | const expressions::exprString & | expr, |
bool | clear = true |
||
) |
Add/set string expressions for variables.
Can include multiple definitions inline
clear | Remove previously defined variables |
Definition at line 378 of file exprDriver.C.
References clear(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::FatalIOError, FatalIOErrorInFunction, Foam::stringOps::inplaceTrim(), Foam::nl, Foam::stringOps::trim(), and kkLOmega::validate().
void addVariables | ( | const UList< expressions::exprString > & | list, |
bool | clear = true |
||
) |
Add/set string expressions for variables.
Can include multiple definitions inline
clear | Remove previously defined variables |
Definition at line 474 of file exprDriver.C.
References clear().
Add a uniform variable from an outside caller.
|
inline |
True if any context fields are defined.
Definition at line 30 of file exprDriverContextI.H.
References exprDriver::contextObjects_, and HashTable< T, Key, Hash >::empty().
|
inline |
Find named context field, if it exists.
Definition at line 37 of file exprDriverContextI.H.
References Foam::name().
Referenced by fvExprDriver::foundField(), parseDriver::getField(), parseDriver::patchInternalField(), parseDriver::patchNeighbourField(), and parseDriver::patchNormalField().
const ObjType * cfindContextObject | ( | const word & | name | ) | const |
Find context field object of specified type.
Definition at line 113 of file exprDriverContextI.H.
References Foam::name().
|
inline |
Add the object to the context.
Definition at line 47 of file exprDriverContextI.H.
References Foam::name().
|
inline |
Add the object to the context.
Definition at line 64 of file exprDriverContextI.H.
References IOobject::name().
|
inline |
Remove the object from the context.
Definition at line 76 of file exprDriverContextI.H.
References Foam::name().
|
inline |
Remove the object from the context.
Definition at line 85 of file exprDriverContextI.H.
References IOobject::name().
|
inlinenoexcept |
Read access to the object context.
Definition at line 98 of file exprDriverContextI.H.
|
inlinenoexcept |
Write access to the object context.
Definition at line 105 of file exprDriverContextI.H.
Named mapping with given type exists.
Definition at line 135 of file exprDriverTemplates.C.
References doLocalCode.
Type getFunctionValue | ( | const word & | name, |
const scalar | x | ||
) | const |
Evaluate named mapping for the given time/value. Zero for undefined/unknown
Definition at line 160 of file exprDriverTemplates.C.
References doLocalCode, UList< T >::empty(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), Foam::func(), Foam::name(), Foam::nl, and x.
void fillFunctionValues | ( | Field< Type > & | result, |
const word & | name, | ||
const scalarField & | input | ||
) | const |
Fill result with values remapped according to the named Function1.
Definition at line 213 of file exprDriverTemplates.C.
References doLocalCode, UList< T >::empty(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), Foam::func(), Foam::input(), Foam::min(), Foam::name(), Foam::nl, UList< T >::size(), and Foam::Zero.
bool isLocalVariable | ( | const word & | name, |
bool | wantPointData = false , |
||
label | expectedSize = -1 |
||
) | const |
Test existence of a local variable.
Definition at line 284 of file exprDriverTemplates.C.
References DebugInfo, Foam::endl(), Foam::Info, exprResult::isPointData(), exprResult::isType(), Foam::name(), Foam::reduce(), exprResult::size(), and exprResult::valueType().
tmp< Field< Type > > getLocalVariable | ( | const word & | name, |
label | expectSize, | ||
const bool | mandatory = true |
||
) | const |
Retrieve local/global variable as a tmp field.
name | The name of the local/global field |
expectSize | The size check on the variable, -1 to ignore |
mandatory | A missing variable is Fatal, or return an invalid tmp |
|
pure virtual |
Execute the parser.
The return value currently has no meaning.
Implemented in parseDriver, parseDriver, and parseDriver.
|
inline |
Evaluate the expression and return the field.
This also clears the result and associated memory.
|
inline |
Evaluate the expression and return a single value.
Does not clear the result.
Definition at line 100 of file exprDriverI.H.
void evaluateVariable | ( | const word & | varName, |
const expressions::exprString & | expr | ||
) |
Evaluate the expression and save as the specified named variable
Definition at line 338 of file exprDriver.C.
References DebugInfo, and Foam::endl().
|
virtual |
Evaluate an expression on a remote and save as the specified named variable
Reimplemented in fvExprDriver.
Definition at line 356 of file exprDriver.C.
References NotImplemented.
Return a new field with the size()
Return a new field with the pointSize()
|
static |
Read an expression string and do substitutions.
Definition at line 74 of file exprDriverIO.C.
References exprDriver::dict(), dictionary::get(), and Foam::name().
|
static |
Read the list of variable strings.
(or initialize with a single string)
Definition at line 95 of file exprDriverIO.C.
References dict, and Foam::exprTools::getList().
Foam::expressions::exprString readExpression | ( | const word & | name | ) |
Read an expression string (with the current dictionary) and do substitutions
Definition at line 85 of file exprDriverIO.C.
References dict, and Foam::name().
|
virtual |
Read variables, tables etc.
Also usable for objects not constructed from a dictionary.
Reimplemented in fvExprDriver, and parseDriver.
Definition at line 296 of file exprDriver.C.
References dict, and exprDriver::readDict().
Referenced by exprDriver::exprDriver(), Function1Expression< Type >::Function1Expression(), and exprDriver::readDict().
Foam::label setVariableStrings | ( | const dictionary & | dict, |
bool | mandatory = false |
||
) |
Read "variables" and assigns to the list of expression strings.
Definition at line 106 of file exprDriverIO.C.
References dict.
Foam::Ostream & writeVariableStrings | ( | Ostream & | os, |
const word & | keyword = "" |
||
) | const |
Write "variables".
Definition at line 118 of file exprDriverIO.C.
References os().
|
inline |
Definition at line 73 of file exprDriverI.H.
References Foam::name(), and exprResult::setSingleValue().
Foam::tmp< Foam::Field< Type > > evaluate | ( | const expressions::exprString & | expr, |
bool | wantPointData | ||
) |
Definition at line 86 of file exprDriverI.H.
Foam::tmp< Foam::Field< Type > > getResult | ( | bool | wantPointData | ) |
Definition at line 91 of file exprDriverTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
const Foam::Function1< Type > * getFunction1Ptr | ( | const word & | name, |
const HashTable< refPtr< Function1< Type > > > & | tbl, | ||
wordList * | listFailure | ||
) |
Definition at line 109 of file exprDriverTemplates.C.
References Foam::func(), and Foam::name().
Foam::tmp< Foam::Field< Type > > newField | ( | const Type & | val | ) | const |
Definition at line 330 of file exprDriverTemplates.C.
References Foam::New().
Foam::tmp< Foam::Field< Type > > newPointField | ( | const Type & | val | ) | const |
Definition at line 341 of file exprDriverTemplates.C.
References Foam::New().
|
protected |
The dictionary with all input data/specification.
Definition at line 188 of file exprDriver.H.
Referenced by exprDriver::dict(), and exprDriver::exprDriver().
|
protected |
The result.
Definition at line 191 of file exprDriver.H.
Referenced by exprDriver::getResultType(), and exprDriver::result().
|
protected |
Variable definitions, as read from a dictionary.
Definition at line 194 of file exprDriver.H.
|
protected |
The variables table.
Definition at line 197 of file exprDriver.H.
Referenced by fvExprDriver::hasVariable().
Function1 mappings/timelines (scalar), evaluated at the simulation time or with arbitrary scalars
Definition at line 201 of file exprDriver.H.
Referenced by exprDriver::exprDriver().
Function1 mappings/timelines (vector), evaluated at the simulation time or with arbitrary scalars
Definition at line 205 of file exprDriver.H.
Referenced by exprDriver::exprDriver().
|
protected |
Externally defined context fields.
Definition at line 208 of file exprDriver.H.
Referenced by exprDriver::hasContextObjects().
|
protected |
Special-purpose scalar reference argument.
Definition at line 211 of file exprDriver.H.
Referenced by exprDriver::argValue().
|
mutableprotected |
Reference to the time-state.
Definition at line 214 of file exprDriver.H.
Referenced by exprDriver::fill_random().
|
protected |
Pointer to an object registry (for functions etc).
Definition at line 217 of file exprDriver.H.
|
mutableprotected |
Internal bookkeeping as "look-behind" parsing context.
Definition at line 223 of file exprDriver.H.
|
protected |
Request debugging for scanner.
Definition at line 226 of file exprDriver.H.
Referenced by exprDriver::setDebugging().
|
protected |
Request debugging for parser.
Definition at line 229 of file exprDriver.H.
Referenced by exprDriver::setDebugging().
|
protected |
Allow variable names to mask field names.
Definition at line 232 of file exprDriver.H.
|
protected |
Use value of previous iteration when oldTime is requested.
Definition at line 235 of file exprDriver.H.
Referenced by exprDriver::prevIterIsOldTime().
|
protected |
Registry/disk/caching control.
Definition at line 238 of file exprDriver.H.
Referenced by exprDriver::setSearchBehaviour().