functionObjectList Class Reference

List of function objects with start(), execute() and end() functions that is called for each object. More...

Inheritance diagram for functionObjectList:
Collaboration diagram for functionObjectList:

Public Member Functions

 functionObjectList (const Time &runTime, const bool execution=true)
 Construct from Time and the execution setting. More...
 
 functionObjectList (const Time &runTime, const dictionary &parentDict, const bool execution=true)
 Construct from Time, a dictionary with "functions" entry. More...
 
 functionObjectList (const functionObjectList &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~functionObjectList ()
 Destructor. More...
 
void clear ()
 Clear the list of function objects. More...
 
label findObjectID (const word &name) const
 Find the ID of a given function object by name. More...
 
bool read ()
 Read and set the function objects if their data have changed. More...
 
void on ()
 Switch the function objects on. More...
 
void off ()
 Switch the function objects off. More...
 
bool status () const
 Return the execution status (on/off) of the function objects. More...
 
bool start ()
 Called at the start of the time-loop. More...
 
bool execute ()
 Called at each ++ or += of the time-loop. More...
 
bool end ()
 Called when Time::run() determines that the time-loop exits. More...
 
scalar timeToNextWrite ()
 Return the time to the next write. More...
 
virtual void movePoints (const polyMesh &mesh)
 Update topology using the given map. More...
 
virtual void topoChange (const polyTopoChangeMap &map)
 Update topology using the given map. More...
 
virtual void mapMesh (const polyMeshMap &)
 Update from another mesh using the given map. More...
 
void operator= (const functionObjectList &)=delete
 Disallow default bitwise assignment. More...
 

Static Public Member Functions

static autoPtr< functionObjectListNew (const argList &args, const Time &runTime, dictionary &controlDict)
 Construct and return a functionObjectList for an application. More...
 
static wordList list ()
 Return the list of functionObject configuration files in. More...
 
static fileName findDict (const word &funcName, const word &region=word::null)
 Search for functionObject dictionary file for given region. More...
 
static bool readFunctionObject (const string &funcArgs, dictionary &functionsDict, const Pair< string > &contextTypeAndValue, const word &region=word::null)
 Read the specified functionObject configuration dictionary. More...
 

Static Public Attributes

static fileName functionObjectDictPath
 Default relative path to the directory structure. More...
 

Detailed Description

List of function objects with start(), execute() and end() functions that is called for each object.

See also
Foam::functionObject Foam::functionObjects::timeControl
Source files

Definition at line 62 of file functionObjectList.H.

Constructor & Destructor Documentation

◆ functionObjectList() [1/3]

functionObjectList ( const Time runTime,
const bool  execution = true 
)

Construct from Time and the execution setting.

The functionObject specifications are read from the controlDict

Definition at line 448 of file functionObjectList.C.

Referenced by functionObjectList::New(), and functionObjectList::readFunctionObject().

Here is the caller graph for this function:

◆ functionObjectList() [2/3]

functionObjectList ( const Time runTime,
const dictionary parentDict,
const bool  execution = true 
)

Construct from Time, a dictionary with "functions" entry.

and the execution setting.

Parameters
[in]t- the other Time instance to construct from
[in]parentDict- the parent dictionary containing a "functions" entry, which can either be a list or a dictionary of functionObject specifications.
[in]execution- whether the function objects should execute or not. Default: true.

Definition at line 464 of file functionObjectList.C.

References functionObjectList::New().

Here is the call graph for this function:

◆ functionObjectList() [3/3]

functionObjectList ( const functionObjectList )
delete

Disallow default bitwise copy construction.

◆ ~functionObjectList()

~functionObjectList ( )
virtual

Destructor.

Definition at line 569 of file functionObjectList.C.

Member Function Documentation

◆ New()

Foam::autoPtr< Foam::functionObjectList > New ( const argList args,
const Time runTime,
dictionary controlDict 
)
static

Construct and return a functionObjectList for an application.

If the "dict" argument is specified the functionObjectList is constructed from that dictionary which is returned as controlDict otherwise the functionObjectList is constructed from the "functions" sub-dictionary of "system/controlDict"

Definition at line 481 of file functionObjectList.C.

References dictionary::add(), argList::commandLine(), forAll, functionObjectList::functionObjectList(), dictionary::merge(), IOobject::MUST_READ_IF_MODIFIED, word::null, dictionary::null, argList::optionFound(), argList::optionLookup(), functionObjectList::readFunctionObject(), autoPtr< T >::reset(), and dictionary::subDict().

Referenced by functionObjectList::functionObjectList().

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

◆ clear()

void clear ( )

Clear the list of function objects.

Definition at line 575 of file functionObjectList.C.

References PtrList< T >::clear().

Here is the call graph for this function:

◆ findObjectID()

Foam::label findObjectID ( const word name) const

Find the ID of a given function object by name.

Definition at line 584 of file functionObjectList.C.

References forAll, and Foam::name().

Here is the call graph for this function:

◆ list()

Foam::wordList list ( )
static

Return the list of functionObject configuration files in.

user/group/shipped directories. The search scheme allows for version-specific and version-independent files using the following hierarchy:

  • user settings:
    • ~/.OpenFOAM/<VERSION>/caseDicts/postProcessing
    • ~/.OpenFOAM/caseDicts/postProcessing
  • group (site) settings (when $WM_PROJECT_SITE is set):
    • $WM_PROJECT_SITE/<VERSION>/etc/caseDicts/postProcessing
    • $WM_PROJECT_SITE/etc/caseDicts/postProcessing
  • group (site) settings (when $WM_PROJECT_SITE is not set):
    • $WM_PROJECT_INST_DIR/site/<VERSION>/etc/ caseDicts/postProcessing
    • $WM_PROJECT_INST_DIR/site/etc/caseDicts/postProcessing
  • other (shipped) settings:
    • $WM_PROJECT_DIR/etc/caseDicts/postProcessing

Definition at line 102 of file functionObjectList.C.

References functionObjectList::findDict(), Foam::findEtcDirs(), forAll, functionObjectList::functionObjectDictPath, and HashTable< nil, Key, Hash >::sortedToc().

Referenced by functionObjectList::readFunctionObject().

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

◆ findDict()

Foam::fileName findDict ( const word funcName,
const word region = word::null 
)
static

Search for functionObject dictionary file for given region.

and if not present also search the case directory as well as the user/group/shipped directories. The search scheme allows for version-specific and version-independent files using the following hierarchy:

  • user settings:
    • ~/.OpenFOAM/<VERSION>/caseDicts/postProcessing
    • ~/.OpenFOAM/caseDicts/postProcessing
  • group (site) settings (when $WM_PROJECT_SITE is set):
    • $WM_PROJECT_SITE/<VERSION>/etc/caseDicts/postProcessing
    • $WM_PROJECT_SITE/etc/caseDicts/postProcessing
  • group (site) settings (when $WM_PROJECT_SITE is not set):
    • $WM_PROJECT_INST_DIR/site/<VERSION>/etc/ caseDicts/postProcessing
    • $WM_PROJECT_INST_DIR/site/etc/caseDicts/postProcessing
  • other (shipped) settings:
    • $WM_PROJECT_DIR/etc/caseDicts/postProcessing
Returns
The path of the functionObject dictionary file if found otherwise null

Definition at line 118 of file functionObjectList.C.

References List< T >::append(), wordRe::compile(), dict, Foam::stringOps::expand(), Foam::findEtcDirs(), UPtrList< T >::first(), forAll, forAllConstIter, functionObjectList::functionObjectDictPath, Foam::isFile(), wordRe::match(), word::null, fileName::null, functionObjectList::readFunctionObject(), Foam::search(), Foam::second(), and OStringStream::str().

Referenced by functionObjectList::list(), and functionObjectList::readFunctionObject().

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

◆ readFunctionObject()

bool readFunctionObject ( const string funcArgs,
dictionary functionsDict,
const Pair< string > &  contextTypeAndValue,
const word region = word::null 
)
static

Read the specified functionObject configuration dictionary.

parsing the optional arguments included in the string 'funcArgs', inserting 'field' or 'fields' entries as required and merging the resulting functionObject dictionary into 'functionsDict'.

Parses the optional functionObject arguments: 'Q(U)' -> funcName = Q; args = (U) -> field U;

Supports named arguments: 'patchAverage(patch=inlet, p,U)' or 'patchAverage(patch=inlet, field=(p U))' -> funcName = patchAverage; args = (patch=inlet, p,U) -> patch inlet; fields (p U);

Definition at line 232 of file functionObjectList.C.

References dictionary::add(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), args, Foam::dictAndKeyword(), Foam::dictArgList(), entry::disableFunctionEntries, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, Foam::fileHandler(), functionObjectList::findDict(), Pair< Type >::first(), UPtrList< T >::first(), forAll, dictionary::found(), functionObjectList::functionObjectList(), dictionary::isDict(), functionObjectList::list(), dictionary::lookupOrDefault(), dictionary::merge(), dictionaryName::name(), entry::New(), Foam::nl, word::null, fileName::null, dictionary::null, dictionary::scopedDict(), Foam::second(), Pair< Type >::second(), dictionary::set(), List< T >::size(), OStringStream::str(), dictionary::subDict(), and dictionary::write().

Referenced by includeFuncEntry::execute(), functionObjectList::findDict(), and functionObjectList::New().

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

◆ read()

◆ on()

void on ( )

Switch the function objects on.

Definition at line 598 of file functionObjectList.C.

◆ off()

void off ( )

Switch the function objects off.

Definition at line 604 of file functionObjectList.C.

◆ status()

bool status ( ) const

Return the execution status (on/off) of the function objects.

Definition at line 611 of file functionObjectList.C.

◆ start()

bool start ( )

Called at the start of the time-loop.

Definition at line 617 of file functionObjectList.C.

References forAll, UPtrList< T >::operator[](), and functionObjectList::read().

Here is the call graph for this function:

◆ execute()

bool execute ( )

Called at each ++ or += of the time-loop.

postProcess overrides the usual executeControl behaviour and forces execution (used in post-processing mode)

Definition at line 637 of file functionObjectList.C.

References forAll, UPtrList< T >::operator[](), and functionObjectList::read().

Here is the call graph for this function:

◆ end()

bool end ( )

Called when Time::run() determines that the time-loop exits.

Definition at line 659 of file functionObjectList.C.

References forAll, UPtrList< T >::operator[](), and functionObjectList::read().

Here is the call graph for this function:

◆ timeToNextWrite()

Foam::scalar timeToNextWrite ( )

Return the time to the next write.

Definition at line 680 of file functionObjectList.C.

References forAll, Foam::min(), and functionObjectList::read().

Here is the call graph for this function:

◆ movePoints()

void movePoints ( const polyMesh mesh)
virtual

Update topology using the given map.

Definition at line 847 of file functionObjectList.C.

References forAll, and UPtrList< T >::operator[]().

Here is the call graph for this function:

◆ topoChange()

void topoChange ( const polyTopoChangeMap map)
virtual

Update topology using the given map.

Definition at line 859 of file functionObjectList.C.

References forAll, and UPtrList< T >::operator[]().

Here is the call graph for this function:

◆ mapMesh()

void mapMesh ( const polyMeshMap map)
virtual

Update from another mesh using the given map.

Definition at line 871 of file functionObjectList.C.

References forAll, and UPtrList< T >::operator[]().

Here is the call graph for this function:

◆ operator=()

void operator= ( const functionObjectList )
delete

Disallow default bitwise assignment.

Member Data Documentation

◆ functionObjectDictPath

Foam::fileName functionObjectDictPath
static

Default relative path to the directory structure.

containing the functionObject dictionary files

Definition at line 112 of file functionObjectList.H.

Referenced by functionObjectList::findDict(), and functionObjectList::list().


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