Loading...
Searching...
No Matches
functionObjectValue Class Reference

functionObjectValue substitution model. More...

#include <functionObjectValue.H>

Inheritance diagram for functionObjectValue:
Collaboration diagram for functionObjectValue:

Public Member Functions

 TypeName ("functionObjectValue")
 Runtime type information.
 functionObjectValue (const dictionary &dict, const Time &time)
 Constructor.
virtual ~functionObjectValue ()=default
 Destructor.
virtual bool update ()
 Update model local data.
virtual bool valid (const word &keyName) const
 Return true of model applies to this keyName.
virtual bool apply (const word &key, string &buffer) const
 Apply substitutions to this string buffer.
virtual wordList keys () const
 Return a word list of the keys.
Public Member Functions inherited from substitutionModel
 TypeName ("substitutionModel")
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, substitutionModel, dictionary,(const dictionary &dict, const Time &time),(dict, time))
 substitutionModel (const dictionary &dict, const Time &time)
 Constructor.
virtual ~substitutionModel ()=default
 Destructor.

Additional Inherited Members

Static Public Member Functions inherited from substitutionModel
static string keyify (const word &w)
 Return a key representation from a word.
static word cleanKey (const string &str)
 Clean the key text.
static wordList getKeys (string &buffer)
 Return all keys from a string buffer.
static void addBuiltinStr (const word &key, const string &value)
 Add a builtin to the hash table - does not overwrite.
template<class Type>
static void addBuiltin (const word &key, const Type &value)
 Add a builtin to the hash table - does not overwrite.
static bool containsBuiltin (const word &key)
 Return true if key is builtin.
static void setBuiltinStr (const word &key, const string &value)
 Set a builtin to the hash table.
template<class Type>
static void setBuiltin (const word &key, const Type &value)
 Set a builtin to the hash table.
static bool replaceBuiltin (const word &key, string &str)
 Replace key in string.
static bool replaceBuiltin (string &str)
 Replace all occurrences of key in string.
static void writeBuiltins (Ostream &os)
 Write all builtins to stream.
static autoPtr< substitutionModel > New (const dictionary &dict, const Time &time)
 Return a reference to the selected substitution model.
Static Public Attributes inherited from substitutionModel
static const word KEY_BEGIN = "{{"
 Keyword starting characters.
static const word KEY_END = "}}"
 Keyword ending characters.
static HashTable< stringbuiltin_
 Built-in substitutions.
Protected Attributes inherited from substitutionModel
const dictionary dict_
 Construction dictionary.
const Timetime_
 Reference to the time database.

Detailed Description

functionObjectValue substitution model.

Usage
The functionObjectValue substitution model.

The example below shows how the keywords cont_error_* are set by retrieving the values local, global, cumulative from the function object functionObjectValue.

functionObjectValue1
{
    // Mandatory entries
    type        functionObjectValue;
    functionObject continuityError1;

    entries
    {
        cont_error_local    local;
        cont_error_global   global;
        cont_error_cumulative cumulative;
    }

    // Optional entries
    debugValues   <bool>;

    // Inherited entries
    ...
}

The entries mean:

Property Description Type Reqd Deflt
type Type name: functionObjectValue word yes -
functionObject Name of function object to query word yes -
entries Keyword-lookup pairs dictionary yes -
debugValues Flag to show available function values bool no false

The inherited entries are elaborated in:

Source files

Definition at line 120 of file functionObjectValue.H.

Constructor & Destructor Documentation

◆ functionObjectValue()

functionObjectValue ( const dictionary & dict,
const Time & time )

Constructor.

Definition at line 65 of file functionObjectValue.C.

References substitutionModel::cleanKey(), dict, and e.

Here is the call graph for this function:

◆ ~functionObjectValue()

virtual ~functionObjectValue ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "functionObjectValue" )

Runtime type information.

References dict.

◆ update()

bool update ( )
virtual

Update model local data.

Reimplemented from substitutionModel.

Definition at line 87 of file functionObjectValue.C.

References Foam::Info, Foam::nl, and substitutionModel::time_.

◆ valid()

bool valid ( const word & keyName) const
virtual

Return true of model applies to this keyName.

Implements substitutionModel.

Definition at line 99 of file functionObjectValue.C.

Referenced by apply().

Here is the caller graph for this function:

◆ apply()

bool apply ( const word & key,
string & buffer ) const
virtual

Apply substitutions to this string buffer.

Implements substitutionModel.

Definition at line 108 of file functionObjectValue.C.

References substitutionModel::keyify(), string::replaceAll(), OStringStream::str(), and valid().

Here is the call graph for this function:

◆ keys()

Foam::wordList keys ( ) const
virtual

Return a word list of the keys.

Implements substitutionModel.

Definition at line 136 of file functionObjectValue.C.


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