This function object calculates the value and position of scalar minimim and maximum for a list of user-specified fields. For variables with a rank greater than zero, either the min/max of a component value or the magnitude is reported. When operating in parallel, the processor owning the value is also given. More...
Public Types | |
enum | modeType { mdMag, mdCmpt } |
Public Member Functions | |
TypeName ("fieldMinMax") | |
Runtime type information. More... | |
fieldMinMax (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false) | |
Construct for given objectRegistry and dictionary. More... | |
virtual | ~fieldMinMax () |
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... | |
template<class Type > | |
void | calcMinMaxFields (const word &fieldName, const modeType &mode) |
Calculate the field min/max. 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 | output (const word &fieldName, const word &outputName, const vector &minC, const vector &maxC, const label minProcI, const label maxProcI, const Type &minValue, const Type &maxValue) |
Helper function to write the output. More... | |
virtual void | writeFileHeader (Ostream &os) const |
Output file header information. More... | |
fieldMinMax (const fieldMinMax &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const fieldMinMax &) |
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... | |
Switch | log_ |
Switch to send output to Info as well. More... | |
Switch | writeLocation_ |
Switch to write location of min/max values. More... | |
modeType | mode_ |
Mode for min/max - only applicable for ranks > 0. More... | |
wordList | fieldSet_ |
Fields to assess min/max. 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... | |
Static Protected Attributes | |
static const NamedEnum< modeType, 2 > | modeTypeNames_ |
Mode type names. 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 value and position of scalar minimim and maximum for a list of user-specified fields. For variables with a rank greater than zero, either the min/max of a component value or the magnitude is reported. When operating in parallel, the processor owning the value is also given.
Example of function object specification:
fieldMinMax1 { type fieldMinMax; functionObjectLibs ("libfieldFunctionObjects.so"); ... writeToFile yes; log yes; writeLocation yes; mode magnitude; fields (U p); }
Function object usage
Property | Description | Required | Default value |
---|---|---|---|
type | type name: fieldMinMax | yes | |
writeToFile | write min/max data to file | no | yes |
log | write min/max data to standard output | no | yes |
writeLocation | write location of the min/max value | no | yes |
mode | calculation mode: magnitude or component | no | magnitude |
fields | list of fields to process | yes |
Output data is written to the file <timeDir>/fieldMinMax.dat
Definition at line 136 of file fieldMinMax.H.
enum modeType |
Enumerator | |
---|---|
mdMag | |
mdCmpt |
Definition at line 145 of file fieldMinMax.H.
|
protected |
Disallow default bitwise copy construct.
fieldMinMax | ( | const word & | name, |
const objectRegistry & | obr, | ||
const dictionary & | dict, | ||
const bool | loadFromFiles = false |
||
) |
Construct for given objectRegistry and dictionary.
Allow the possibility to load fields from files
Definition at line 94 of file fieldMinMax.C.
References dict, and Foam::read().
|
virtual |
Destructor.
Definition at line 120 of file fieldMinMax.C.
|
protected |
Helper function to write the output.
Definition at line 33 of file fieldMinMaxTemplates.C.
References Foam::endl(), Foam::Info, maxValue, minValue, and Foam::nl.
|
protectedvirtual |
Output file header information.
Definition at line 54 of file fieldMinMax.C.
References Foam::endl(), fieldMinMax::fieldSet_, forAll, UPstream::parRun(), functionObjectFile::writeCommented(), functionObjectFile::writeHeader(), fieldMinMax::writeLocation_, and functionObjectFile::writeTabbed().
|
protected |
Disallow default bitwise assignment.
TypeName | ( | "fieldMinMax" | ) |
Runtime type information.
|
virtual |
Read the field min/max data.
Definition at line 126 of file fieldMinMax.C.
References dict, dictionary::lookup(), dictionary::lookupOrDefault(), modeTypeNames_, and functionObjectFile::read().
|
virtual |
Execute, currently does nothing.
Definition at line 141 of file fieldMinMax.C.
|
virtual |
Execute at the final time-loop, currently does nothing.
Definition at line 147 of file fieldMinMax.C.
|
virtual |
Called when time was set at the end of the Time::operator++.
Definition at line 153 of file fieldMinMax.C.
Calculate the field min/max.
Definition at line 112 of file fieldMinMaxTemplates.C.
References GeometricField::boundaryField(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::findMax(), Foam::findMin(), forAll, Foam::mag(), maxValue, mesh, minValue, Foam::mode(), and modeTypeNames_.
|
virtual |
Write the fieldMinMax.
Definition at line 159 of file fieldMinMax.C.
References Foam::endl(), forAll, Foam::Info, Foam::nl, and Foam::type().
|
inlinevirtual |
Update for changes of mesh.
Definition at line 251 of file fieldMinMax.H.
|
inlinevirtual |
Update for changes of mesh.
Definition at line 255 of file fieldMinMax.H.
|
staticprotected |
Mode type names.
Definition at line 157 of file fieldMinMax.H.
|
protected |
Reference to the database.
Definition at line 160 of file fieldMinMax.H.
|
protected |
Switch to send output to Info as well.
Definition at line 163 of file fieldMinMax.H.
|
protected |
Switch to write location of min/max values.
Definition at line 166 of file fieldMinMax.H.
Referenced by fieldMinMax::writeFileHeader().
|
protected |
Mode for min/max - only applicable for ranks > 0.
Definition at line 169 of file fieldMinMax.H.
|
protected |
Fields to assess min/max.
Definition at line 172 of file fieldMinMax.H.
Referenced by fieldMinMax::writeFileHeader().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.