Opm::AdaptiveSimulatorTimer Class Reference

Simulation timer for adaptive time stepping. More...

#include <AdaptiveSimulatorTimer.hpp>

Inheritance diagram for Opm::AdaptiveSimulatorTimer:
Inheritance graph

Public Member Functions

 AdaptiveSimulatorTimer (const SimulatorTimerInterface &timer, const double lastStepTaken, const double maxTimeStep=std::numeric_limits< double >::max())
 constructor taking a simulator timer to determine start and end time More...
 
AdaptiveSimulatorTimeroperator++ ()
 advance time by currentStepLength More...
 
void advance ()
 advance time by currentStepLength More...
 
void provideTimeStepEstimate (const double dt_estimate)
 provide and estimate for new time step size More...
 
int currentStepNum () const
 
int reportStepNum () const
 return current report step More...
 
double currentStepLength () const
 
double totalTime () const
 
double simulationTimeElapsed () const
 
bool done () const
 
double averageStepLength () const
 return average step length used so far More...
 
double maxStepLength () const
 return max step length used so far More...
 
double minStepLength () const
 return min step length used so far More...
 
double stepLengthTaken () const
 Previous step length. This is the length of the step that was taken to arrive at this time. More...
 
void report (std::ostream &os) const
 report start and end time as well as used steps so far More...
 
boost::posix_time::ptime startDateTime () const
 start date time of simulation 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
 

Protected Attributes

const 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_
 

Detailed Description

Simulation timer for adaptive time stepping.

Constructor & Destructor Documentation

Opm::AdaptiveSimulatorTimer::AdaptiveSimulatorTimer ( const SimulatorTimerInterface timer,
const double  lastStepTaken,
const double  maxTimeStep = std::numeric_limits< double >::max() 
)

constructor taking a simulator timer to determine start and end time

Parameters
timerin case of sub stepping this is the outer timer
lastStepTakenlast suggested time step
maxTimeStepmaximum time step allowed

Member Function Documentation

void Opm::AdaptiveSimulatorTimer::advance ( )
inlinevirtual

advance time by currentStepLength

Implements Opm::SimulatorTimerInterface.

References operator++().

double Opm::AdaptiveSimulatorTimer::averageStepLength ( ) const

return average step length used so far

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::AdaptiveSimulatorTimer::currentStepLength ( ) const
virtual
int Opm::AdaptiveSimulatorTimer::currentStepNum ( ) const
virtual
bool Opm::AdaptiveSimulatorTimer::done ( ) const
virtual
double Opm::AdaptiveSimulatorTimer::maxStepLength ( ) const

return max step length used so far

double Opm::AdaptiveSimulatorTimer::minStepLength ( ) const

return min step length used so far

AdaptiveSimulatorTimer& Opm::AdaptiveSimulatorTimer::operator++ ( )

advance time by currentStepLength

Referenced by advance().

void Opm::AdaptiveSimulatorTimer::provideTimeStepEstimate ( const double  dt_estimate)

provide and estimate for new time step size

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

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

report start and end time as well as used steps so far

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

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

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

return current report step

Reimplemented from Opm::SimulatorTimerInterface.

double Opm::AdaptiveSimulatorTimer::simulationTimeElapsed ( ) const
virtual
boost::posix_time::ptime Opm::AdaptiveSimulatorTimer::startDateTime ( ) const
virtual

start date time of simulation

Implements Opm::SimulatorTimerInterface.

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

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

Implements Opm::SimulatorTimerInterface.

double Opm::AdaptiveSimulatorTimer::totalTime ( ) const

Member Data Documentation

int Opm::AdaptiveSimulatorTimer::current_step_
protected
double Opm::AdaptiveSimulatorTimer::current_time_
protected
double Opm::AdaptiveSimulatorTimer::dt_
protected
const double Opm::AdaptiveSimulatorTimer::max_time_step_
protected
const int Opm::AdaptiveSimulatorTimer::report_step_
protected
const boost::posix_time::ptime Opm::AdaptiveSimulatorTimer::start_date_time_
protected
const double Opm::AdaptiveSimulatorTimer::start_time_
protected
std::vector< double > Opm::AdaptiveSimulatorTimer::steps_
protected
const double Opm::AdaptiveSimulatorTimer::total_time_
protected

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