19 #ifndef OPM_ADAPTIVESIMULATORTIMER_HEADER_INCLUDED 20 #define OPM_ADAPTIVESIMULATORTIMER_HEADER_INCLUDED 29 #include <opm/simulators/timestepping/SimulatorTimerInterface.hpp> 47 const double lastStepTaken,
48 const double maxTimeStep = std::numeric_limits<double>::max() );
94 void report(std::ostream& os)
const;
106 virtual std::unique_ptr< SimulatorTimerInterface >
clone()
const;
109 const boost::posix_time::ptime start_date_time_;
110 const double start_time_;
111 const double total_time_;
112 const int report_step_;
113 const double max_time_step_;
115 double current_time_;
119 std::vector< double > steps_;
120 bool lastStepFailed_;
126 #endif // OPM_SIMULATORTIMER_HEADER_INCLUDED Simulation timer for adaptive time stepping.
Definition: AdaptiveSimulatorTimer.hpp:39
double maxStepLength() const
return max step length used so far
Definition: AdaptiveSimulatorTimer.cpp:132
AdaptiveSimulatorTimer & operator++()
advance time by currentStepLength
Definition: AdaptiveSimulatorTimer.cpp:59
void advance()
advance time by currentStepLength
Definition: AdaptiveSimulatorTimer.hpp:54
double simulationTimeElapsed() const
Definition: AdaptiveSimulatorTimer.cpp:118
void provideTimeStepEstimate(const double dt_estimate)
provide and estimate for new time step size
Definition: AdaptiveSimulatorTimer.cpp:69
double averageStepLength() const
return average step length used so far
Definition: AdaptiveSimulatorTimer.cpp:122
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: AdditionalObjectDeleter.hpp:22
void report(std::ostream &os) const
report start and end time as well as used steps so far
Definition: AdaptiveSimulatorTimer.cpp:147
void setLastStepFailed(bool lastStepFailed)
tell the timestepper whether timestep failed or not
Definition: AdaptiveSimulatorTimer.hpp:103
bool initialStep() const
Whether this is the first step.
Definition: AdaptiveSimulatorTimer.cpp:54
virtual std::unique_ptr< SimulatorTimerInterface > clone() const
return copy of object
Definition: AdaptiveSimulatorTimer.cpp:164
bool done() const
Definition: AdaptiveSimulatorTimer.cpp:120
Interface class for SimulatorTimer objects, to be improved.
Definition: SimulatorTimerInterface.hpp:35
int currentStepNum() const
Definition: AdaptiveSimulatorTimer.cpp:98
double minStepLength() const
return min step length used so far
Definition: AdaptiveSimulatorTimer.cpp:139
bool lastStepFailed() const
Return true if last time step failed.
Definition: AdaptiveSimulatorTimer.hpp:100
boost::posix_time::ptime startDateTime() const
start date time of simulation
Definition: AdaptiveSimulatorTimer.cpp:157
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
Definition: AdaptiveSimulatorTimer.cpp:33
double stepLengthTaken() const
Previous step length.
Definition: AdaptiveSimulatorTimer.cpp:108
double currentStepLength() const
Definition: AdaptiveSimulatorTimer.cpp:103
double totalTime() const
Definition: AdaptiveSimulatorTimer.cpp:116
int reportStepNum() const
return current report step
Definition: AdaptiveSimulatorTimer.cpp:101