Loading...
Searching...
No Matches
Opm::SimulatorTimer Class Reference
Inheritance diagram for Opm::SimulatorTimer:

## Public Member Functions

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

## Static Public Member Functions

static SimulatorTimer | serializationTestObject ()

## 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

## advance()

void Opm::SimulatorTimer::advance | ( |  | ) |

inline override virtual

advance time by currentStepLength

Implements Opm::SimulatorTimerInterface.

## clone()

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

override virtual

return copy of object

Implements Opm::SimulatorTimerInterface.

## currentDateTime()

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

virtual

Return the current time as a posix time object.

Reimplemented from Opm::SimulatorTimerInterface.

## currentPosixTime()

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

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

## currentStepNum()

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

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

## done()

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

override virtual

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

Implements Opm::SimulatorTimerInterface.

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

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

## initialStep()

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

override virtual

Whether the current step is the first step.

Implements Opm::SimulatorTimerInterface.

## lastStepFailed()

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

inline override virtual

Always return false.

Timestep failures is handled in the substepTimer

Implements Opm::SimulatorTimerInterface.

## operator++()

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

advance time by currentStepLength

Next step.

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

## 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

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

## startDateTime()

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

override virtual

Return start date of simulation.

Implements Opm::SimulatorTimerInterface.

## stepLengthTaken()

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

override 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:

- opm/simulators/timestepping/SimulatorTimer.hpp
- opm/simulators/timestepping/SimulatorTimer.cpp