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 85 of file writeFile.C.

Referenced by writeFile::valueWidth().

Here is the caller graph for this function:

◆ 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().

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, writeFile::fileObr_, TimePaths::globalPath(), mesh, IOobject::name(), writeFile::outputPrefix, and objectRegistry::time().

Referenced by writeFile::baseTimeDir(), logFiles::createFiles(), and surfaceFieldValue::outputDir().

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 writeFile::baseFileDir(), writeFile::fileObr_, writeFile::prefix_, objectRegistry::time(), Time::timeName(), and writeFile::valueWidth().

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 74 of file writeFile.C.

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

Referenced by writeFile::baseTimeDir().

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

◆ writeCommented()

void writeCommented ( Ostream os,
const string str 
) const

Write a commented string to stream.

Definition at line 110 of file writeFile.C.

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

Referenced by writeFile::charWidth(), and volRegion::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 121 of file writeFile.C.

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

Referenced by writeFile::writeCommented(), 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 131 of file writeFile.C.

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

Referenced by writeFile::writeTabbed().

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 writeFile::charWidth(), writeFile::fileObr_, Foam::setw(), objectRegistry::time(), and Time::timeName().

Here is the call 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 30 of file writeFileTemplates.C.

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

Referenced by volRegion::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 writeFile::addChars, IOstream::defaultPrecision(), and writeFile::writeCommented().

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

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 writeFile::baseFileDir(), writeFile::baseTimeDir(), logFiles::createFiles(), and writeFile::writeTime().

◆ prefix_

const word prefix_
protected

Prefix.

Definition at line 66 of file writeFile.H.

Referenced by writeFile::baseTimeDir(), and logFiles::createFiles().

◆ outputPrefix

const Foam::word outputPrefix
static

◆ addChars

Foam::label addChars = 8
static

Additional characters for writing.

Definition at line 75 of file writeFile.H.

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


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