Average run time condition - satisfied when average does not change by more than a given value. More...
#include <averageCondition.H>


Public Member Functions | |
| TypeName ("average") | |
| Runtime type information. | |
| averageCondition (const word &name, const objectRegistry &obr, const dictionary &dict, stateFunctionObject &state) | |
| Constructor. | |
| virtual | ~averageCondition ()=default |
| Destructor. | |
| virtual bool | apply () |
| Apply the condition. | |
| virtual void | write () |
| Write. | |
| virtual void | reset () |
| Reset. | |
| Public Member Functions inherited from runTimeCondition | |
| TypeName ("runTimeCondition") | |
| Runtime type information. | |
| declareRunTimeSelectionTable (autoPtr, runTimeCondition, dictionary,(const word &name, const objectRegistry &obr, const dictionary &dict, stateFunctionObject &state),(name, obr, dict, state)) | |
| Declare runtime constructor selection table. | |
| runTimeCondition (const word &name, const objectRegistry &obr, const dictionary &dict, stateFunctionObject &state) | |
| Constructor. | |
| virtual | ~runTimeCondition ()=default |
| Destructor. | |
| virtual const word & | name () const |
| Return the condition name. | |
| virtual bool | active () const |
| Return the active flag. | |
| virtual label | groupID () const |
| Return the group index. | |
| Public Member Functions inherited from valueAverageBase | |
| valueAverageBase (const word &name, const objectRegistry &obr, const dictionary &dict, stateFunctionObject &state, const bool writeToFile=true) | |
| Construct from Time and dictionary. | |
| valueAverageBase (const valueAverageBase &)=delete | |
| No copy construct. | |
| void | operator= (const valueAverageBase &)=delete |
| No copy assignment. | |
| virtual | ~valueAverageBase ()=default |
| Destructor. | |
| virtual bool | read (const dictionary &dict) |
| Read the field value average data. | |
| virtual bool | calculate (dictionary &dict) |
| Calculate the averages. | |
| Public Member Functions inherited from writeFile | |
| writeFile (const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true, const string &ext=".dat") | |
| Construct from objectRegistry, prefix, fileName. | |
| writeFile (const objectRegistry &obr, const fileName &prefix, const word &name, const dictionary &dict, const bool writeToFile=true, const string &ext=".dat") | |
| Construct from objectRegistry, prefix, fileName and read options from dictionary. | |
| writeFile (const writeFile &wf) | |
| Construct copy. | |
| virtual | ~writeFile ()=default |
| Destructor. | |
| virtual const string & | setExt (const string &ext) |
| Set extension. | |
| virtual OFstream & | file () |
| Return access to the file (if only 1). | |
| virtual bool | writeToFile () const |
| Flag to allow writing to file. | |
| virtual bool | canWriteToFile () const |
| Flag to allow writing to the file. | |
| virtual bool | canResetFile () const |
| Flag to allow resetting the file. | |
| virtual bool | canWriteHeader () const |
| Flag to allow writing the header. | |
| virtual label | charWidth () const |
| Return width of character stream output. | |
| virtual void | writeCommented (Ostream &os, const string &str) const |
| Write a commented string to stream. | |
| virtual void | writeTabbed (Ostream &os, const string &str) const |
| Write a tabbed string to stream. | |
| virtual void | writeHeader (Ostream &os, const string &str) const |
| Write a commented header to stream. | |
| virtual void | writeCurrentTime (Ostream &os) const |
| Write the current time to stream. | |
| virtual void | writeBreak (Ostream &os) const |
| Write a break marker to the stream. | |
| template<class Type> | |
| void | writeHeaderValue (Ostream &os, const string &property, const Type &value) const |
| Write a (commented) header property and value pair. | |
| template<class Type> | |
| void | writeValue (Ostream &os, const Type &val) const |
| Write a given value to stream with the space delimiter. | |
Protected Attributes | |
| label | nIterStartUp_ |
| Number of start-up iterations before allowing satisfied checks. | |
| label | iter_ |
| Current iteration count. | |
| Protected Attributes inherited from runTimeCondition | |
| word | name_ |
| Condition name. | |
| const objectRegistry & | obr_ |
| Reference to the object registry. | |
| stateFunctionObject & | state_ |
| State. | |
| bool | active_ |
| On/off switch. | |
| dictionary & | conditionDict_ |
| Reference to the condition dictionary. | |
| label | groupID_ |
| Group index - if applied, all conditions in a group must be. | |
| Protected Attributes inherited from valueAverageBase | |
| bool | resetOnRestart_ |
| Reset the averaging process on restart. | |
| windowType | windowType_ |
| Window type. | |
| stateFunctionObject & | state_ |
| Reference to the state functionObject. | |
| word | functionObjectName_ |
| Name of function object to retrieve data from. | |
| wordList | fieldNames_ |
| List of fields on which to operate. | |
| scalar | tolerance_ |
| Optional tolerance to check for converged results. | |
| scalar | window_ |
| Averaging window. | |
| List< scalar > | totalTime_ |
| Average time per field. | |
| Protected Attributes inherited from writeFile | |
| const objectRegistry & | fileObr_ |
| Reference to the region objectRegistry. | |
| const fileName | prefix_ |
| Prefix. | |
| word | fileName_ |
| Name of file. | |
| autoPtr< OFstream > | filePtr_ |
| File pointer. | |
| label | writePrecision_ |
| Write precision. | |
| bool | writeToFile_ |
| Flag to enable/disable writing to file. | |
| bool | updateHeader_ |
| Flag to update the header, e.g. on mesh changes. Default is true. | |
| bool | writtenHeader_ |
| Flag to identify whether the header has been written. | |
| bool | useUserTime_ |
| Flag to use the specified user time, e.g. CA deg instead of seconds. Default = true. | |
| scalar | startTime_ |
| Start time value. | |
| string | ext_ |
| File extension; default = .dat. | |
Additional Inherited Members | |
| Public Types inherited from valueAverageBase | |
| enum class | windowType : uint8_t { NONE , APPROXIMATE , EXACT } |
| Averaging window types. More... | |
| Static Public Member Functions inherited from runTimeCondition | |
| static autoPtr< runTimeCondition > | New (const word &conditionName, const objectRegistry &obr, const dictionary &dict, stateFunctionObject &state) |
| Selector. | |
| Public Attributes inherited from runTimeCondition | |
| Switch | log |
| Switch to send output to Info. | |
| Static Public Attributes inherited from valueAverageBase | |
| static const Enum< windowType > | windowTypeNames |
| Names for windowType enumeration. | |
| Static Public Attributes inherited from writeFile | |
| static label | addChars = 8 |
| Additional characters for writing. | |
| Protected Member Functions inherited from runTimeCondition | |
| dictionary & | setConditionDict () |
| Set the condition dictionary (create if necessary). | |
| const dictionary & | conditionDict () const |
| Return const access to the conditions dictionary. | |
| dictionary & | conditionDict () |
| Return non-const access to the conditions dictionary. | |
| Protected Member Functions inherited from valueAverageBase | |
| template<class Type, class Type2 = Type> | |
| bool | calc (const label fieldi, bool &converged, dictionary &dict) |
| Templated function to calculate the average. | |
| virtual void | writeFileHeader (Ostream &os) const |
| Output file header information. | |
| virtual void | readState (dictionary &dict) |
| Read state from dictionary. | |
| virtual void | writeState (dictionary &dict) |
| Write state to dictionary for restarts. | |
| virtual void | resetState (dictionary &dict) |
| Reset state. | |
| Protected Member Functions inherited from writeFile | |
| void | initStream (Ostream &os) const |
| Initialise the output stream for writing. | |
| fileName | baseFileDir () const |
| Return the base directory for output. | |
| fileName | baseTimeDir () const |
| Return the base directory for the current time value. | |
| fileName | filePath (const fileName &fName) const |
| Return the full path for the supplied file name. | |
| virtual autoPtr< OFstream > | newFile (const fileName &fName) const |
| Return autoPtr to a new file using file name. | |
| virtual autoPtr< OFstream > | newFileAtTime (const word &name, scalar timeValue) const |
| Return autoPtr to a new file for a given time. | |
| virtual autoPtr< OFstream > | newFileAtStartTime (const word &name) const |
| Return autoPtr to a new file using the simulation start time. | |
| virtual void | resetFile (const word &name) |
| Reset internal file pointer to new file with new name. | |
| Omanip< int > | valueWidth (const label offset=0) const |
| Return the value width when writing to stream with optional offset. | |
| void | operator= (const writeFile &)=delete |
| No copy assignment. | |
| virtual autoPtr< OFstream > | createFile (const word &name, scalar timeValue) const |
| Deprecated(2022-09) Return autoPtr to a new file for a given time. | |
| virtual autoPtr< OFstream > | createFile (const word &name) const |
| Deprecated(2022-09) Return autoPtr to a new file using the simulation start time. | |
Average run time condition - satisfied when average does not change by more than a given value.
Definition at line 56 of file averageCondition.H.
| averageCondition | ( | const word & | name, |
| const objectRegistry & | obr, | ||
| const dictionary & | dict, | ||
| stateFunctionObject & | state ) |
Constructor.
Definition at line 40 of file averageCondition.C.
References runTimeCondition::conditionDict(), dict, iter_, runTimeCondition::name(), nIterStartUp_, runTimeCondition::obr_, valueAverageBase::readState(), runTimeCondition::runTimeCondition(), and valueAverageBase::valueAverageBase().

|
virtualdefault |
Destructor.
| TypeName | ( | "average" | ) |
Runtime type information.
References dict, and runTimeCondition::name().

|
virtual |
Apply the condition.
Implements runTimeCondition.
Definition at line 63 of file averageCondition.C.
References runTimeCondition::active_, valueAverageBase::calculate(), runTimeCondition::conditionDict(), Foam::decrIndent(), Foam::incrIndent(), Foam::Info, iter_, and nIterStartUp_.

|
virtual |
Write.
Implements runTimeCondition.
Definition at line 85 of file averageCondition.C.
References runTimeCondition::conditionDict(), iter_, and valueAverageBase::writeState().

|
virtual |
Reset.
Implements runTimeCondition.
Definition at line 95 of file averageCondition.C.
References runTimeCondition::conditionDict(), iter_, and valueAverageBase::resetState().

|
protected |
Number of start-up iterations before allowing satisfied checks.
Definition at line 68 of file averageCondition.H.
Referenced by apply(), and averageCondition().
|
protected |
Current iteration count.
Definition at line 73 of file averageCondition.H.
Referenced by apply(), averageCondition(), reset(), and write().