timeInfo Class Reference

Writes the run time (time-step), cpuTime and clockTime - optionally with cpuTime and clockTime change for each time step. More...

Inheritance diagram for timeInfo:
[legend]
Collaboration diagram for timeInfo:
[legend]

Public Member Functions

 TypeName ("timeInfo")
 Runtime type information. More...
 
 timeInfo (const word &name, const Time &runTime, const dictionary &dict)
 Construct from Time and dictionary. More...
 
virtual ~timeInfo ()=default
 Destructor. More...
 
virtual bool read (const dictionary &dict)
 Read the controls. More...
 
virtual bool execute ()
 Execute, does nothing. More...
 
virtual bool write ()
 Write the timeInfo. More...
 
- Public Member Functions inherited from timeFunctionObject
 timeFunctionObject (const word &name, const Time &runTime)
 Construct from Time. More...
 
virtual ~timeFunctionObject ()=default
 Destructor. More...
 
const Timetime () const
 Return time database. More...
 
objectRegistrystoredObjects ()
 
const objectRegistrystoredObjects () const
 
- Public Member Functions inherited from functionObject
 declareRunTimeSelectionTable (autoPtr, functionObject, dictionary,(const word &name, const Time &runTime, const dictionary &dict),(name, runTime, dict))
 
 functionObject (const word &name, const bool withNamePrefix=defaultUseNamePrefix)
 Construct from components. More...
 
autoPtr< functionObjectclone () const
 Return clone. More...
 
virtual ~functionObject ()=default
 Destructor. More...
 
virtual const wordtype () const =0
 Runtime type information. More...
 
const wordname () const noexcept
 Return the name of this functionObject. More...
 
bool useNamePrefix () const noexcept
 Return the flag for adding a scoping name prefix. More...
 
bool useNamePrefix (bool on) noexcept
 Modify the flag for adding a scoping name prefix. More...
 
virtual bool execute (const label subIndex)
 Execute using the specified subIndex. More...
 
virtual bool end ()
 Called when Time::run() determines that the time-loop exits. More...
 
virtual bool adjustTimeStep ()
 Called at the end of Time::adjustDeltaT() if adjustTime is true. More...
 
virtual bool filesModified () const
 Did any file get changed during execution? More...
 
virtual void updateMesh (const mapPolyMesh &mpm)
 Update for changes of mesh. More...
 
virtual void movePoints (const polyMesh &mesh)
 Update for changes of mesh. More...
 
- Public Member Functions inherited from writeFile
 writeFile (const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true)
 Construct from objectRegistry, prefix, fileName. More...
 
 writeFile (const objectRegistry &obr, const fileName &prefix, const word &name, const dictionary &dict, const bool writeToFile=true)
 
 writeFile (const writeFile &wf)
 Construct copy. More...
 
virtual ~writeFile ()=default
 Destructor. More...
 
virtual OFstreamfile ()
 Return access to the file (if only 1) More...
 
virtual bool writeToFile () const
 Flag to allow writing to file. More...
 
virtual bool canWriteHeader () const
 Flag to allow writing the header. More...
 
virtual label charWidth () const
 Return width of character stream output. More...
 
virtual void writeCommented (Ostream &os, const string &str) const
 Write a commented string to stream. More...
 
virtual void writeTabbed (Ostream &os, const string &str) const
 Write a tabbed string to stream. More...
 
virtual void writeHeader (Ostream &os, const string &str) const
 Write a commented header to stream. More...
 
virtual void writeCurrentTime (Ostream &os) const
 Write the current time to stream. More...
 
virtual void writeBreak (Ostream &os) const
 Write a break marker to the 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...
 

Protected Member Functions

virtual void writeFileHeader (Ostream &os)
 Output file header information. More...
 
 timeInfo (const timeInfo &)=delete
 No copy construct. More...
 
void operator= (const timeInfo &)=delete
 No copy assignment. More...
 
- Protected Member Functions inherited from timeFunctionObject
void clearOutputObjects (const wordList &objNames)
 Remove specified items from "functionObjectObjects". More...
 
 timeFunctionObject (const timeFunctionObject &)=delete
 No copy construct. More...
 
void operator= (const timeFunctionObject &)=delete
 No copy assignment. More...
 
- Protected Member Functions inherited from functionObject
word scopedName (const word &name) const
 Return a scoped (prefixed) name. More...
 
- Protected Member Functions inherited from writeFile
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...
 
virtual autoPtr< OFstreamcreateFile (const word &name, scalar timeValue) const
 Return autoPtr to a new file for a given time. More...
 
virtual autoPtr< OFstreamcreateFile (const word &name) const
 Return autoPtr to a new file using the simulation start time. More...
 
virtual void resetFile (const word &name)
 Reset internal file pointer to new file with new name. More...
 
Omanip< int > valueWidth (const label offset=0) const
 Return the value width when writing to stream with optional offset. More...
 
void operator= (const writeFile &)=delete
 No copy assignment. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from functionObject
static autoPtr< functionObjectNew (const word &name, const Time &runTime, const dictionary &dict)
 Select from dictionary, based on its "type" entry. More...
 
- Public Attributes inherited from functionObject
bool log
 Flag to write log into Info. More...
 
- Static Public Attributes inherited from functionObject
static int debug
 Flag to execute debug content. More...
 
static bool postProcess
 Global post-processing mode switch. More...
 
static bool defaultUseNamePrefix
 Global default for useNamePrefix. More...
 
static word outputPrefix
 Directory prefix. More...
 
- Static Public Attributes inherited from writeFile
static label addChars = 8
 Additional characters for writing. More...
 
- Protected Attributes inherited from timeFunctionObject
const Timetime_
 Reference to the time database. More...
 
- Protected Attributes inherited from writeFile
const objectRegistryfileObr_
 Reference to the region objectRegistry. More...
 
const fileName prefix_
 Prefix. More...
 
word fileName_
 Name of file. More...
 
autoPtr< OFstreamfilePtr_
 File pointer. More...
 
label writePrecision_
 Write precision. More...
 
bool writeToFile_
 Flag to enable/disable writing to file. More...
 
bool updateHeader_
 
bool writtenHeader_
 Flag to identify whether the header has been written. More...
 
bool useUserTime_
 
scalar startTime_
 Start time value. More...
 

Detailed Description

Writes the run time (time-step), cpuTime and clockTime - optionally with cpuTime and clockTime change for each time step.

Example of function object specification:

time
{
    type            timeInfo;
    libs            (utilityFunctionObjects);

    writeControl    timeStep;
    writeInterval   1;

    perTimeStep     no;
}

Where the entries comprise:

Property Description Required Default
type Type name: timeInfo yes
writeToFile Write information to file no yes
perTimeStep Write value per interval/step no no

The initial per-step value is likely to be inaccurate and should mostly be ignored.

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

Definition at line 105 of file timeInfo.H.

Constructor & Destructor Documentation

◆ timeInfo() [1/2]

timeInfo ( const timeInfo )
protecteddelete

No copy construct.

◆ timeInfo() [2/2]

timeInfo ( const word name,
const Time runTime,
const dictionary dict 
)

Construct from Time and dictionary.

Definition at line 67 of file timeInfo.C.

References dict, and Foam::read().

Here is the call graph for this function:

◆ ~timeInfo()

virtual ~timeInfo ( )
virtualdefault

Destructor.

Member Function Documentation

◆ writeFileHeader()

void writeFileHeader ( Ostream os)
protectedvirtual

Output file header information.

Definition at line 48 of file timeInfo.C.

References Foam::nl, os(), writeFile::writeCommented(), and writeFile::writeTabbed().

Here is the call graph for this function:

◆ operator=()

void operator= ( const timeInfo )
protecteddelete

No copy assignment.

◆ TypeName()

TypeName ( "timeInfo"  )

Runtime type information.

◆ read()

bool read ( const dictionary dict)
virtual

Read the controls.

Reimplemented from writeFile.

Definition at line 86 of file timeInfo.C.

References dict, writeFile::read(), and functionObject::read().

Here is the call graph for this function:

◆ execute()

bool execute ( )
virtual

Execute, does nothing.

Implements functionObject.

Definition at line 96 of file timeInfo.C.

◆ write()

bool write ( )
virtual

Write the timeInfo.

Implements functionObject.

Definition at line 102 of file timeInfo.C.

References UPstream::master(), Foam::nl, and Foam::tab.

Here is the call graph for this function:

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