This function object calculates the average value from the output of function objects that generate singular values. More...
Public Member Functions | |
TypeName ("valueAverage") | |
Runtime type information. More... | |
valueAverage (const word &name, const objectRegistry &obr, const dictionary &dict, const bool loadFromFiles=false) | |
Constructor. More... | |
virtual | ~valueAverage () |
Destructor. More... | |
virtual void | read (const dictionary &) |
Read the field min/max data. More... | |
virtual void | execute () |
Execute, currently does nothing. More... | |
virtual void | end () |
Execute at the final time-loop, currently does nothing. More... | |
virtual void | timeSet () |
Called when time was set at the end of the Time::operator++. More... | |
virtual void | write () |
Write the fieldMinMax. More... | |
virtual void | updateMesh (const mapPolyMesh &) |
Update for changes of mesh. More... | |
virtual void | movePoints (const polyMesh &) |
Update for changes of mesh. More... | |
![]() | |
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... | |
![]() | |
functionObjectFile (const objectRegistry &obr, const word &prefix) | |
Construct null. More... | |
functionObjectFile (const objectRegistry &obr, const word &prefix, const word &fileName, const dictionary &dict) | |
Construct from components and read options from dictionary. More... | |
virtual | ~functionObjectFile () |
Destructor. More... | |
void | read (const dictionary &dict) |
Read. More... | |
OFstream & | file () |
Return access to the file (if only 1) More... | |
bool | writeToFile () const |
Return true if can write to file. More... | |
void | writeCommented (Ostream &os, const string &str) const |
Write a commented string to stream. More... | |
void | writeTabbed (Ostream &os, const string &str) const |
Write a tabbed string to stream. More... | |
void | writeHeader (Ostream &os, const string &str) const |
Write a commented header to stream. More... | |
void | writeTime (Ostream &os) const |
Write the current time to stream. More... | |
template<class Type > | |
void | writeHeaderValue (Ostream &os, const string &property, const Type &value) const |
Write a (commented) header property and value pair. More... | |
label | charWidth () const |
Return width of character stream output. More... | |
Protected Member Functions | |
template<class Type > | |
void | calc (const word &fieldName, const word &meanName, const scalar alpha, const scalar beta, bool &processed) |
Templated function to calculate the average. More... | |
virtual void | writeFileHeader (Ostream &os) const |
Output file header information. More... | |
valueAverage (const valueAverage &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const valueAverage &) |
Disallow default bitwise assignment. More... | |
![]() | |
functionObjectState (const functionObjectState &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const functionObjectState &) |
Disallow default bitwise assignment. More... | |
![]() | |
virtual void | initStream (Ostream &os) const |
Initialise the output stream for writing. More... | |
virtual fileName | baseFileDir () const |
Return the base directory for output. More... | |
virtual fileName | baseTimeDir () const |
Return the base directory for the current time value. More... | |
virtual autoPtr< OFstream > | createFile (const word &name) const |
Return an autoPtr to a new file. More... | |
virtual void | resetFile (const word &name) |
Reset internal file pointer to new file with new name. More... | |
virtual Omanip< int > | valueWidth (const label offset=0) const |
Return the value width when writing to stream with optional offset. More... | |
functionObjectFile (const functionObjectFile &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const functionObjectFile &) |
Disallow default bitwise assignment. More... | |
Protected Attributes | |
const objectRegistry & | obr_ |
Reference to the database. More... | |
word | functionObjectName_ |
Name of function object to retrueve data from. More... | |
wordList | fieldNames_ |
List of fields on which to operate. More... | |
const scalar | window_ |
Averaging window. More... | |
List< scalar > | totalTime_ |
Average time per field. More... | |
Switch | resetOnRestart_ |
Reset the averaging process on restart flag. More... | |
Switch | log_ |
Switch to send output to Info as well. More... | |
![]() | |
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... | |
![]() | |
bool | writeToFile_ |
Flag to enable/disable writing to file. More... | |
Additional Inherited Members | |
![]() | |
static const word | outputPrefix = "postProcessing" |
Directory prefix. More... | |
static label | addChars = 7 |
Additional characters for writing. More... | |
This function object calculates the average value from the output of function objects that generate singular values.
Example of function object specification:
valueAverage1 { type valueAverage; functionObjectLibs ("libfieldFunctionObjects.so"); ... writeToFile yes; log yes; functionObjectName forceCoeffs1; fields (Cm Cd Cl); window 0.5; }
Function object usage
Property | Description | Required | Default value |
---|---|---|---|
type | type name: valueAverage | yes | |
writeToFile | write average data to file | no | yes |
log | write average data to standard output | no | yes |
fields | list of fields to process | yes |
Output data is written to the file <timeDir>/valueAverage.dat
Definition at line 120 of file valueAverage.H.
|
protected |
Disallow default bitwise copy construct.
valueAverage | ( | const word & | name, |
const objectRegistry & | obr, | ||
const dictionary & | dict, | ||
const bool | loadFromFiles = false |
||
) |
Constructor.
Definition at line 54 of file valueAverage.C.
References dict, forAll, dictionary::found(), dictionary::lookup(), Foam::readScalar(), and dictionary::subDict().
|
virtual |
Destructor.
Definition at line 91 of file valueAverage.C.
|
protected |
Templated function to calculate the average.
Definition at line 30 of file valueAverageTemplates.C.
References Foam::constant::atomic::alpha, beta(), Foam::Info, Foam::nl, and Foam::tab.
|
protectedvirtual |
Output file header information.
Definition at line 39 of file valueAverage.C.
References Foam::endl(), valueAverage::fieldNames_, forAll, functionObjectFile::writeCommented(), functionObjectFile::writeHeader(), and functionObjectFile::writeTabbed().
|
protected |
Disallow default bitwise assignment.
TypeName | ( | "valueAverage" | ) |
Runtime type information.
|
virtual |
Read the field min/max data.
Definition at line 97 of file valueAverage.C.
References dict, dictionary::lookupOrDefault(), and functionObjectFile::read().
|
virtual |
Execute, currently does nothing.
Definition at line 108 of file valueAverage.C.
References Foam::constant::atomic::alpha, DynamicList::append(), beta(), Foam::endl(), forAll, Foam::Info, Foam::nl, Foam::tab, Foam::type(), and WarningInFunction.
|
virtual |
Execute at the final time-loop, currently does nothing.
Definition at line 181 of file valueAverage.C.
|
virtual |
Called when time was set at the end of the Time::operator++.
Definition at line 187 of file valueAverage.C.
|
virtual |
Write the fieldMinMax.
Definition at line 193 of file valueAverage.C.
|
inlinevirtual |
Update for changes of mesh.
Definition at line 210 of file valueAverage.H.
|
inlinevirtual |
Update for changes of mesh.
Definition at line 214 of file valueAverage.H.
|
protected |
Reference to the database.
Definition at line 130 of file valueAverage.H.
|
protected |
Name of function object to retrueve data from.
Definition at line 133 of file valueAverage.H.
|
protected |
List of fields on which to operate.
Definition at line 136 of file valueAverage.H.
Referenced by valueAverage::writeFileHeader().
|
protected |
Averaging window.
Definition at line 139 of file valueAverage.H.
|
protected |
Average time per field.
Definition at line 142 of file valueAverage.H.
|
protected |
Reset the averaging process on restart flag.
Definition at line 145 of file valueAverage.H.
|
protected |
Switch to send output to Info as well.
Definition at line 148 of file valueAverage.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.