Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
logFiles Class Referenceabstract

functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged field data vs time. More...

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

Public Member Functions

 logFiles (const objectRegistry &obr, const word &prefix)
 Construct from objectRegistry and prefix. More...
 
virtual ~logFiles ()
 Destructor. More...
 
const wordListnames () const
 Return const access to the names. More...
 
PtrList< OFstream > & files ()
 Return access to the files. More...
 
OFstreamfile ()
 Return access to the file (if only 1) More...
 
OFstreamfile (const label i)
 Return file 'i'. More...
 
virtual bool write ()
 Write function. More...
 
- Public Member Functions inherited from writeFile
 writeFile (const objectRegistry &obr, const word &prefix)
 Construct from objectRegistry and prefix. 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...
 

Protected Member Functions

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

Protected Attributes

wordList names_
 File names. More...
 
PtrList< OFstreamfilePtrs_
 File pointer. More...
 
- Protected Attributes inherited from writeFile
const objectRegistryfileObr_
 Reference to the region objectRegistry. More...
 
const word prefix_
 Prefix. More...
 

Additional Inherited Members

- Static Public Attributes inherited from writeFile
static const word outputPrefix
 Directory prefix. More...
 
static label addChars = 8
 Additional characters for writing. More...
 

Detailed Description

functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged field data vs time.

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

Definition at line 57 of file logFiles.H.

Constructor & Destructor Documentation

◆ logFiles()

logFiles ( const objectRegistry obr,
const word prefix 
)

Construct from objectRegistry and prefix.

Definition at line 95 of file logFiles.C.

◆ ~logFiles()

~logFiles ( )
virtual

Destructor.

Definition at line 108 of file logFiles.C.

Member Function Documentation

◆ createFiles()

void createFiles ( )
protectedvirtual

◆ resetNames()

void resetNames ( const wordList names)
protectedvirtual

Reset the list of names from a wordList.

Definition at line 66 of file logFiles.C.

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

Referenced by cloudInfo::read().

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

◆ resetName()

void resetName ( const word name)
protectedvirtual

Reset the list of names to a single name entry.

Definition at line 79 of file logFiles.C.

References List< T >::append(), List< T >::clear(), logFiles::filePtrs_, UPstream::master(), and logFiles::names_.

Here is the call graph for this function:

◆ writeFileHeader()

virtual void writeFileHeader ( const label  i = 0)
protectedpure virtual

◆ names()

const Foam::wordList & names ( ) const

Return const access to the names.

Definition at line 114 of file logFiles.C.

References logFiles::names_.

◆ files()

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

Return access to the files.

Definition at line 147 of file logFiles.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, logFiles::filePtrs_, and UPstream::master().

Here is the call graph for this function:

◆ file() [1/2]

Foam::OFstream & file ( )

Return access to the file (if only 1)

Definition at line 120 of file logFiles.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, logFiles::filePtrs_, UPstream::master(), and WarningInFunction.

Referenced by forces::file(), residuals::writeFileHeader(), and residuals::writeResidual().

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

◆ file() [2/2]

Foam::OFstream & file ( const label  i)

Return file 'i'.

Definition at line 160 of file logFiles.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, logFiles::filePtrs_, and UPstream::master().

Here is the call graph for this function:

◆ write()

bool write ( )
virtual

Member Data Documentation

◆ names_

wordList names_
protected

File names.

Definition at line 67 of file logFiles.H.

Referenced by logFiles::createFiles(), logFiles::names(), logFiles::resetName(), and logFiles::resetNames().

◆ filePtrs_

PtrList<OFstream> filePtrs_
protected

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