Opm::SimulatorTimer Class Reference

#include <SimulatorTimer.hpp>

Inheritance diagram for Opm::SimulatorTimer:
Inheritance graph

Public Member Functions

 SimulatorTimer ()
 Default constructor. More...
 
void init (const parameter::ParameterGroup &param)
 
void init (TimeMapConstPtr timeMap)
 Use the SimulatorTimer as a shim around opm-parser's Opm::TimeMap. More...
 
int numSteps () const
 Total number of steps. More...
 
int currentStepNum () const
 
void setCurrentStepNum (int step)
 Set current step number. More...
 
double currentStepLength () const
 
double stepLengthTaken () const
 
double simulationTimeElapsed () const
 
double totalTime () const
 Total time. More...
 
boost::posix_time::ptime startDateTime () const
 Return start date of simulation. More...
 
void setTotalTime (double time)
 
void report (std::ostream &os) const
 
SimulatorTimeroperator++ ()
 advance time by currentStepLength More...
 
void advance ()
 advance time by currentStepLength More...
 
bool done () const
 Return true if op++() has been called numSteps() times. More...
 
virtual int reportStepNum () const
 Current report step number. This might differ from currentStepNum in case of sub stepping. More...
 
virtual double reportStepLengthTaken () const
 
virtual boost::posix_time::ptime currentDateTime () const
 Return the current time as a posix time object. More...
 
virtual time_t currentPosixTime () const
 

Constructor & Destructor Documentation

Opm::SimulatorTimer::SimulatorTimer ( )

Default constructor.

Member Function Documentation

void Opm::SimulatorTimer::advance ( )
inlinevirtual

advance time by currentStepLength

Implements Opm::SimulatorTimerInterface.

References operator++().

virtual boost::posix_time::ptime Opm::SimulatorTimerInterface::currentDateTime ( ) const
inlinevirtualinherited
virtual time_t Opm::SimulatorTimerInterface::currentPosixTime ( ) const
inlinevirtualinherited

Time elapsed since the start of the POSIX epoch (Jan 1st, 1970) until the current time step begins [s].

References Opm::SimulatorTimerInterface::currentDateTime().

double Opm::SimulatorTimer::currentStepLength ( ) const
virtual

Current step length. This is the length of the step the simulator will take in the next iteration.

Note
if done(), it is an error to call currentStepLength().

Implements Opm::SimulatorTimerInterface.

Referenced by Opm::AdaptiveTimeStepping::stepImpl().

int Opm::SimulatorTimer::currentStepNum ( ) const
virtual

Current step number. This is the number of timesteps that has been completed from the start of the run. The time after initialization but before the simulation has started is timestep number zero.

Implements Opm::SimulatorTimerInterface.

bool Opm::SimulatorTimer::done ( ) const
virtual

Return true if op++() has been called numSteps() times.

Implements Opm::SimulatorTimerInterface.

void Opm::SimulatorTimer::init ( const parameter::ParameterGroup param)

Initialize from parameters. Accepts the following: num_psteps (default 1) stepsize_days (default 1)

void Opm::SimulatorTimer::init ( TimeMapConstPtr  timeMap)

Use the SimulatorTimer as a shim around opm-parser's Opm::TimeMap.

int Opm::SimulatorTimer::numSteps ( ) const

Total number of steps.

SimulatorTimer& Opm::SimulatorTimer::operator++ ( )

advance time by currentStepLength

Referenced by advance().

void Opm::SimulatorTimer::report ( std::ostream &  os) const

Print a report with current and total time etc. Note: if done(), it is an error to call report().

virtual double Opm::SimulatorTimerInterface::reportStepLengthTaken ( ) const
inlinevirtualinherited

Previous report step length. This is the length of the step that was taken to arrive at this report step time.

Note
if no increments have been done (i.e. the timer is still in its constructed state and reportStepNum() == 0), it is an error to call stepLengthTaken().

References Opm::SimulatorTimerInterface::stepLengthTaken().

virtual int Opm::SimulatorTimerInterface::reportStepNum ( ) const
inlinevirtualinherited

Current report step number. This might differ from currentStepNum in case of sub stepping.

Reimplemented in Opm::AdaptiveSimulatorTimer.

References Opm::SimulatorTimerInterface::currentStepNum().

void Opm::SimulatorTimer::setCurrentStepNum ( int  step)

Set current step number.

void Opm::SimulatorTimer::setTotalTime ( double  time)

Set total time. This is primarily intended for multi-epoch schedules, where a timer for a given epoch does not have access to later timesteps.

double Opm::SimulatorTimer::simulationTimeElapsed ( ) const
virtual

Time elapsed since the start of the simulation until the beginning of the current time step [s].

Implements Opm::SimulatorTimerInterface.

boost::posix_time::ptime Opm::SimulatorTimer::startDateTime ( ) const
virtual

Return start date of simulation.

Implements Opm::SimulatorTimerInterface.

double Opm::SimulatorTimer::stepLengthTaken ( ) const
virtual

Previous step length. This is the length of the step that was taken to arrive at this time.

Note
if no increments have been done (i.e. the timer is still in its constructed state and currentStepNum() == 0), it is an error to call stepLengthTaken().

Implements Opm::SimulatorTimerInterface.

double Opm::SimulatorTimer::totalTime ( ) const

Total time.


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