Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
residuals Class Reference

This function object writes out the initial residual for specified fields. More...

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

Public Member Functions

 TypeName ("residuals")
 Runtime type information. More...
 
 residuals (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false)
 Construct for given objectRegistry and dictionary. More...
 
virtual ~residuals ()
 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 writeResidual (const word &fieldName)
 Calculate the field min/max. More...
 
virtual void write ()
 Write the residuals. 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

 residuals (const residuals &)
 Disallow default bitwise copy construct. More...
 
void operator= (const residuals &)
 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 residuals. More...
 
const objectRegistryobr_
 
bool active_
 on/off switch More...
 
wordList fieldSet_
 Fields to write residuals. 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 writes out the initial residual for specified fields.

Example of function object specification:

residuals
{
    type            residuals;
    outputControl   timeStep;
    outputInterval  1;
    fields
    (
        U
        p
    );
}

Output data is written to the dir postProcessing/residuals/<timeDir>/ For vector/tensor fields, e.g. U, where an equation is solved for each component, the largest residual of each component is written out.

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

Definition at line 88 of file residuals.H.

Constructor & Destructor Documentation

residuals ( const residuals )
protected

Disallow default bitwise copy construct.

residuals ( 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 41 of file residuals.C.

References Foam::endl(), Foam::read(), and WarningIn.

Here is the call graph for this function:

~residuals ( )
virtual

Destructor.

Definition at line 77 of file residuals.C.

Member Function Documentation

void operator= ( const residuals )
protected

Disallow default bitwise assignment.

void writeFileHeader ( const label  i)
protectedvirtual

Output file header information.

Reimplemented from functionObjectFile.

Definition at line 92 of file residuals.C.

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

Here is the call graph for this function:

TypeName ( "residuals"  )

Runtime type information.

virtual const word& name ( ) const
inlinevirtual

Return name of the set of field min/max.

Definition at line 147 of file residuals.H.

References residuals::end(), residuals::execute(), residuals::name_, residuals::read(), residuals::timeSet(), residuals::write(), and residuals::writeResidual().

Here is the call graph for this function:

void read ( const dictionary dict)
virtual

Read the field min/max data.

Definition at line 83 of file residuals.C.

References dictionary::lookup().

Referenced by residuals::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 109 of file residuals.C.

Referenced by residuals::name().

Here is the caller graph for this function:

void end ( )
virtual

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

Definition at line 115 of file residuals.C.

Referenced by residuals::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 121 of file residuals.C.

Referenced by residuals::name().

Here is the caller graph for this function:

void writeResidual ( const word fieldName)

Calculate the field min/max.

Definition at line 36 of file residualsTemplates.C.

References UList< T >::first(), dictionary::found(), dictionary::lookup(), and mesh.

Referenced by residuals::name().

Here is the call graph for this function:

Here is the caller graph for this function:

void write ( )
virtual

Write the residuals.

Reimplemented from functionObjectFile.

Definition at line 127 of file residuals.C.

References Foam::endl(), forAll, UPstream::master(), and functionObjectFile::write().

Referenced by residuals::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 172 of file residuals.H.

virtual void movePoints ( const polyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 176 of file residuals.H.

Member Data Documentation

word name_
protected

Name of this set of residuals.

Also used as the name of the output directory

Definition at line 98 of file residuals.H.

Referenced by residuals::name().

const objectRegistry& obr_
protected

Definition at line 100 of file residuals.H.

bool active_
protected

on/off switch

Definition at line 103 of file residuals.H.

wordList fieldSet_
protected

Fields to write residuals.

Definition at line 106 of file residuals.H.


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