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...
Public Member Functions | |
functionObjectState (const objectRegistry &obr, const word &name) | |
Construct from components. More... | |
virtual | ~functionObjectState () |
Destructor. More... | |
const word & | name () const |
Return the name. More... | |
bool | active () const |
Return the active flag. More... | |
const IOdictionary & | stateDict () const |
Return access to the state dictionary. More... | |
dictionary & | propertyDict () |
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< word > | objectResultEntries () const |
Retrieve the result entries. More... | |
List< word > | objectResultEntries (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... | |
IOdictionary & | stateDict_ |
Reference to the state dictionary. More... | |
Private Attributes | |
const objectRegistry & | obr_ |
Reference to the database. More... | |
Static Private Attributes | |
static const word | resultsName_ = "results" |
Name of the results dictionary. More... | |
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.
Definition at line 54 of file functionObjectState.H.
|
protected |
Disallow default bitwise copy construct.
functionObjectState | ( | const objectRegistry & | obr, |
const word & | name | ||
) |
Construct from components.
Definition at line 35 of file functionObjectState.C.
|
virtual |
Destructor.
Definition at line 52 of file functionObjectState.C.
|
protected |
Disallow default bitwise assignment.
const Foam::word & name | ( | ) | const |
Return the name.
Definition at line 58 of file functionObjectState.C.
bool active | ( | ) | const |
Return the active flag.
Definition at line 64 of file functionObjectState.C.
const Foam::IOdictionary & stateDict | ( | ) | const |
Return access to the state dictionary.
Definition at line 70 of file functionObjectState.C.
Foam::dictionary & propertyDict | ( | ) |
Return access to the property dictionary.
Definition at line 76 of file functionObjectState.C.
References dictionary::add().
Referenced by runTimeCondition::setConditionDict().
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.
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().
Retrieve generic property.
Definition at line 48 of file functionObjectStateTemplates.C.
void getProperty | ( | const word & | entryName, |
Type & | value | ||
) | const |
Retrieve generic property.
Definition at line 61 of file functionObjectStateTemplates.C.
void setProperty | ( | const word & | entryName, |
const Type & | value | ||
) |
Add generic property.
Definition at line 72 of file functionObjectStateTemplates.C.
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().
Retrieve generic property from named object.
Definition at line 97 of file functionObjectStateTemplates.C.
References dictionary::found(), dictionary::isDict(), dictionary::lookup(), and dictionary::subDict().
Add generic property from named object.
Definition at line 123 of file functionObjectStateTemplates.C.
References dictionary::add(), and dictionary::subDict().
void setResult | ( | const word & | entryName, |
const Type & | value | ||
) |
Add result.
Definition at line 141 of file functionObjectStateTemplates.C.
Add result from named object.
Definition at line 152 of file functionObjectStateTemplates.C.
References dictionary::add(), dictionary::found(), and dictionary::subDict().
Retrieve result.
Definition at line 187 of file functionObjectStateTemplates.C.
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.
Retrieve result from named object.
Definition at line 212 of file functionObjectStateTemplates.C.
References dictionary::found(), dictionary::readIfPresent(), and dictionary::subDict().
Foam::word resultType | ( | const word & | entryName | ) | const |
Retrieve the result type.
Definition at line 99 of file functionObjectState.C.
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().
Foam::List< Foam::word > objectResultEntries | ( | ) | const |
Retrieve the result entries.
Definition at line 137 of file functionObjectState.C.
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().
|
staticprivate |
Name of the results dictionary.
Definition at line 61 of file functionObjectState.H.
|
private |
Reference to the database.
Definition at line 64 of file functionObjectState.H.
Referenced by functionObjectState::setActive().
|
protected |
Name of model.
Definition at line 72 of file functionObjectState.H.
Referenced by forces::fieldName(), runTimeControl::name(), fieldValue::name(), sampledSurfaces::name(), fieldAverage::name(), forces::name(), functionObjectState::setActive(), and faceSource::setFaceZoneFaces().
|
protected |
Flag to indicate whether the object is active.
Definition at line 75 of file functionObjectState.H.
Referenced by fieldValue::read(), and functionObjectState::setActive().
|
protected |
Reference to the state dictionary.
Definition at line 78 of file functionObjectState.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.