Loading...
Searching...
No Matches
Foam::exprTools Namespace Reference

Helper methods for creating expressions. More...

Classes

class  expressionEntry
 Convert dictionary entry to a stringified expression. More...
class  boolEntry
 Expression representation of a bool : (false/true). More...
struct  dimensionedScalarEntry
 Create an expression string from a dimensionedScalar as its value. More...
struct  dimensionedVectorEntry
 Create an expression string from a dimensionedVector as its value. More...
struct  dimensionedTensorEntry
 Create an expression string from a dimensionedTensor as its value. More...
struct  dimensionedSymmTensorEntry
 Create an expression string from a dimensionedSymmTensor as its value. More...
struct  dimensionedSphericalTensorEntry
 Create an expression string from a dimensionedSphericalTensor as its value. More...
class  stringEntry
 Creates an expression from a string (removing surrounding quotes). More...
struct  vectorEntry
 Create an expression string from a vector. More...
struct  tensorEntry
 Create an expression string from a tensor. More...
struct  symmTensorEntry
 Create an expression string from a symmTensor. More...
struct  sphericalTensorEntry
 Create an expression string from a sphericalTensor. More...

Functions

 defineTypeName (expressionEntry)
 defineRunTimeSelectionTable (expressionEntry, empty)
 addNamedToRunTimeSelectionTable (expressionEntry, expressionEntry, empty, direct)
 addNamedToRunTimeSelectionTable (expressionEntry, expressionEntry, empty, label)
 addNamedToRunTimeSelectionTable (expressionEntry, expressionEntry, empty, scalar)
 addNamedToRunTimeSelectionTable (expressionEntry, expressionEntry, empty, word)
 addNamedToRunTimeSelectionTable (expressionEntry, boolEntry, empty, bool)
 addNamedToRunTimeSelectionTable (expressionEntry, dimensionedScalarEntry, empty, dimensionedScalar)
 addNamedToRunTimeSelectionTable (expressionEntry, dimensionedVectorEntry, empty, dimensionedVector)
 addNamedToRunTimeSelectionTable (expressionEntry, dimensionedTensorEntry, empty, dimensionedTensor)
 addNamedToRunTimeSelectionTable (expressionEntry, dimensionedSymmTensorEntry, empty, dimensionedSymmTensor)
 addNamedToRunTimeSelectionTable (expressionEntry, dimensionedSphericalTensorEntry, empty, dimensionedSphericalTensor)
 addNamedToRunTimeSelectionTable (expressionEntry, stringEntry, empty, string)
 addNamedToRunTimeSelectionTable (expressionEntry, stringEntry, empty, fileName)
 addNamedToRunTimeSelectionTable (expressionEntry, vectorEntry, empty, vector)
 addNamedToRunTimeSelectionTable (expressionEntry, tensorEntry, empty, tensor)
 addNamedToRunTimeSelectionTable (expressionEntry, symmTensorEntry, empty, symmTensor)
 addNamedToRunTimeSelectionTable (expressionEntry, sphericalTensorEntry, empty, sphericalTensor)
template<class Type>
string zeroValue ()
 Stringified value for zero of given type.
template<class Type>
string toString (const Type &data, const word &prefix)
 Stringified version of data with comma separators between components.
template<class Type>
string toString (const Type &data)
 Stringified version of data with comma separators between components. Uses prefix corresponding to the pTraits of Type.
template<class Type>
string toString (ITstream &is)
 Stringified version of primitiveEntry of Type. Uses comma separators and prefix corresponding to the pTraits of Type.
List< expressions::exprStringgetList (const word &keyword, const dictionary &dict, bool mandatory=true, label recursionDepth=0)
 Get an expression string list from a dictionary.

Detailed Description

Helper methods for creating expressions.

Source files

Function Documentation

◆ defineTypeName()

defineTypeName ( expressionEntry )

◆ defineRunTimeSelectionTable()

defineRunTimeSelectionTable ( expressionEntry ,
empty  )

◆ addNamedToRunTimeSelectionTable() [1/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
expressionEntry ,
empty ,
direct  )

◆ addNamedToRunTimeSelectionTable() [2/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
expressionEntry ,
empty ,
label  )

◆ addNamedToRunTimeSelectionTable() [3/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
expressionEntry ,
empty ,
scalar  )

◆ addNamedToRunTimeSelectionTable() [4/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
expressionEntry ,
empty ,
word  )

◆ addNamedToRunTimeSelectionTable() [5/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
boolEntry ,
empty ,
bool  )

◆ addNamedToRunTimeSelectionTable() [6/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
dimensionedScalarEntry ,
empty ,
dimensionedScalar  )

◆ addNamedToRunTimeSelectionTable() [7/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
dimensionedVectorEntry ,
empty ,
dimensionedVector  )

◆ addNamedToRunTimeSelectionTable() [8/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
dimensionedTensorEntry ,
empty ,
dimensionedTensor  )

◆ addNamedToRunTimeSelectionTable() [9/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
dimensionedSymmTensorEntry ,
empty ,
dimensionedSymmTensor  )

◆ addNamedToRunTimeSelectionTable() [10/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
dimensionedSphericalTensorEntry ,
empty ,
dimensionedSphericalTensor  )

◆ addNamedToRunTimeSelectionTable() [11/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
stringEntry ,
empty ,
string  )

◆ addNamedToRunTimeSelectionTable() [12/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
stringEntry ,
empty ,
fileName  )

◆ addNamedToRunTimeSelectionTable() [13/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
vectorEntry ,
empty ,
vector  )

◆ addNamedToRunTimeSelectionTable() [14/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
tensorEntry ,
empty ,
tensor  )

◆ addNamedToRunTimeSelectionTable() [15/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
symmTensorEntry ,
empty ,
symmTensor  )

◆ addNamedToRunTimeSelectionTable() [16/16]

addNamedToRunTimeSelectionTable ( expressionEntry ,
sphericalTensorEntry ,
empty ,
sphericalTensor  )

◆ zeroValue()

template<class Type>
string zeroValue ( )

Stringified value for zero of given type.

◆ toString() [1/3]

template<class Type>
string toString ( const Type & data,
const word & prefix )

Stringified version of data with comma separators between components.

◆ toString() [2/3]

template<class Type>
string toString ( const Type & data)

Stringified version of data with comma separators between components. Uses prefix corresponding to the pTraits of Type.

◆ toString() [3/3]

template<class Type>
string toString ( ITstream & is)

Stringified version of primitiveEntry of Type. Uses comma separators and prefix corresponding to the pTraits of Type.

References dict.

◆ getList()

Foam::List< Foam::expressions::exprString > getList ( const word & keyword,
const dictionary & dict,
bool mandatory = true,
label recursionDepth = 0 )

Get an expression string list from a dictionary.

Supports list and inline specifications, as well as indirect inclusion of other expression string lists.

Syntax examples,

// Single items. Inline or list format.
list1a "var1=p";
list1b ( "var1=p" );
// Multiple items. Inline or list format.
list2a "var2=T; var3=U; var4=rho";
list2b ( "var2=T" "var3=U; var4=rho" );
// Indirection. Inline or list format.
list3a "#list1a; #list2b";
list2b ( "var1=p" "#list2a" );

Definition at line 115 of file exprTools.C.

References token::BEGIN_LIST, dict, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, token::isLabel(), token::isPunctuation(), token::isString(), keyType::LITERAL_RECURSIVE, Foam::nl, List< T >::resize(), ITstream::rewind(), entry::stream(), and token::stringToken().

Referenced by exprDriver::readVariableStrings().

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