Public Member Functions | Protected Attributes | List of all members
parseDriver Class Reference

Driver for generic primitive field expressions. More...

Inheritance diagram for parseDriver:
Inheritance graph
[legend]
Collaboration diagram for parseDriver:
Collaboration graph
[legend]

Public Member Functions

 ClassName ("fieldExpr::driver")
 
 parseDriver (const parseDriver &)=delete
 
void operator= (const parseDriver &)=delete
 
 parseDriver (const label len=1)
 
 parseDriver (const label len, const dictionary &dict)
 
 parseDriver (const label len, const parseDriver &rhs, const dictionary &dict)
 
virtual ~parseDriver ()=default
 
virtual label size () const
 
virtual label pointSize () const
 
virtual unsigned parse (const std::string &expr, size_t pos=0, size_t len=std::string::npos)
 
template<class Type >
void setResult (Field< Type > *ptr, bool pointVal=false)
 
template<class Type >
tmp< Field< Type > > getField (const word &fieldName) const
 
tmp< scalarFieldfield_rand (label seed=0, bool gaussian=false) const
 
tmp< scalarFieldfield_randGaussian (label seed=0) const
 
- Public Member Functions inherited from genericRagelLemonDriver
 genericRagelLemonDriver ()
 
 genericRagelLemonDriver (const genericRagelLemonDriver &rhs)=default
 
 genericRagelLemonDriver (genericRagelLemonDriver &&rhs)=default
 
virtual ~genericRagelLemonDriver ()=default
 
void clear ()
 
const std::string & content () const
 
void content (const std::string &s, size_t pos=0, size_t len=std::string::npos)
 
std::string::const_iterator cbegin () const
 
std::string::const_iterator cend () const
 
size_t parsePosition () const
 
size_t & parsePosition ()
 
OstreamprintBuffer (Ostream &os) const
 
void reportFatal (const std::string &msg) const
 
void reportFatal (const std::string &msg, size_t pos) const
 
- Public Member Functions inherited from exprDriver
 TypeName ("exprDriver")
 
 exprDriver (const exprDriver &)=delete
 
void operator= (const exprDriver &)=delete
 
 exprDriver (enum searchControls search=searchControls::DEFAULT_SEARCH, const dictionary &dict=dictionary::null)
 
 exprDriver (const exprDriver &rhs, const dictionary &dict)
 
 exprDriver (const dictionary &dict)
 
virtual ~exprDriver ()=default
 
const TimeStatetimeState () const noexcept
 
virtual scalar timeValue () const
 
virtual scalar deltaT () const
 
const dictionarydict () const noexcept
 
const exprResultresult () const noexcept
 
exprResultresult () noexcept
 
void clearResult ()
 
template<class Type >
tmp< Field< Type > > getResult (bool wantPointData=false)
 
const wordgetResultType () const noexcept
 
void resetDb (const objectRegistry *obrPtr=nullptr)
 
void resetDb (const objectRegistry &db)
 
scalar argValue () const noexcept
 
int stashedTokenId () const noexcept
 
int resetStashedTokenId (int tokenId=0) const noexcept
 
void setDebugging (bool scannerDebug, bool parserDebug)
 
void setDebugging (const exprDriver &rhs)
 
bool setCaching (bool on) noexcept
 
void setSearchBehaviour (enum searchControls search, const bool caching=false)
 
void setSearchBehaviour (const exprDriver &rhs)
 
bool debugScanner () const noexcept
 
bool debugParser () const noexcept
 
bool prevIterIsOldTime () const
 
virtual void clearVariables ()
 
void setArgument (const scalar val) noexcept
 
virtual bool hasVariable (const word &name) const
 
virtual const exprResultvariable (const word &name) const
 
void addVariables (const expressions::exprString &expr, bool clear=true)
 
void addVariables (const UList< expressions::exprString > &list, bool clear=true)
 
template<class T >
void addUniformVariable (const word &name, const T &val)
 
bool hasContextObjects () const
 
const regIOobjectcfindContextIOobject (const word &name) const
 
template<class ObjType >
const ObjType * cfindContextObject (const word &name) const
 
void addContextObject (const word &name, const regIOobject *)
 
void addContextObject (const regIOobject *)
 
void removeContextObject (const word &name)
 
void removeContextObject (const regIOobject *)
 
const contextObjectTableTypecontextObjects () const noexcept
 
contextObjectTableTypecontextObjects () noexcept
 
template<class Type >
bool isFunction (const word &name) const
 
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
 
template<class T >
bool isLocalVariable (const word &name, bool wantPointData=false, label expectedSize=-1) const
 
template<class Type >
tmp< Field< Type > > getLocalVariable (const word &name, label expectSize, const bool mandatory=true) const
 
template<class Type >
tmp< Field< Type > > evaluate (const expressions::exprString &expr, bool wantPointData=false)
 
template<class Type >
Type evaluateUniform (const expressions::exprString &expr, bool wantPointData=false)
 
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
 
template<class Type >
tmp< Field< Type > > newPointField (const Type &val=pTraits< Type >::zero) const
 
expressions::exprString readExpression (const word &name)
 
virtual bool readDict (const dictionary &dict)
 
label setVariableStrings (const dictionary &dict, bool mandatory=false)
 
OstreamwriteVariableStrings (Ostream &os, const word &keyword="") const
 
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 Attributes

label size_
 
- Protected Attributes inherited from genericRagelLemonDriver
std::reference_wrapper< const std::string > content_
 
size_t start_
 
size_t length_
 
size_t position_
 
- Protected Attributes inherited from exprDriver
const dictionarydict_
 
exprResult result_
 
List< expressions::exprStringvariableStrings_
 
HashTable< exprResultvariables_
 
HashTable< refPtr< Function1< scalar > > > scalarFuncs_
 
HashTable< refPtr< Function1< vector > > > vectorFuncs_
 
contextObjectTableType contextObjects_
 
scalar arg1Value_
 
const TimeStatetimeStatePtr_
 
const objectRegistryobrPtr_
 
int stashedTokenId_
 
bool debugScanner_
 
bool debugParser_
 
bool allowShadowing_
 
bool prevIterIsOldTime_
 
searchControls searchCtrl_
 

Additional Inherited Members

- Public Types inherited from genericRagelLemonDriver
typedef size_t location_type
 
- Public Types inherited from exprDriver
enum  searchControls {
  NO_SEARCH = 0, SEARCH_REGISTRY = 1, SEARCH_FILES = 2, CACHE_READ_FIELDS = 4,
  DEFAULT_SEARCH = (SEARCH_REGISTRY)
}
 
typedef HashTable< const regIOobject * > contextObjectTableType
 
- Static Public Member Functions inherited from exprDriver
static expressions::exprString readExpression (const word &name, const dictionary &dict)
 
static List< expressions::exprStringreadVariableStrings (const dictionary &dict, const word &name="variables", bool mandatory=false)
 
- Protected Member Functions inherited from exprDriver
bool searchRegistry () const noexcept
 
bool searchFiles () const noexcept
 
bool cacheReadFields () const noexcept
 
void resetTimeReference (const TimeState *ts)
 
void resetTimeReference (const TimeState &ts)
 
void writeFunctions (Ostream &os) const
 
virtual exprResultvariable (const word &name)
 
void fill_random (scalarField &field, label seed=0, const bool gaussian=false) const
 
virtual bool update ()
 
virtual void updateSpecialVariables (bool force=false)
 
virtual exprResult getRemoteResult (const exprDriver &other) const
 
- Static Protected Member Functions inherited from exprDriver
template<class Type >
static Type weightedAverage (const scalarField &weights, const Field< Type > &fld)
 
template<class Type >
static Type weightedSum (const scalarField &weights, const Field< Type > &fld)
 
static point getPositionOfMinimum (const scalarField &vals, const pointField &locs)
 
static point getPositionOfMaximum (const scalarField &vals, const pointField &locs)
 

Detailed Description

Driver for generic primitive field expressions.

In addition to the standard mathematical functions, operations and logical and relational operations, the volume expression support the following driver-specific functions:

Functions

Function Description Number of arguments
rand Random field 0/1
Note
Use namespace debug switch fieldExpr for scanner (2), parser (4)
Source files

Definition at line 78 of file fieldExprDriver.H.

Constructor & Destructor Documentation

◆ parseDriver() [1/4]

parseDriver ( const parseDriver )
delete

◆ parseDriver() [2/4]

parseDriver ( const label  len = 1)
explicit

Definition at line 46 of file fieldExprDriver.C.

◆ parseDriver() [3/4]

parseDriver ( const label  len,
const dictionary dict 
)

Definition at line 57 of file fieldExprDriver.C.

◆ parseDriver() [4/4]

parseDriver ( const label  len,
const parseDriver rhs,
const dictionary dict 
)

Definition at line 69 of file fieldExprDriver.C.

◆ ~parseDriver()

virtual ~parseDriver ( )
virtualdefault

Member Function Documentation

◆ ClassName()

ClassName ( "fieldExpr::driver"  )

◆ operator=()

void operator= ( const parseDriver )
delete

◆ size()

virtual label size ( ) const
inlinevirtual

Reimplemented from exprDriver.

Definition at line 127 of file fieldExprDriver.H.

References parseDriver::size_.

◆ pointSize()

virtual label pointSize ( ) const
inlinevirtual

Reimplemented from exprDriver.

Definition at line 133 of file fieldExprDriver.H.

References parseDriver::size_.

◆ parse()

unsigned parse ( const std::string &  expr,
size_t  pos = 0,
size_t  len = std::string::npos 
)
virtual

Implements exprDriver.

Definition at line 84 of file fieldExprDriver.C.

References Foam::pos(), and scanner::process().

Referenced by Foam::stringOps::evaluate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setResult()

void setResult ( Field< Type > *  ptr,
bool  pointVal = false 
)
inline

Definition at line 158 of file fieldExprDriver.H.

References exprDriver::result(), and exprResult::setResult().

Here is the call graph for this function:

◆ getField()

tmp<Field<Type> > getField ( const word fieldName) const

◆ field_rand()

Foam::tmp< Foam::scalarField > field_rand ( label  seed = 0,
bool  gaussian = false 
) const

Definition at line 27 of file fieldExprDriverFields.C.

References Foam::New().

Referenced by parseDriver::field_randGaussian().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ field_randGaussian()

tmp<scalarField> field_randGaussian ( label  seed = 0) const
inline

Definition at line 177 of file fieldExprDriver.H.

References parseDriver::field_rand().

Here is the call graph for this function:

Member Data Documentation

◆ size_

label size_
protected

Definition at line 88 of file fieldExprDriver.H.

Referenced by parseDriver::pointSize(), and parseDriver::size().


The documentation for this class was generated from the following files: