Driver for generic primitive field expressions. More...
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< scalarField > | field_rand (label seed=0, bool gaussian=false) const |
tmp< scalarField > | field_randGaussian (label seed=0) const |
![]() | |
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 () |
Ostream & | printBuffer (Ostream &os) const |
void | reportFatal (const std::string &msg) const |
void | reportFatal (const std::string &msg, size_t pos) const |
![]() | |
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 TimeState * | timeState () const noexcept |
virtual scalar | timeValue () const |
virtual scalar | deltaT () const |
const dictionary & | dict () const noexcept |
const exprResult & | result () const noexcept |
exprResult & | result () noexcept |
void | clearResult () |
template<class Type > | |
tmp< Field< Type > > | getResult (bool wantPointData=false) |
const word & | getResultType () 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 exprResult & | variable (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 regIOobject * | cfindContextIOobject (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 contextObjectTableType & | contextObjects () const noexcept |
contextObjectTableType & | contextObjects () 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) |
Ostream & | writeVariableStrings (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_ |
![]() | |
std::reference_wrapper< const std::string > | content_ |
size_t | start_ |
size_t | length_ |
size_t | position_ |
![]() | |
const dictionary & | dict_ |
exprResult | result_ |
List< expressions::exprString > | variableStrings_ |
HashTable< exprResult > | variables_ |
HashTable< refPtr< Function1< scalar > > > | scalarFuncs_ |
HashTable< refPtr< Function1< vector > > > | vectorFuncs_ |
contextObjectTableType | contextObjects_ |
scalar | arg1Value_ |
const TimeState * | timeStatePtr_ |
const objectRegistry * | obrPtr_ |
int | stashedTokenId_ |
bool | debugScanner_ |
bool | debugParser_ |
bool | allowShadowing_ |
bool | prevIterIsOldTime_ |
searchControls | searchCtrl_ |
Additional Inherited Members | |
![]() | |
typedef size_t | location_type |
![]() | |
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 expressions::exprString | readExpression (const word &name, const dictionary &dict) |
static List< expressions::exprString > | readVariableStrings (const dictionary &dict, const word &name="variables", bool mandatory=false) |
![]() | |
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 exprResult & | variable (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 |
![]() | |
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) |
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 |
fieldExpr
for scanner (2), parser (4)Definition at line 78 of file fieldExprDriver.H.
|
delete |
|
explicit |
Definition at line 46 of file fieldExprDriver.C.
parseDriver | ( | const label | len, |
const dictionary & | dict | ||
) |
Definition at line 57 of file fieldExprDriver.C.
parseDriver | ( | const label | len, |
const parseDriver & | rhs, | ||
const dictionary & | dict | ||
) |
Definition at line 69 of file fieldExprDriver.C.
|
virtualdefault |
ClassName | ( | "fieldExpr::driver" | ) |
|
delete |
|
inlinevirtual |
Reimplemented from exprDriver.
Definition at line 127 of file fieldExprDriver.H.
References parseDriver::size_.
|
inlinevirtual |
Reimplemented from exprDriver.
Definition at line 133 of file fieldExprDriver.H.
References parseDriver::size_.
|
virtual |
Implements exprDriver.
Definition at line 84 of file fieldExprDriver.C.
References Foam::pos(), and scanner::process().
Referenced by Foam::stringOps::evaluate().
Definition at line 158 of file fieldExprDriver.H.
References exprDriver::result(), and exprResult::setResult().
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().
|
inline |
Definition at line 177 of file fieldExprDriver.H.
References parseDriver::field_rand().
|
protected |
Definition at line 88 of file fieldExprDriver.H.
Referenced by parseDriver::pointSize(), and parseDriver::size().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.