This function object calculates the value and location 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 const word & | name () const |
Return name of the set of field min/max. 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... | |
![]() | |
functionObjectFile (const objectRegistry &obr, const word &prefix) | |
Construct null. More... | |
functionObjectFile (const objectRegistry &obr, const word &prefix, const word &name) | |
Construct from components. More... | |
functionObjectFile (const objectRegistry &obr, const word &prefix, const wordList &names) | |
Construct from components. More... | |
virtual | ~functionObjectFile () |
Destructor. More... | |
const wordList & | names () const |
Return const access to the names. More... | |
OFstream & | file () |
Return access to the file (if only 1) More... | |
PtrList< OFstream > & | files () |
Return access to the files. More... | |
OFstream & | file (const label i) |
Return file 'i'. 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... | |
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... | |
fieldMinMax (const fieldMinMax &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const fieldMinMax &) |
Disallow default bitwise assignment. More... | |
virtual void | writeFileHeader (const label i) |
Output file header information. 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 void | createFiles () |
Create the output file. More... | |
virtual void | resetNames (const wordList &names) |
Reset the list of names from a wordList. More... | |
virtual void | resetName (const word &name) |
Reset the list of names to a single name entry. 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 | |
word | name_ |
Name of this set of field min/max. More... | |
const objectRegistry & | obr_ |
bool | active_ |
on/off switch More... | |
Switch | log_ |
Switch to send output to Info as well. More... | |
Switch | location_ |
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... | |
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 location 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"); ... write yes; log yes; location yes; mode magnitude; fields ( U p ); }
Function object usage
Property | Description | Required | Default value |
---|---|---|---|
type | type name: fieldMinMax | yes | |
write | write min/max data to file | no | yes |
log | write min/max data to standard output | no | no |
location | write location of the min/max value | no | yes |
mode | calculation mode: magnitude or component | no | magnitude |
Output data is written to the file <timeDir>/fieldMinMax.dat
Definition at line 129 of file fieldMinMax.H.
enum modeType |
Enumerator | |
---|---|
mdMag | |
mdCmpt |
Definition at line 135 of file fieldMinMax.H.
|
protected |
Disallow default bitwise copy construct.
Referenced by NamedEnum< Enum, nEnum >::names().
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 55 of file fieldMinMax.C.
References Foam::endl(), Foam::read(), and WarningIn.
|
virtual |
Destructor.
Definition at line 94 of file fieldMinMax.C.
|
protected |
Helper function to write the output.
Definition at line 33 of file fieldMinMaxTemplates.C.
References fieldMinMax::calcMinMaxFields(), Foam::endl(), Foam::Info, maxValue, and Foam::nl.
|
protected |
Disallow default bitwise assignment.
|
protectedvirtual |
Output file header information.
Reimplemented from functionObjectFile.
Definition at line 113 of file fieldMinMax.C.
References Foam::endl(), forAll, and UPstream::parRun().
TypeName | ( | "fieldMinMax" | ) |
Runtime type information.
|
inlinevirtual |
Return name of the set of field min/max.
Definition at line 222 of file fieldMinMax.H.
References fieldMinMax::calcMinMaxFields(), fieldMinMax::end(), fieldMinMax::execute(), Foam::mode(), fieldMinMax::name_, fieldMinMax::read(), fieldMinMax::timeSet(), and fieldMinMax::write().
|
virtual |
Read the field min/max data.
Definition at line 100 of file fieldMinMax.C.
References dictionary::lookup(), and dictionary::lookupOrDefault().
Referenced by fieldMinMax::name().
|
virtual |
Execute, currently does nothing.
Definition at line 153 of file fieldMinMax.C.
Referenced by fieldMinMax::name().
|
virtual |
Execute at the final time-loop, currently does nothing.
Definition at line 159 of file fieldMinMax.C.
Referenced by fieldMinMax::name().
|
virtual |
Called when time was set at the end of the Time::operator++.
Definition at line 165 of file fieldMinMax.C.
Referenced by fieldMinMax::name().
Calculate the field min/max.
Definition at line 103 of file fieldMinMaxTemplates.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), Foam::exit(), Foam::FatalError, FatalErrorIn, Foam::findMax(), Foam::findMin(), forAll, Foam::mag(), mesh, List< Type >::size(), and List< T >::size().
Referenced by fieldMinMax::name(), and fieldMinMax::output().
|
virtual |
Write the fieldMinMax.
Reimplemented from functionObjectFile.
Definition at line 171 of file fieldMinMax.C.
References Foam::endl(), forAll, Foam::Info, Foam::nl, Foam::type(), and functionObjectFile::write().
Referenced by fieldMinMax::name().
|
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 146 of file fieldMinMax.H.
Referenced by NamedEnum< Enum, nEnum >::names().
|
protected |
Name of this set of field min/max.
Also used as the name of the output directory
Definition at line 150 of file fieldMinMax.H.
Referenced by fieldMinMax::name().
|
protected |
Definition at line 152 of file fieldMinMax.H.
|
protected |
on/off switch
Definition at line 155 of file fieldMinMax.H.
|
protected |
Switch to send output to Info as well.
Definition at line 158 of file fieldMinMax.H.
|
protected |
Switch to write location of min/max values.
Definition at line 161 of file fieldMinMax.H.
|
protected |
Mode for min/max - only applicable for ranks > 0.
Definition at line 164 of file fieldMinMax.H.
|
protected |
Fields to assess min/max.
Definition at line 167 of file fieldMinMax.H.