All Classes Namespaces Files Functions Variables Typedefs Enumerator Pages
Opm::SimulatorTimer Class Reference
Inheritance diagram for Opm::SimulatorTimer:
Opm::SimulatorTimerInterface

Public Member Functions

 SimulatorTimer ()
 Default constructor.
 
void init (const ParameterGroup &param)
 Initialize from parameters. More...
 
void init (const TimeMap &timeMap, size_t report_step=0)
 Use the SimulatorTimer as a shim around opm-parser's Opm::TimeMap.
 
bool initialStep () const
 Whether the current step is the first step.
 
int numSteps () const
 Total number of steps.
 
int currentStepNum () const
 Current step number. More...
 
void setCurrentStepNum (int step)
 Set current step number.
 
double currentStepLength () const
 Current step length. More...
 
double stepLengthTaken () const
 Previous step length. More...
 
double simulationTimeElapsed () const
 Time elapsed since the start of the simulation until the beginning of the current time step [s]. More...
 
double totalTime () const
 Total time.
 
boost::posix_time::ptime startDateTime () const
 Return start date of simulation.
 
boost::posix_time::ptime currentDateTime () const
 Return current date.
 
void setTotalTime (double time)
 Set total time. More...
 
void report (std::ostream &os) const
 Print a report with current and total time etc. More...
 
SimulatorTimeroperator++ ()
 advance time by currentStepLength More...
 
void advance ()
 advance time by currentStepLength
 
bool done () const
 Return true if op++() has been called numSteps() times.
 
bool lastStepFailed () const
 Always return false. More...
 
virtual std::unique_ptr
< SimulatorTimerInterface
clone () const
 return copy of object
 
- Public Member Functions inherited from Opm::SimulatorTimerInterface
virtual ~SimulatorTimerInterface ()
 destructor
 
virtual int reportStepNum () const
 Current report step number. This might differ from currentStepNum in case of sub stepping.
 
virtual double reportStepLengthTaken () const
 Previous report step length. More...
 
virtual time_t currentPosixTime () const
 Time elapsed since the start of the POSIX epoch (Jan 1st, 1970) until the current time step begins [s]. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Opm::SimulatorTimerInterface
 SimulatorTimerInterface ()
 Default constructor, protected to not allow explicit instances of this class.
 

Member Function Documentation

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.

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.

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

Initialize from parameters.

Accepts the following: num_psteps (default 1) stepsize_days (default 1)

bool Opm::SimulatorTimer::lastStepFailed ( ) const
inlinevirtual

Always return false.

Timestep failures is handled in the substepTimer

Implements Opm::SimulatorTimerInterface.

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

advance time by currentStepLength

Next step.

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().

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].

time elapsed since the start of the simulation [s].

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.


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