Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
fieldMinMax Class Reference

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...

Inheritance diagram for fieldMinMax:
Inheritance graph
[legend]
Collaboration diagram for fieldMinMax:
Collaboration graph
[legend]

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 wordname () 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...
 
- Public Member Functions inherited from functionObjectFile
 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 wordListnames () const
 Return const access to the names. More...
 
OFstreamfile ()
 Return access to the file (if only 1) More...
 
PtrList< OFstream > & files ()
 Return access to the files. More...
 
OFstreamfile (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...
 
- Protected Member Functions inherited from functionObjectFile
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 objectRegistryobr_
 
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 Public Attributes inherited from functionObjectFile
static const word outputPrefix = "postProcessing"
 Directory prefix. More...
 
static label addChars = 7
 Additional characters for writing. More...
 

Detailed Description

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

See also
Foam::functionObject Foam::OutputFilterFunctionObject
Source files

Definition at line 129 of file fieldMinMax.H.

Member Enumeration Documentation

enum modeType
Enumerator
mdMag 
mdCmpt 

Definition at line 135 of file fieldMinMax.H.

Constructor & Destructor Documentation

fieldMinMax ( const fieldMinMax )
protected

Disallow default bitwise copy construct.

Referenced by NamedEnum< Enum, nEnum >::names().

Here is the caller graph for this function:

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.

Here is the call graph for this function:

~fieldMinMax ( )
virtual

Destructor.

Definition at line 94 of file fieldMinMax.C.

Member Function Documentation

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 
)
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.

Here is the call graph for this function:

void operator= ( const fieldMinMax )
protected

Disallow default bitwise assignment.

void writeFileHeader ( const label  i)
protectedvirtual

Output file header information.

Reimplemented from functionObjectFile.

Definition at line 113 of file fieldMinMax.C.

References Foam::endl(), forAll, and UPstream::parRun().

Here is the call graph for this function:

TypeName ( "fieldMinMax"  )

Runtime type information.

virtual const word& name ( ) const
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().

Here is the call graph for this function:

void read ( const dictionary dict)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void execute ( )
virtual

Execute, currently does nothing.

Definition at line 153 of file fieldMinMax.C.

Referenced by fieldMinMax::name().

Here is the caller graph for this function:

void end ( )
virtual

Execute at the final time-loop, currently does nothing.

Definition at line 159 of file fieldMinMax.C.

Referenced by fieldMinMax::name().

Here is the caller graph for this function:

void timeSet ( )
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().

Here is the caller graph for this function:

void calcMinMaxFields ( const word fieldName,
const modeType mode 
)

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void write ( )
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().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void updateMesh ( const mapPolyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 251 of file fieldMinMax.H.

virtual void movePoints ( const polyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 255 of file fieldMinMax.H.

Member Data Documentation

const Foam::NamedEnum< Foam::fieldMinMax::modeType, 2 > modeTypeNames_
staticprotected

Mode type names.

Definition at line 146 of file fieldMinMax.H.

Referenced by NamedEnum< Enum, nEnum >::names().

word name_
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().

const objectRegistry& obr_
protected

Definition at line 152 of file fieldMinMax.H.

bool active_
protected

on/off switch

Definition at line 155 of file fieldMinMax.H.

Switch log_
protected

Switch to send output to Info as well.

Definition at line 158 of file fieldMinMax.H.

Switch location_
protected

Switch to write location of min/max values.

Definition at line 161 of file fieldMinMax.H.

modeType mode_
protected

Mode for min/max - only applicable for ranks > 0.

Definition at line 164 of file fieldMinMax.H.

wordList fieldSet_
protected

Fields to assess min/max.

Definition at line 167 of file fieldMinMax.H.


The documentation for this class was generated from the following files: