Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Static Private Attributes
functionObjectState Class Reference

Base class for function objects, adding functionality to read/write state information (data required for smooth restart behaviour) and results to/from the state dictionary. More...

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

Public Member Functions

 functionObjectState (const objectRegistry &obr, const word &name)
 Construct from components. More...
 
virtual ~functionObjectState ()
 Destructor. More...
 
const wordname () const
 Return the name. More...
 
bool active () const
 Return the active flag. More...
 
const IOdictionarystateDict () const
 Return access to the state dictionary. More...
 
dictionarypropertyDict ()
 Return access to the property dictionary. More...
 
template<class Type >
bool setActive ()
 Set the active status by querying objectRegistry type. More...
 
bool foundProperty (const word &entryName) const
 Return true if the property exists. More...
 
template<class Type >
Type getProperty (const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve generic property. More...
 
template<class Type >
void getProperty (const word &entryName, Type &value) const
 Retrieve generic property. More...
 
template<class Type >
void setProperty (const word &entryName, const Type &value)
 Add generic property. More...
 
template<class Type >
Type getObjectProperty (const word &objectName, const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve generic property from named object. More...
 
template<class Type >
void getObjectProperty (const word &objectName, const word &entryName, Type &value) const
 Retrieve generic property from named object. More...
 
template<class Type >
void setObjectProperty (const word &objectName, const word &entryName, const Type &value)
 Add generic property from named object. More...
 
template<class Type >
void setResult (const word &entryName, const Type &value)
 Add result. More...
 
template<class Type >
void setObjectResult (const word &objectName, const word &entryName, const Type &value)
 Add result from named object. More...
 
template<class Type >
Type getResult (const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve result. More...
 
template<class Type >
Type getObjectResult (const word &objectName, const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve result from named object. More...
 
template<class Type >
void getObjectResult (const word &objectName, const word &entryName, Type &value) const
 Retrieve result from named object. More...
 
word resultType (const word &entryName) const
 Retrieve the result type. More...
 
word objectResultType (const word &objectName, const word &entryName) const
 Return the type of result. More...
 
List< wordobjectResultEntries () const
 Retrieve the result entries. More...
 
List< wordobjectResultEntries (const word &objectName) const
 Return result entries for named object. More...
 

Protected Member Functions

 functionObjectState (const functionObjectState &)
 Disallow default bitwise copy construct. More...
 
void operator= (const functionObjectState &)
 Disallow default bitwise assignment. More...
 

Protected Attributes

const word name_
 Name of model. More...
 
bool active_
 Flag to indicate whether the object is active. More...
 
IOdictionarystateDict_
 Reference to the state dictionary. More...
 

Private Attributes

const objectRegistryobr_
 Reference to the database. More...
 

Static Private Attributes

static const word resultsName_ = "results"
 Name of the results dictionary. More...
 

Detailed Description

Base class for function objects, adding functionality to read/write state information (data required for smooth restart behaviour) and results to/from the state dictionary.

See also
Foam::functionObject
Source files

Definition at line 54 of file functionObjectState.H.

Constructor & Destructor Documentation

◆ functionObjectState() [1/2]

functionObjectState ( const functionObjectState )
protected

Disallow default bitwise copy construct.

◆ functionObjectState() [2/2]

functionObjectState ( const objectRegistry obr,
const word name 
)

Construct from components.

Definition at line 35 of file functionObjectState.C.

◆ ~functionObjectState()

~functionObjectState ( )
virtual

Destructor.

Definition at line 52 of file functionObjectState.C.

Member Function Documentation

◆ operator=()

void operator= ( const functionObjectState )
protected

Disallow default bitwise assignment.

◆ name()

const Foam::word & name ( ) const

Return the name.

Definition at line 58 of file functionObjectState.C.

◆ active()

bool active ( ) const

Return the active flag.

Definition at line 64 of file functionObjectState.C.

◆ stateDict()

const Foam::IOdictionary & stateDict ( ) const

Return access to the state dictionary.

Definition at line 70 of file functionObjectState.C.

◆ propertyDict()

Foam::dictionary & propertyDict ( )

Return access to the property dictionary.

Definition at line 76 of file functionObjectState.C.

References dictionary::add().

Referenced by runTimeCondition::setConditionDict().

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

◆ setActive()

bool setActive

Set the active status by querying objectRegistry type.

returns new active status

Definition at line 29 of file functionObjectStateTemplates.C.

References functionObjectState::active_, Foam::endl(), functionObjectState::name_, functionObjectState::obr_, and WarningInFunction.

Here is the call graph for this function:

◆ foundProperty()

bool foundProperty ( const word entryName) const

Return true if the property exists.

Definition at line 87 of file functionObjectState.C.

References dictionary::found(), and dictionary::subDict().

Here is the call graph for this function:

◆ getProperty() [1/2]

Type getProperty ( const word entryName,
const Type &  defaultValue = pTraits<Type>::zero 
) const

Retrieve generic property.

Definition at line 48 of file functionObjectStateTemplates.C.

◆ getProperty() [2/2]

void getProperty ( const word entryName,
Type &  value 
) const

Retrieve generic property.

Definition at line 61 of file functionObjectStateTemplates.C.

◆ setProperty()

void setProperty ( const word entryName,
const Type &  value 
)

Add generic property.

Definition at line 72 of file functionObjectStateTemplates.C.

◆ getObjectProperty() [1/2]

Type getObjectProperty ( const word objectName,
const word entryName,
const Type &  defaultValue = pTraits<Type>::zero 
) const

Retrieve generic property from named object.

Definition at line 83 of file functionObjectStateTemplates.C.

Referenced by functionObjectSurface::addGeometryToScene(), and functionObjectLine::addGeometryToScene().

Here is the caller graph for this function:

◆ getObjectProperty() [2/2]

void getObjectProperty ( const word objectName,
const word entryName,
Type &  value 
) const

Retrieve generic property from named object.

Definition at line 97 of file functionObjectStateTemplates.C.

References dictionary::found(), dictionary::isDict(), dictionary::lookup(), and dictionary::subDict().

Here is the call graph for this function:

◆ setObjectProperty()

void setObjectProperty ( const word objectName,
const word entryName,
const Type &  value 
)

Add generic property from named object.

Definition at line 123 of file functionObjectStateTemplates.C.

References dictionary::add(), and dictionary::subDict().

Here is the call graph for this function:

◆ setResult()

void setResult ( const word entryName,
const Type &  value 
)

Add result.

Definition at line 141 of file functionObjectStateTemplates.C.

◆ setObjectResult()

void setObjectResult ( const word objectName,
const word entryName,
const Type &  value 
)

Add result from named object.

Definition at line 152 of file functionObjectStateTemplates.C.

References dictionary::add(), dictionary::found(), and dictionary::subDict().

Here is the call graph for this function:

◆ getResult()

Type getResult ( const word entryName,
const Type &  defaultValue = pTraits<Type>::zero 
) const

Retrieve result.

Definition at line 187 of file functionObjectStateTemplates.C.

◆ getObjectResult() [1/2]

Type getObjectResult ( const word objectName,
const word entryName,
const Type &  defaultValue = pTraits<Type>::zero 
) const

Retrieve result from named object.

Definition at line 198 of file functionObjectStateTemplates.C.

◆ getObjectResult() [2/2]

void getObjectResult ( const word objectName,
const word entryName,
Type &  value 
) const

Retrieve result from named object.

Definition at line 212 of file functionObjectStateTemplates.C.

References dictionary::found(), dictionary::readIfPresent(), and dictionary::subDict().

Here is the call graph for this function:

◆ resultType()

Foam::word resultType ( const word entryName) const

Retrieve the result type.

Definition at line 99 of file functionObjectState.C.

◆ objectResultType()

Foam::word objectResultType ( const word objectName,
const word entryName 
) const

Return the type of result.

Definition at line 106 of file functionObjectState.C.

References dict, dictionaryName::dictName(), forAllConstIter(), dictionary::found(), word::null, and dictionary::subDict().

Here is the call graph for this function:

◆ objectResultEntries() [1/2]

Foam::List< Foam::word > objectResultEntries ( ) const

Retrieve the result entries.

Definition at line 137 of file functionObjectState.C.

◆ objectResultEntries() [2/2]

Foam::List< Foam::word > objectResultEntries ( const word objectName) const

Return result entries for named object.

Definition at line 144 of file functionObjectState.C.

References DynamicList::append(), dict, forAllConstIter(), dictionary::found(), dictionary::subDict(), dictionary::toc(), and List::transfer().

Here is the call graph for this function:

Field Documentation

◆ resultsName_

const Foam::word resultsName_ = "results"
staticprivate

Name of the results dictionary.

Definition at line 61 of file functionObjectState.H.

◆ obr_

const objectRegistry& obr_
private

Reference to the database.

Definition at line 64 of file functionObjectState.H.

Referenced by functionObjectState::setActive().

◆ name_

const word name_
protected

◆ active_

bool active_
protected

Flag to indicate whether the object is active.

Definition at line 75 of file functionObjectState.H.

Referenced by fieldValue::read(), and functionObjectState::setActive().

◆ stateDict_

IOdictionary& stateDict_
protected

Reference to the state dictionary.

Definition at line 78 of file functionObjectState.H.


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