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

Base class for output file data handling. More...

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

Public Member Functions

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

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 void createFiles ()
 Create the output file. More...
 
virtual void writeFileHeader (const label i=0)
 File header information. More...
 
virtual void write ()
 Write function. 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...
 

Detailed Description

Base class for output file data handling.

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

Definition at line 57 of file functionObjectFile.H.

Constructor & Destructor Documentation

functionObjectFile ( const functionObjectFile )
protected

Disallow default bitwise copy construct.

Referenced by functionObjectFile::functionObjectFile(), and functionObjectFile::valueWidth().

Here is the caller graph for this function:

functionObjectFile ( const objectRegistry obr,
const word prefix 
)

Construct null.

Definition at line 165 of file functionObjectFile.C.

References functionObjectFile::functionObjectFile().

Here is the call graph for this function:

functionObjectFile ( const objectRegistry obr,
const word prefix,
const word name 
)

Construct from components.

Definition at line 178 of file functionObjectFile.C.

References List< T >::append(), List< T >::clear(), functionObjectFile::functionObjectFile(), and UPstream::master().

Here is the call graph for this function:

functionObjectFile ( const objectRegistry obr,
const word prefix,
const wordList names 
)

Construct from components.

Definition at line 202 of file functionObjectFile.C.

References List< T >::append(), List< T >::clear(), UPstream::master(), and List< T >::size().

Here is the call graph for this function:

~functionObjectFile ( )
virtual

Destructor.

Definition at line 227 of file functionObjectFile.C.

Member Function Documentation

void initStream ( Ostream os) const
protectedvirtual

Initialise the output stream for writing.

Definition at line 39 of file functionObjectFile.C.

References functionObjectFile::charWidth(), Foam::scientific(), IOstream::setf(), and Ostream::width().

Referenced by functionObjectFile::createFiles().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::fileName baseFileDir ( ) const
protectedvirtual

Return the base directory for output.

Definition at line 46 of file functionObjectFile.C.

References polyMesh::defaultRegion, mesh, IOobject::name(), functionObjectFile::outputPrefix, UPstream::parRun(), Time::path(), and objectRegistry::time().

Referenced by functionObjectFile::baseTimeDir(), functionObjectFile::createFiles(), and faceSource::writeValues().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::fileName baseTimeDir ( ) const
protectedvirtual

Return the base directory for the current time value.

Definition at line 75 of file functionObjectFile.C.

References functionObjectFile::baseFileDir(), objectRegistry::time(), and Time::timeName().

Here is the call graph for this function:

void createFiles ( )
protectedvirtual
void writeFileHeader ( const label  i = 0)
protectedvirtual

File header information.

Reimplemented in faceSource, cellSource, forces, forceCoeffs, fieldMinMax, fieldValueDelta, wallShearStress, cloudInfo, and residuals.

Definition at line 116 of file functionObjectFile.C.

Referenced by functionObjectFile::createFiles().

Here is the caller graph for this function:

void write ( )
protectedvirtual
void resetNames ( const wordList names)
protectedvirtual

Reset the list of names from a wordList.

Definition at line 126 of file functionObjectFile.C.

References List< T >::append(), List< T >::clear(), functionObjectFile::createFiles(), UPstream::master(), and List< T >::size().

Referenced by cloudInfo::read().

Here is the call graph for this function:

Here is the caller graph for this function:

void resetName ( const word name)
protectedvirtual

Reset the list of names to a single name entry.

Definition at line 141 of file functionObjectFile.C.

References List< T >::append(), List< T >::clear(), functionObjectFile::createFiles(), and UPstream::master().

Here is the call graph for this function:

Foam::Omanip< int > valueWidth ( const label  offset = 0) const
protectedvirtual

Return the value width when writing to stream with optional offset.

Definition at line 156 of file functionObjectFile.C.

References functionObjectFile::addChars, IOstream::defaultPrecision(), functionObjectFile::functionObjectFile(), and Foam::setw().

Here is the call graph for this function:

void operator= ( const functionObjectFile )
protected

Disallow default bitwise assignment.

const Foam::wordList & names ( ) const

Return const access to the names.

Definition at line 233 of file functionObjectFile.C.

Foam::OFstream & file ( )

Return access to the file (if only 1)

Definition at line 239 of file functionObjectFile.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorIn, UPstream::master(), and WarningIn.

Referenced by cellSource::writeValues(), and faceSource::writeValues().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::PtrList< Foam::OFstream > & files ( )

Return access to the files.

Definition at line 266 of file functionObjectFile.C.

References Foam::abort(), Foam::FatalError, FatalErrorIn, and UPstream::master().

Here is the call graph for this function:

Foam::OFstream & file ( const label  i)

Return file 'i'.

Definition at line 279 of file functionObjectFile.C.

References Foam::abort(), Foam::FatalError, FatalErrorIn, and UPstream::master().

Here is the call graph for this function:

void writeCommented ( Ostream os,
const string str 
) const

Write a commented string to stream.

Definition at line 309 of file functionObjectFile.C.

References functionObjectFile::charWidth(), Foam::setw(), and functionObjectFile::writeTabbed().

Referenced by functionObjectFile::charWidth().

Here is the call graph for this function:

Here is the caller graph for this function:

void writeTabbed ( Ostream os,
const string str 
) const

Write a tabbed string to stream.

Definition at line 320 of file functionObjectFile.C.

References functionObjectFile::charWidth(), Foam::setw(), Foam::tab, and functionObjectFile::writeHeader().

Referenced by functionObjectFile::writeCommented().

Here is the call graph for this function:

Here is the caller graph for this function:

void writeHeader ( Ostream os,
const string str 
) const

Write a commented header to stream.

Definition at line 330 of file functionObjectFile.C.

References functionObjectFile::charWidth(), Foam::nl, Foam::setf(), and Foam::setw().

Referenced by functionObjectFile::writeTabbed().

Here is the call graph for this function:

Here is the caller graph for this function:

void writeHeaderValue ( Ostream os,
const string property,
const Type &  value 
) const

Write a (commented) header property and value pair.

Definition at line 32 of file functionObjectFileTemplates.C.

References Foam::nl, Foam::setf(), and Foam::setw().

Here is the call graph for this function:

Foam::label charWidth ( ) const

Return width of character stream output.

Definition at line 302 of file functionObjectFile.C.

References functionObjectFile::addChars, IOstream::defaultPrecision(), and functionObjectFile::writeCommented().

Referenced by functionObjectFile::initStream(), functionObjectFile::writeCommented(), functionObjectFile::writeHeader(), and functionObjectFile::writeTabbed().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

const Foam::word outputPrefix = "postProcessing"
static

Directory prefix.

Definition at line 115 of file functionObjectFile.H.

Referenced by functionObjectFile::baseFileDir().

Foam::label addChars = 7
static

Additional characters for writing.

Definition at line 118 of file functionObjectFile.H.

Referenced by functionObjectFile::charWidth(), and functionObjectFile::valueWidth().


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