34 namespace functionObjects
60 cpuTime0_(time_.elapsedCpuTime()),
61 clockTime0_(time_.elapsedClockTime())
79 dict.readIfPresent(
"perTimeStep", perTimeStep_);
92 writeCommented(
file(),
"Time");
93 writeTabbed(
file(),
"cpu");
94 writeTabbed(
file(),
"clock");
98 writeTabbed(
file(),
"cpu/step");
99 writeTabbed(
file(),
"clock/step");
121 const scalar
cpuTime(time_.elapsedCpuTime());
122 const scalar
clockTime(time_.elapsedClockTime());
124 file() <<
tab << time_.elapsedCpuTime();
125 file() <<
tab << time_.elapsedClockTime();
129 file() <<
tab << time_.elapsedCpuTime() - cpuTime0_;
130 file() <<
tab << time_.elapsedClockTime() - clockTime0_;
Macros for easy insertion into run-time selection tables.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static bool master(const label communicator=0)
Am I the master process.
Starts timing (using rtc) and returns elapsed time from start. Better resolution (2uSec instead of ~2...
Starts timing CPU usage and return elapsed time from start.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Abstract base-class for Time/database functionObjects.
virtual bool read(const dictionary &)
Read and set the functionObject if its data have changed.
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...
virtual bool write()
Write function.
Specialisation of Foam::functionObject for a region and providing a reference to the region Foam::obj...
Writes run time, CPU time and clock time and optionally the CPU and clock times per time step.
virtual ~time()
Destructor.
time(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual void writeFileHeader(const label i)
Output file header information.
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Write the time.
virtual bool read(const dictionary &)
Read the controls.
A class for handling words, derived from string.
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
void writeHeader(std::ostream &, const bool isBinary, const std::string &title)
Write header.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.