This function object writes out the initial residual for specified fields. More...
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 word & | name () const |
Return name of the set of field min/max. More... | |
virtual void | read (const dictionary &) |
Read the field residuals 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 residuals. 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... | |
![]() | |
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 | |
residuals (const residuals &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const residuals &) |
Disallow default bitwise assignment. More... | |
template<class Type > | |
void | writeFileHeader (const word &fieldName) |
Output field header information. More... | |
virtual void | writeFileHeader (Ostream &os) const |
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 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 | |
word | name_ |
Name of this set of residuals. More... | |
const objectRegistry & | obr_ |
bool | active_ |
on/off switch More... | |
wordList | fieldSet_ |
Fields to write residuals. 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 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.
Definition at line 88 of file residuals.H.
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 58 of file residuals.C.
References dict, Foam::endl(), Foam::read(), and WarningInFunction.
|
virtual |
Destructor.
Definition at line 90 of file residuals.C.
|
protected |
Disallow default bitwise assignment.
|
protected |
Output field header information.
|
protectedvirtual |
Output file header information.
Definition at line 41 of file residuals.C.
References Foam::endl(), residuals::fieldSet_, forAll, functionObjectFile::writeCommented(), functionObjectFile::writeHeader(), and functionObjectFile::writeTabbed().
TypeName | ( | "residuals" | ) |
Runtime type information.
|
inlinevirtual |
Return name of the set of field min/max.
Definition at line 151 of file residuals.H.
References residuals::name_.
|
virtual |
Read the field residuals data.
Definition at line 96 of file residuals.C.
References dict, dictionary::lookup(), functionObjectFile::read(), and HashTable::toc().
|
virtual |
Execute, currently does nothing.
Definition at line 109 of file residuals.C.
|
virtual |
Execute at the final time-loop, currently does nothing.
Definition at line 113 of file residuals.C.
|
virtual |
Called when time was set at the end of the Time::operator++.
Definition at line 117 of file residuals.C.
void writeResidual | ( | const word & | fieldName | ) |
Calculate the field residuals.
Definition at line 33 of file residualsTemplates.C.
References Foam::component(), functionObjectFile::file(), dictionary::found(), objectRegistry::foundObject(), dictionary::lookup(), objectRegistry::lookupObject(), mesh, residuals::obr_, and token::TAB.
|
virtual |
Write the residuals.
Definition at line 121 of file residuals.C.
References Foam::endl(), forAll, and UPstream::master().
|
inlinevirtual |
Update for changes of mesh.
Definition at line 176 of file residuals.H.
|
inlinevirtual |
Update for changes of mesh.
Definition at line 180 of file residuals.H.
|
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().
|
protected |
Definition at line 100 of file residuals.H.
Referenced by residuals::writeResidual().
|
protected |
on/off switch
Definition at line 103 of file residuals.H.
|
protected |
Fields to write residuals.
Definition at line 106 of file residuals.H.
Referenced by residuals::writeFileHeader().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.