writeFile Class Reference

functionObject base class for writing single files More...

Inheritance diagram for writeFile:
Collaboration diagram for writeFile:

Public Member Functions

 writeFile (const objectRegistry &obr, const word &prefix)
 Construct from objectRegistry and prefix. More...
 
 writeFile (const writeFile &)=delete
 Disallow default bitwise copy construction. More...
 
 ~writeFile ()
 Destructor. More...
 
void initStream (Ostream &os) const
 Initialise the output stream for writing. More...
 
fileName baseFileDir () const
 Return the base directory for output. More...
 
fileName baseTimeDir () const
 Return the base directory for the current time value. More...
 
Omanip< int > valueWidth (const label offset=0) const
 Return the value width when writing to stream with optional offset. 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...
 
void operator= (const writeFile &)=delete
 Disallow default bitwise assignment. More...
 

Static Public Attributes

static const word outputPrefix
 Directory prefix. More...
 
static label addChars = 8
 Additional characters for writing. More...
 

Protected Attributes

const objectRegistryfileObr_
 Reference to the region objectRegistry. More...
 
const word prefix_
 Prefix. More...
 

Detailed Description

functionObject base class for writing single files

See also
Foam::functionObject Foam::functionObjects::logFiles
Source files

Definition at line 55 of file writeFile.H.

Constructor & Destructor Documentation

◆ writeFile() [1/2]

writeFile ( const objectRegistry obr,
const word prefix 
)

Construct from objectRegistry and prefix.

Definition at line 84 of file writeFile.C.

◆ writeFile() [2/2]

writeFile ( const writeFile )
delete

Disallow default bitwise copy construction.

◆ ~writeFile()

~writeFile ( )

Destructor.

Definition at line 97 of file writeFile.C.

Member Function Documentation

◆ initStream()

void initStream ( Ostream os) const

Initialise the output stream for writing.

Definition at line 42 of file writeFile.C.

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

Referenced by logFiles::createFiles(), and logFile::logFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ baseFileDir()

Foam::fileName baseFileDir ( ) const

Return the base directory for output.

Definition at line 49 of file writeFile.C.

References polyMesh::defaultRegion, and IOobject::name().

Referenced by logFiles::createFiles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ baseTimeDir()

Foam::fileName baseTimeDir ( ) const

Return the base directory for the current time value.

Definition at line 67 of file writeFile.C.

References fileName::name().

Here is the call graph for this function:

◆ valueWidth()

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

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

Definition at line 73 of file writeFile.C.

References IOstream::defaultPrecision(), Foam::offset(), and Foam::setw().

Here is the call graph for this function:

◆ writeCommented()

void writeCommented ( Ostream os,
const string str 
) const

Write a commented string to stream.

Definition at line 109 of file writeFile.C.

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

Referenced by fvCellSet::writeFileHeader(), fieldValueDelta::writeFileHeader(), wallHeatTransferCoeff::writeFileHeader(), forceCoeffs::writeFileHeader(), and cloudInfo::writeFileHeader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeTabbed()

void writeTabbed ( Ostream os,
const string str 
) const

Write a tabbed string to stream.

Definition at line 120 of file writeFile.C.

References Foam::setw(), and Foam::tab.

Referenced by wallHeatTransferCoeff::writeFileHeader(), forceCoeffs::writeFileHeader(), cloudInfo::writeFileHeader(), and residuals::writeFileHeader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeHeader()

void writeHeader ( Ostream os,
const string str 
) const

Write a commented header to stream.

Definition at line 130 of file writeFile.C.

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

Referenced by wallHeatTransferCoeff::writeFileHeader(), forceCoeffs::writeFileHeader(), and cloudInfo::writeFileHeader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeTime()

void writeTime ( Ostream os) const

Write the current time to stream.

Definition at line 141 of file writeFile.C.

References Foam::setw().

Referenced by logFile::writeTime().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeHeaderValue()

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

Write a (commented) header property and value pair.

Definition at line 29 of file writeFileTemplates.C.

References writeFile::charWidth(), Foam::endl(), Foam::setf(), and Foam::setw().

Referenced by fvCellSet::writeFileHeader(), fieldValueDelta::writeFileHeader(), and forceCoeffs::writeFileHeader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ charWidth()

Foam::label charWidth ( ) const

Return width of character stream output.

Definition at line 103 of file writeFile.C.

References IOstream::defaultPrecision().

Referenced by writeFile::initStream(), logFile::write(), and writeFile::writeHeaderValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

void operator= ( const writeFile )
delete

Disallow default bitwise assignment.

Member Data Documentation

◆ fileObr_

const objectRegistry& fileObr_
protected

Reference to the region objectRegistry.

Definition at line 63 of file writeFile.H.

Referenced by logFiles::createFiles().

◆ prefix_

const word prefix_
protected

Prefix.

Definition at line 66 of file writeFile.H.

Referenced by logFiles::createFiles().

◆ outputPrefix

◆ addChars

Foam::label addChars = 8
static

Additional characters for writing.

Definition at line 75 of file writeFile.H.


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