functionObject base class for creating, maintaining and writing log files e.g. integrated or averaged field data vs time. More...
#include <logFiles.H>


Public Member Functions | |
| logFiles (const objectRegistry &obr, const word &prefix) | |
| Construct from objectRegistry and prefix. | |
| logFiles (const objectRegistry &obr, const word &prefix, const dictionary &dict) | |
| Construct from objectRegistry and prefix, and read options. | |
| virtual | ~logFiles ()=default |
| Destructor. | |
| const wordList & | names () const |
| Return const access to the names. | |
| PtrList< OFstream > & | files () |
| Return access to the files. | |
| OFstream & | files (const label i) |
| Return file 'i'. | |
| virtual bool | write () |
| Write function. | |
| Public Member Functions inherited from writeFile | |
| writeFile (const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true, const string &ext=".dat") | |
| Construct from objectRegistry, prefix, fileName. | |
| writeFile (const objectRegistry &obr, const fileName &prefix, const word &name, const dictionary &dict, const bool writeToFile=true, const string &ext=".dat") | |
| Construct from objectRegistry, prefix, fileName and read options from dictionary. | |
| writeFile (const writeFile &wf) | |
| Construct copy. | |
| virtual | ~writeFile ()=default |
| Destructor. | |
| virtual bool | read (const dictionary &dict) |
| Read. | |
| virtual const string & | setExt (const string &ext) |
| Set extension. | |
| virtual OFstream & | file () |
| Return access to the file (if only 1). | |
| virtual bool | writeToFile () const |
| Flag to allow writing to file. | |
| virtual bool | canWriteToFile () const |
| Flag to allow writing to the file. | |
| virtual bool | canResetFile () const |
| Flag to allow resetting the file. | |
| virtual bool | canWriteHeader () const |
| Flag to allow writing the header. | |
| virtual label | charWidth () const |
| Return width of character stream output. | |
| virtual void | writeCommented (Ostream &os, const string &str) const |
| Write a commented string to stream. | |
| virtual void | writeTabbed (Ostream &os, const string &str) const |
| Write a tabbed string to stream. | |
| virtual void | writeHeader (Ostream &os, const string &str) const |
| Write a commented header to stream. | |
| virtual void | writeCurrentTime (Ostream &os) const |
| Write the current time to stream. | |
| virtual void | writeBreak (Ostream &os) const |
| Write a break marker to the stream. | |
| template<class Type> | |
| void | writeHeaderValue (Ostream &os, const string &property, const Type &value) const |
| Write a (commented) header property and value pair. | |
| template<class Type> | |
| void | writeValue (Ostream &os, const Type &val) const |
| Write a given value to stream with the space delimiter. | |
Protected Member Functions | |
| virtual void | createFiles () |
| Create the output file. | |
| virtual void | resetNames (const wordList &names) |
| Reset the list of names from a wordList. | |
| virtual void | resetName (const word &name) |
| Reset the list of names to a single name entry. | |
| Protected Member Functions inherited from writeFile | |
| void | initStream (Ostream &os) const |
| Initialise the output stream for writing. | |
| fileName | baseFileDir () const |
| Return the base directory for output. | |
| fileName | baseTimeDir () const |
| Return the base directory for the current time value. | |
| fileName | filePath (const fileName &fName) const |
| Return the full path for the supplied file name. | |
| virtual autoPtr< OFstream > | newFile (const fileName &fName) const |
| Return autoPtr to a new file using file name. | |
| virtual autoPtr< OFstream > | newFileAtTime (const word &name, scalar timeValue) const |
| Return autoPtr to a new file for a given time. | |
| virtual autoPtr< OFstream > | newFileAtStartTime (const word &name) const |
| Return autoPtr to a new file using the simulation start time. | |
| virtual void | resetFile (const word &name) |
| Reset internal file pointer to new file with new name. | |
| Omanip< int > | valueWidth (const label offset=0) const |
| Return the value width when writing to stream with optional offset. | |
| void | operator= (const writeFile &)=delete |
| No copy assignment. | |
| virtual autoPtr< OFstream > | createFile (const word &name, scalar timeValue) const |
| Deprecated(2022-09) Return autoPtr to a new file for a given time. | |
| virtual autoPtr< OFstream > | createFile (const word &name) const |
| Deprecated(2022-09) Return autoPtr to a new file using the simulation start time. | |
Protected Attributes | |
| wordList | names_ |
| File names. | |
| PtrList< OFstream > | filePtrs_ |
| File pointer. | |
| Protected Attributes inherited from writeFile | |
| const objectRegistry & | fileObr_ |
| Reference to the region objectRegistry. | |
| const fileName | prefix_ |
| Prefix. | |
| word | fileName_ |
| Name of file. | |
| autoPtr< OFstream > | filePtr_ |
| File pointer. | |
| label | writePrecision_ |
| Write precision. | |
| bool | writeToFile_ |
| Flag to enable/disable writing to file. | |
| bool | updateHeader_ |
| Flag to update the header, e.g. on mesh changes. Default is true. | |
| bool | writtenHeader_ |
| Flag to identify whether the header has been written. | |
| bool | useUserTime_ |
| Flag to use the specified user time, e.g. CA deg instead of seconds. Default = true. | |
| scalar | startTime_ |
| Start time value. | |
| string | ext_ |
| File extension; default = .dat. | |
Additional Inherited Members | |
| Static Public Attributes inherited from writeFile | |
| static label | addChars = 8 |
| Additional characters for writing. | |
functionObject base class for creating, maintaining and writing log files e.g. integrated or averaged field data vs time.
Definition at line 55 of file logFiles.H.
| logFiles | ( | const objectRegistry & | obr, |
| const word & | prefix ) |
Construct from objectRegistry and prefix.
Definition at line 74 of file logFiles.C.
References filePtrs_, names_, and writeFile::writeFile().

| logFiles | ( | const objectRegistry & | obr, |
| const word & | prefix, | ||
| const dictionary & | dict ) |
Construct from objectRegistry and prefix, and read options.
from dictionary
Definition at line 86 of file logFiles.C.
References dict, filePtrs_, names_, writeFile::read(), and writeFile::writeFile().

|
virtualdefault |
Destructor.
|
protectedvirtual |
Create the output file.
Definition at line 28 of file logFiles.C.
References writeFile::fileObr_, filePtrs_, forAll, writeFile::initStream(), UPstream::master(), names_, and writeFile::newFileAtStartTime().
Referenced by resetNames(), and write().


|
protectedvirtual |
Reset the list of names from a wordList.
Definition at line 48 of file logFiles.C.
References createFiles(), filePtrs_, UPstream::master(), names(), and names_.
Referenced by interfaceHeight::interfaceHeight(), and cloudInfo::read().


|
protectedvirtual |
Reset the list of names to a single name entry.
Definition at line 63 of file logFiles.C.
References Foam::name(), names_, and writeFile::resetFile().

| const Foam::wordList & names | ( | ) | const |
Return const access to the names.
Definition at line 103 of file logFiles.C.
References names_.
Referenced by resetNames().

| Foam::PtrList< Foam::OFstream > & files | ( | ) |
Return access to the files.
Definition at line 109 of file logFiles.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, filePtrs_, and UPstream::master().
Referenced by interfaceHeight::files(), cloudInfo::performAction(), cloudInfo::read(), and interfaceHeight::~interfaceHeight().


| Foam::OFstream & files | ( | const label | i | ) |
Return file 'i'.
Definition at line 122 of file logFiles.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, filePtrs_, and UPstream::master().

|
virtual |
Write function.
Reimplemented in cloudInfo, and interfaceHeight.
Definition at line 142 of file logFiles.C.
References createFiles().
Referenced by interfaceHeight::write().


|
protected |
File names.
Definition at line 67 of file logFiles.H.
Referenced by createFiles(), logFiles(), logFiles(), names(), resetName(), and resetNames().
File pointer.
Definition at line 72 of file logFiles.H.
Referenced by createFiles(), files(), files(), logFiles(), logFiles(), and resetNames().