Loading...
Searching...
No Matches
Opm::AdaptiveSimulatorTimer Class Reference

Simulation timer for adaptive time stepping. More...

`#include <AdaptiveSimulatorTimer.hpp>`

Inheritance diagram for Opm::AdaptiveSimulatorTimer:

## Public Member Functions

| AdaptiveSimulatorTimer (const boost::posix_time::ptime simulation_start_time, const double step_length, const double elapsed_time, const double last_step_taken, const int report_step, const double max_time_step=std::numeric_limits< double >::max())
| constructor taking a simulator timer to determine start and end time
AdaptiveSimulatorTimer & | operator++ ()
| advance time by currentStepLength
void | advance () override
| advance time by currentStepLength
void | provideTimeStepEstimate (const double dt_estimate)
| provide and estimate for new time step size
bool | initialStep () const override
| Whether this is the first step.
int | currentStepNum () const override
int | reportStepNum () const override
| return current report step
double | currentStepLength () const override
void | setCurrentStepLength (double dt)
double | totalTime () const
double | simulationTimeElapsed () const override
bool | done () const override
double | averageStepLength () const
| return average step length used so far
double | maxStepLength () const
| return max step length used so far
double | minStepLength () const
| return min step length used so far
double | stepLengthTaken () const override
| Previous step length.
void | report (std::ostream &os) const
| report start and end time as well as used steps so far
boost::posix_time::ptime | startDateTime () const override
| start date time of simulation
bool | lastStepFailed () const override
| Return true if last time step failed.
void | setLastStepFailed (bool last_step_failed)
| tell the timestepper whether timestep failed or not
std::unique_ptr< SimulatorTimerInterface > | clone () const override
| return copy of object
Public Member Functions inherited from Opm::SimulatorTimerInterface
virtual | ~SimulatorTimerInterface ()
| destructor
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].
virtual double | reportStepLengthTaken () const
| Previous report step length.

## Protected Attributes

std::shared_ptr< boost::posix_time::ptime > | start_date_time_
const double | start_time_
const double | total_time_
const int | report_step_
const double | max_time_step_
double | current_time_
double | dt_
int | current_step_
std::vector< double > | steps_
bool | last_step_failed_

## Additional Inherited Members

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

## Detailed Description

Simulation timer for adaptive time stepping.

## Constructor & Destructor Documentation

## AdaptiveSimulatorTimer()

Opm::AdaptiveSimulatorTimer::AdaptiveSimulatorTimer | ( | const boost::posix_time::ptime | simulation_start_time,
|  | const double | step_length,
|  | const double | elapsed_time,
|  | const double | last_step_taken,
|  | const int | report_step,
|  | const double | max_time_step = std::numeric_limits<double>::max() )

constructor taking a simulator timer to determine start and end time

Parameters

  simulation_start_time | Start time for simulation
  step_length | Time step length
  elapsed_time | Current elapsed time
  last_step_taken | Last suggested time step
  report_step | Current report step index
  max_time_step | maximum time step allowed

## Member Function Documentation

## advance()

void Opm::AdaptiveSimulatorTimer::advance | ( |  | ) |

inline override virtual

advance time by currentStepLength

Implements Opm::SimulatorTimerInterface.

## clone()

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

override virtual

return copy of object

Implements Opm::SimulatorTimerInterface.

## currentStepLength()

double Opm::AdaptiveSimulatorTimer::currentStepLength | ( |  | ) | const

override virtual

Implements Opm::SimulatorTimerInterface.

## currentStepNum()

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

override virtual

Implements Opm::SimulatorTimerInterface.

## done()

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

override virtual

Implements Opm::SimulatorTimerInterface.

## initialStep()

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

override virtual

Whether this is the first step.

Implements Opm::SimulatorTimerInterface.

## lastStepFailed()

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

inline override virtual

Return true if last time step failed.

Implements Opm::SimulatorTimerInterface.

## reportStepNum()

int Opm::AdaptiveSimulatorTimer::reportStepNum | ( |  | ) | const

override virtual

return current report step

Reimplemented from Opm::SimulatorTimerInterface.

## simulationTimeElapsed()

double Opm::AdaptiveSimulatorTimer::simulationTimeElapsed | ( |  | ) | const

override virtual

Implements Opm::SimulatorTimerInterface.

## startDateTime()

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

override virtual

start date time of simulation

Implements Opm::SimulatorTimerInterface.

## stepLengthTaken()

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

override virtual

Previous step length.

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

Implements Opm::SimulatorTimerInterface.

## totalTime()

double Opm::AdaptiveSimulatorTimer::totalTime | ( |  | ) | const

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

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