#include <SimulatorTimer.hpp>

Inheritance diagram for Opm::SimulatorTimer:
Inheritance graph

Public Member Functions

 SimulatorTimer ()
 Default constructor. More...
 
void init (const ParameterGroup &param)
 
void init (const Schedule &schedule, std::size_t report_step=0)
 Use the SimulatorTimer as a shim around opm-commons Schedule class. More...
 
bool initialStep () const override
 Whether the current step is the first step. More...
 
int numSteps () const
 Total number of steps. More...
 
int currentStepNum () const override
 
void setCurrentStepNum (int step)
 Set current step number. More...
 
double currentStepLength () const override
 
double stepLengthTaken () const override
 
double simulationTimeElapsed () const override
 
double totalTime () const
 Total time. More...
 
boost::posix_time::ptime startDateTime () const override
 Return start date of simulation. More...
 
void setTotalTime (double time)
 
void report (std::ostream &os) const
 
SimulatorTimeroperator++ ()
 advance time by currentStepLength More...
 
void advance () override
 advance time by currentStepLength More...
 
bool done () const override
 Return true if op++() has been called numSteps() times. More...
 
bool lastStepFailed () const override
 
std::unique_ptr< SimulatorTimerInterfaceclone () const override
 return copy of object More...
 
template<class Serializer >
void serializeOp (Serializer &serializer)
 
bool operator== (const SimulatorTimer &rhs) const
 
virtual boost::posix_time::ptime currentDateTime () const
 Return the current time as a posix time object. More...
 
virtual time_t currentPosixTime () const
 
virtual int reportStepNum () const
 Current report step number. This might differ from currentStepNum in case of sub stepping. More...
 
virtual double reportStepLengthTaken () const
 

Static Public Member Functions

static SimulatorTimer serializationTestObject ()
 

Constructor & Destructor Documentation

◆ SimulatorTimer()

Opm::SimulatorTimer::SimulatorTimer ( )

Default constructor.

Member Function Documentation

◆ advance()

void Opm::SimulatorTimer::advance ( )
inlineoverridevirtual

advance time by currentStepLength

Implements Opm::SimulatorTimerInterface.

References operator++().

◆ clone()

std::unique_ptr< SimulatorTimerInterface > Opm::SimulatorTimer::clone ( ) const
overridevirtual

return copy of object

Implements Opm::SimulatorTimerInterface.

◆ currentDateTime()

virtual boost::posix_time::ptime Opm::SimulatorTimerInterface::currentDateTime ( ) const
virtual

Return the current time as a posix time object.

Reimplemented from Opm::SimulatorTimerInterface.

Referenced by Opm::EclWriter< TypeTag >::writeOutput().

◆ currentPosixTime()

virtual time_t Opm::SimulatorTimerInterface::currentPosixTime ( ) const
virtual

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

Reimplemented from Opm::SimulatorTimerInterface.

◆ currentStepLength()

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

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::SimulatorFullyImplicitBlackoil< TypeTag >::runStep().

◆ currentStepNum()

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

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.

Referenced by Opm::SimulatorFullyImplicitBlackoil< TypeTag >::init(), and Opm::SimulatorFullyImplicitBlackoil< TypeTag >::runStep().

◆ done()

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

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

Implements Opm::SimulatorTimerInterface.

Referenced by Opm::SimulatorFullyImplicitBlackoil< TypeTag >::run().

◆ init() [1/2]

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

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

◆ init() [2/2]

void Opm::SimulatorTimer::init ( const Schedule &  schedule,
std::size_t  report_step = 0 
)

Use the SimulatorTimer as a shim around opm-commons Schedule class.

◆ initialStep()

bool Opm::SimulatorTimer::initialStep ( ) const
overridevirtual

Whether the current step is the first step.

Implements Opm::SimulatorTimerInterface.

Referenced by Opm::SimulatorFullyImplicitBlackoil< TypeTag >::runStep().

◆ lastStepFailed()

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

Always return false. Timestep failures is handled in the substepTimer

Implements Opm::SimulatorTimerInterface.

◆ numSteps()

int Opm::SimulatorTimer::numSteps ( ) const

Total number of steps.

◆ operator++()

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

advance time by currentStepLength

Referenced by advance().

◆ operator==()

bool Opm::SimulatorTimer::operator== ( const SimulatorTimer rhs) const

◆ report()

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

Referenced by Opm::SimulatorFullyImplicitBlackoil< TypeTag >::runStep().

◆ reportStepLengthTaken()

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

◆ reportStepNum()

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

Referenced by Opm::BlackoilModel< TypeTag >::nonlinearIteration(), Opm::BlackoilModel< TypeTag >::prepareStep(), and Opm::EclWriter< TypeTag >::writeOutput().

◆ serializationTestObject()

static SimulatorTimer Opm::SimulatorTimer::serializationTestObject ( )
static

◆ serializeOp()

template<class Serializer >
void Opm::SimulatorTimer::serializeOp ( Serializer &  serializer)
inline

◆ setCurrentStepNum()

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

Set current step number.

◆ setTotalTime()

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.

◆ simulationTimeElapsed()

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

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

Implements Opm::SimulatorTimerInterface.

Referenced by Opm::EclWriter< TypeTag >::writeOutput().

◆ startDateTime()

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

Return start date of simulation.

Implements Opm::SimulatorTimerInterface.

◆ stepLengthTaken()

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

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.

◆ totalTime()

double Opm::SimulatorTimer::totalTime ( ) const

Total time.


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