Public Member Functions | Private Member Functions | Private Attributes
functionObjectList Class Reference

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

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

Public Member Functions

 functionObjectList (const Time &, const bool execution=true)
 Construct from Time and the execution setting. More...
 
 functionObjectList (const Time &, const dictionary &parentDict, const bool execution=true)
 Construct from Time, a dictionary with "functions" entry. More...
 
virtual ~functionObjectList ()
 Destructor. More...
 
IOdictionarystateDict ()
 Return the state dictionary. More...
 
const IOdictionarystateDict () const
 Return const access to the state dictionary. More...
 
virtual void clear ()
 Clear the list of function objects. More...
 
virtual label findObjectID (const word &name) const
 Find the ID of a given function object by name. More...
 
virtual void on ()
 Switch the function objects on. More...
 
virtual void off ()
 Switch the function objects off. More...
 
virtual bool status () const
 Return the execution status (on/off) of the function objects. More...
 
virtual bool start ()
 Called at the start of the time-loop. More...
 
virtual bool execute (const bool forceWrite=false)
 Called at each ++ or += of the time-loop. forceWrite overrides. More...
 
virtual bool end ()
 Called when Time::run() determines that the time-loop exits. More...
 
virtual bool timeSet ()
 Called when time was set at the end of the Time::operator++. More...
 
virtual bool adjustTimeStep ()
 Called at the end of Time::adjustDeltaT() if adjustTime is true. More...
 
virtual bool read ()
 Read and set the function objects if their data have changed. More...
 
virtual void updateMesh (const mapPolyMesh &mpm)
 Update for changes of mesh. More...
 
virtual void movePoints (const polyMesh &mesh)
 Update for changes of mesh. More...
 

Private Member Functions

void createStateDict () const
 Create state dictionary. More...
 
functionObjectremove (const word &, label &oldIndex)
 Remove and return the function object pointer by name,. More...
 
 functionObjectList (const functionObjectList &)
 Disallow default bitwise copy construct. More...
 
void operator= (const functionObjectList &)
 Disallow default bitwise assignment. More...
 
- Private Member Functions inherited from PtrList< functionObject >
 PtrList ()
 Null Constructor. More...
 
 PtrList (const label)
 Construct with size specified. More...
 
 PtrList (const PtrList< T > &)
 Copy constructor. More...
 
 PtrList (const PtrList< T > &, const CloneArg &)
 Copy constructor with additional argument for clone. More...
 
 PtrList (const Xfer< PtrList< T > > &)
 Construct by transferring the parameter contents. More...
 
 PtrList (PtrList< T > &, bool reUse)
 Construct as copy or re-use as specified. More...
 
 PtrList (const SLPtrList< T > &)
 Construct as copy of SLPtrList<T> More...
 
 PtrList (Istream &, const INew &)
 Construct from Istream using given Istream constructor class. More...
 
 PtrList (Istream &)
 Construct from Istream using default Istream constructor class. More...
 
 PtrList ()
 
 PtrList (const label s)
 
 PtrList (const PtrList< T > &a)
 
 PtrList (const Xfer< PtrList< T > > &lst)
 
 PtrList (PtrList< T > &a, bool reUse)
 
 PtrList (const SLPtrList< T > &sll)
 
 PtrList (Istream &is)
 
 ~PtrList ()
 Destructor. More...
 
label size () const
 Return the number of elements in the PtrList. More...
 
bool empty () const
 Return true if the PtrList is empty (ie, size() is zero). More...
 
Tfirst ()
 Return reference to the first element of the list. More...
 
const Tfirst () const
 Return reference to first element of the list. More...
 
Tlast ()
 Return reference to the last element of the list. More...
 
const Tlast () const
 Return reference to the last element of the list. More...
 
void setSize (const label)
 Reset size of PtrList. If extending the PtrList, new entries are. More...
 
void resize (const label)
 Alias for setSize(const label) More...
 
void clear ()
 Clear the PtrList, i.e. set size to zero deleting all the. More...
 
void append (T *)
 Append an element at the end of the list. More...
 
void append (const autoPtr< T > &)
 
void append (const tmp< T > &)
 
void transfer (PtrList< T > &)
 Transfer the contents of the argument PtrList into this PtrList. More...
 
Xfer< PtrList< T > > xfer ()
 Transfer contents to the Xfer container. More...
 
bool set (const label) const
 Is element set. More...
 
autoPtr< Tset (const label, T *)
 Set element. Return old element (can be NULL). More...
 
autoPtr< Tset (const label, const autoPtr< T > &)
 
autoPtr< Tset (const label, const tmp< T > &)
 
void reorder (const labelUList &)
 Reorders elements. Ordering does not have to be done in. More...
 
const Toperator[] (const label) const
 Return element const reference. More...
 
Toperator[] (const label)
 Return element reference. More...
 
const Toperator() (const label) const
 Return element const pointer. More...
 
PtrList< T > & operator= (const PtrList< T > &)
 Assignment. More...
 
iterator begin ()
 Return an iterator to begin traversing the PtrList. More...
 
const_iterator begin () const
 Return an const_iterator to begin traversing the PtrList. More...
 
iterator end ()
 Return an iterator to end traversing the PtrList. More...
 
const_iterator end () const
 Return an const_iterator to end traversing the PtrList. More...
 
const_iterator cbegin () const
 Return an const_iterator to begin traversing the PtrList. More...
 
const_iterator cend () const
 Return an const_iterator to end traversing the PtrList. More...
 
void read (Istream &, const INew &inewt)
 Read from Istream using given Istream constructor class. More...
 

Private Attributes

List< SHA1Digestdigests_
 A list of SHA1 digests for the function object dictionaries. More...
 
HashTable< labelindices_
 Quick lookup of the index into functions/digests. More...
 
const Timetime_
 
const dictionaryparentDict_
 The parent dictionary containing a "functions" entry. More...
 
autoPtr< IOdictionarystateDictPtr_
 Function object properties - stores state information. More...
 
bool execution_
 Switch for the execution of the functionObjects. More...
 
bool updated_
 Tracks if read() was called while execution is on. More...
 
- Private Attributes inherited from PtrList< functionObject >
const typedef Tconst_reference
 Type that can be used for storing into constant PtrList::value_type. More...
 

Additional Inherited Members

- Private Types inherited from PtrList< functionObject >
typedef T value_type
 Type of values the PtrList contains. More...
 
typedef Treference
 Type that can be used for storing into PtrList::value_type objects. More...
 

Detailed Description

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

See also
Foam::functionObject and Foam::OutputFilterFunctionObject
Source files

Definition at line 58 of file functionObjectList.H.

Constructor & Destructor Documentation

◆ functionObjectList() [1/3]

functionObjectList ( const functionObjectList )
private

Disallow default bitwise copy construct.

◆ functionObjectList() [2/3]

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

Construct from Time and the execution setting.

The functionObject specifications are read from the controlDict

Definition at line 85 of file functionObjectList.C.

◆ functionObjectList() [3/3]

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

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

and the execution setting.

Parameters
[in]parentDict- the parent dictionary containing a "functions" entry, which can either be a list or a dictionary of functionObject specifications.

Definition at line 102 of file functionObjectList.C.

◆ ~functionObjectList()

~functionObjectList ( )
virtual

Destructor.

Definition at line 121 of file functionObjectList.C.

Member Function Documentation

◆ createStateDict()

void createStateDict ( ) const
private

Create state dictionary.

Definition at line 32 of file functionObjectList.C.

References IOobject::NO_WRITE, IOobject::READ_IF_PRESENT, functionObjectList::stateDictPtr_, functionObjectList::time_, and Time::timeName().

Here is the call graph for this function:

◆ remove()

Foam::functionObject * remove ( const word key,
label oldIndex 
)
private

Remove and return the function object pointer by name,.

and returns the old index via the parameter. Returns a NULL pointer (and index -1) if it didn't exist.

Definition at line 55 of file functionObjectList.C.

References HashTable::find().

Here is the call graph for this function:

◆ operator=()

void operator= ( const functionObjectList )
private

Disallow default bitwise assignment.

◆ stateDict() [1/2]

const Foam::IOdictionary & stateDict ( )

Return the state dictionary.

Definition at line 127 of file functionObjectList.C.

◆ stateDict() [2/2]

const IOdictionary& stateDict ( ) const

Return const access to the state dictionary.

◆ clear()

void clear ( )
virtual

Clear the list of function objects.

Definition at line 149 of file functionObjectList.C.

References PtrList::clear().

Here is the call graph for this function:

◆ findObjectID()

Foam::label findObjectID ( const word name) const
virtual

Find the ID of a given function object by name.

Definition at line 158 of file functionObjectList.C.

References forAll, and Foam::name().

Here is the call graph for this function:

◆ on()

void on ( )
virtual

Switch the function objects on.

Definition at line 172 of file functionObjectList.C.

◆ off()

void off ( )
virtual

Switch the function objects off.

Definition at line 178 of file functionObjectList.C.

Referenced by main().

Here is the caller graph for this function:

◆ status()

bool status ( ) const
virtual

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

Definition at line 185 of file functionObjectList.C.

◆ start()

bool start ( )
virtual

Called at the start of the time-loop.

Definition at line 191 of file functionObjectList.C.

References Foam::read().

Here is the call graph for this function:

◆ execute()

bool execute ( const bool  forceWrite = false)
virtual

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

the usual outputControl behaviour and forces writing always (used in postprocessing mode)

Definition at line 197 of file functionObjectList.C.

References IOstream::ASCII, IOstream::currentVersion, forAll, IOstream::precision_, and Foam::read().

Here is the call graph for this function:

◆ end()

bool end ( )
virtual

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

Definition at line 234 of file functionObjectList.C.

References forAll, and Foam::read().

Here is the call graph for this function:

◆ timeSet()

bool timeSet ( )
virtual

Called when time was set at the end of the Time::operator++.

Definition at line 255 of file functionObjectList.C.

References forAll, and Foam::read().

Here is the call graph for this function:

◆ adjustTimeStep()

bool adjustTimeStep ( )
virtual

Called at the end of Time::adjustDeltaT() if adjustTime is true.

Definition at line 276 of file functionObjectList.C.

References forAll, and Foam::read().

Referenced by Time::adjustDeltaT().

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

◆ read()

bool read ( )
virtual

◆ updateMesh()

void updateMesh ( const mapPolyMesh mpm)
virtual

Update for changes of mesh.

Definition at line 435 of file functionObjectList.C.

References forAll.

◆ movePoints()

void movePoints ( const polyMesh mesh)
virtual

Update for changes of mesh.

Definition at line 447 of file functionObjectList.C.

References forAll, and mesh.

Field Documentation

◆ digests_

List<SHA1Digest> digests_
private

A list of SHA1 digests for the function object dictionaries.

Definition at line 65 of file functionObjectList.H.

◆ indices_

HashTable<label> indices_
private

Quick lookup of the index into functions/digests.

Definition at line 68 of file functionObjectList.H.

◆ time_

const Time& time_
private

Definition at line 70 of file functionObjectList.H.

Referenced by functionObjectList::createStateDict().

◆ parentDict_

const dictionary& parentDict_
private

The parent dictionary containing a "functions" entry.

This entry can either be a list or a dictionary of functionObject specifications.

Definition at line 75 of file functionObjectList.H.

◆ stateDictPtr_

autoPtr<IOdictionary> stateDictPtr_
mutableprivate

Function object properties - stores state information.

Definition at line 78 of file functionObjectList.H.

Referenced by functionObjectList::createStateDict().

◆ execution_

bool execution_
private

Switch for the execution of the functionObjects.

Definition at line 81 of file functionObjectList.H.

◆ updated_

bool updated_
private

Tracks if read() was called while execution is on.

Definition at line 84 of file functionObjectList.H.


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