Base class for output file data handling. More...
Public Member Functions | |
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... | |
Static Public Attributes | |
static const word | outputPrefix = "postProcessing" |
Directory prefix. More... | |
static label | addChars = 7 |
Additional characters for writing. More... | |
Protected Member Functions | |
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 | |
bool | writeToFile_ |
Flag to enable/disable writing to file. More... | |
Private Attributes | |
const objectRegistry & | obr_ |
Reference to the database. More... | |
const word | prefix_ |
Prefix. More... | |
word | fileName_ |
Name of file. More... | |
autoPtr< OFstream > | filePtr_ |
File pointer. More... | |
label | writePrecision_ |
Write precision. More... | |
Base class for output file data handling.
Definition at line 57 of file functionObjectFile.H.
|
protected |
Disallow default bitwise copy construct.
functionObjectFile | ( | const objectRegistry & | obr, |
const word & | prefix | ||
) |
Construct null.
Definition at line 132 of file functionObjectFile.C.
functionObjectFile | ( | const objectRegistry & | obr, |
const word & | prefix, | ||
const word & | fileName, | ||
const dictionary & | dict | ||
) |
Construct from components and read options from dictionary.
Definition at line 147 of file functionObjectFile.C.
References dict, and Foam::read().
|
virtual |
Destructor.
Definition at line 172 of file functionObjectFile.C.
|
protectedvirtual |
Initialise the output stream for writing.
Definition at line 39 of file functionObjectFile.C.
References functionObjectFile::charWidth(), Ostream::precision(), Foam::scientific(), IOstream::setf(), Ostream::width(), and functionObjectFile::writePrecision_.
|
protectedvirtual |
Return the base directory for output.
Definition at line 47 of file functionObjectFile.C.
References polyMesh::defaultRegion, mesh, fvMesh::name(), UPstream::parRun(), and fileName::path().
|
protectedvirtual |
Return the base directory for the current time value.
Definition at line 76 of file functionObjectFile.C.
|
protectedvirtual |
Return an autoPtr to a new file.
Definition at line 83 of file functionObjectFile.C.
References IOstream::good(), UPstream::master(), Foam::mkDir(), Foam::name(), and autoPtr::set().
Referenced by forceCoeffs::createFiles().
|
protectedvirtual |
Reset internal file pointer to new file with new name.
Definition at line 116 of file functionObjectFile.C.
|
protectedvirtual |
Return the value width when writing to stream with optional offset.
Definition at line 123 of file functionObjectFile.C.
References IOstream::defaultPrecision(), and Foam::setw().
|
protected |
Disallow default bitwise assignment.
void read | ( | const dictionary & | dict | ) |
Read.
Definition at line 178 of file functionObjectFile.C.
References IOstream::defaultPrecision(), dict, dictionary::lookupOrDefault(), and UPstream::master().
Referenced by residuals::read(), DESModelRegions::read(), fieldValue::read(), cloudInfo::read(), yPlus::read(), valueAverage::read(), wallShearStress::read(), blendingFactor::read(), fieldValueDelta::read(), fieldMinMax::read(), fluxSummary::read(), regionSizeDistribution::read(), and forces::read().
Foam::OFstream & file | ( | ) |
Return access to the file (if only 1)
Definition at line 189 of file functionObjectFile.C.
References FatalErrorInFunction, and Foam::Snull.
Referenced by blendingFactor::calc(), and residuals::writeResidual().
bool writeToFile | ( | ) | const |
Return true if can write to file.
Definition at line 206 of file functionObjectFile.C.
Referenced by forceCoeffs::createFiles().
Write a commented string to stream.
Definition at line 219 of file functionObjectFile.C.
References Foam::setw().
Referenced by residuals::writeFileHeader(), DESModelRegions::writeFileHeader(), yPlus::writeFileHeader(), cloudInfo::writeFileHeader(), wallShearStress::writeFileHeader(), valueAverage::writeFileHeader(), blendingFactor::writeFileHeader(), fieldValueDelta::writeFileHeader(), and fieldMinMax::writeFileHeader().
Write a tabbed string to stream.
Definition at line 230 of file functionObjectFile.C.
References Foam::setw(), and Foam::tab.
Referenced by residuals::writeFileHeader(), DESModelRegions::writeFileHeader(), yPlus::writeFileHeader(), cloudInfo::writeFileHeader(), wallShearStress::writeFileHeader(), valueAverage::writeFileHeader(), blendingFactor::writeFileHeader(), and fieldMinMax::writeFileHeader().
Write a commented header to stream.
Definition at line 240 of file functionObjectFile.C.
References Foam::nl, Foam::setf(), and Foam::setw().
Referenced by residuals::writeFileHeader(), DESModelRegions::writeFileHeader(), yPlus::writeFileHeader(), cloudInfo::writeFileHeader(), wallShearStress::writeFileHeader(), valueAverage::writeFileHeader(), blendingFactor::writeFileHeader(), and fieldMinMax::writeFileHeader().
void writeTime | ( | Ostream & | os | ) | const |
Write the current time to stream.
Definition at line 250 of file functionObjectFile.C.
References Foam::setw().
Write a (commented) header property and value pair.
Definition at line 32 of file functionObjectFileTemplates.C.
References Foam::nl, Foam::setf(), and Foam::setw().
Referenced by fieldValueDelta::writeFileHeader().
Foam::label charWidth | ( | ) | const |
Return width of character stream output.
Definition at line 212 of file functionObjectFile.C.
References IOstream::defaultPrecision().
Referenced by functionObjectFile::initStream().
|
private |
Reference to the database.
Definition at line 64 of file functionObjectFile.H.
|
private |
Prefix.
Definition at line 67 of file functionObjectFile.H.
|
private |
Name of file.
Definition at line 70 of file functionObjectFile.H.
File pointer.
Definition at line 73 of file functionObjectFile.H.
|
private |
Write precision.
Definition at line 76 of file functionObjectFile.H.
Referenced by functionObjectFile::initStream().
|
protected |
Flag to enable/disable writing to file.
Definition at line 84 of file functionObjectFile.H.
|
static |
Directory prefix.
Definition at line 117 of file functionObjectFile.H.
|
static |
Additional characters for writing.
Definition at line 120 of file functionObjectFile.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.