19 #ifndef OPM_ADAPTIVESIMULATORTIMER_HEADER_INCLUDED 20 #define OPM_ADAPTIVESIMULATORTIMER_HEADER_INCLUDED 30 #include <opm/simulators/timestepping/SimulatorTimerInterface.hpp> 51 const double step_length,
52 const double elapsed_time,
53 const double last_step_taken,
54 const int report_step,
55 const double max_time_step = std::numeric_limits<double>::max());
79 void setCurrentStepLength(
double dt);
88 bool done ()
const override;
104 void report(std::ostream& os)
const;
116 std::unique_ptr<SimulatorTimerInterface>
clone()
const override;
119 std::shared_ptr<boost::posix_time::ptime> start_date_time_;
120 const double start_time_;
121 const double total_time_;
122 const int report_step_;
123 const double max_time_step_;
125 double current_time_;
129 std::vector< double > steps_;
130 bool last_step_failed_;
136 #endif // OPM_SIMULATORTIMER_HEADER_INCLUDED Simulation timer for adaptive time stepping.
Definition: AdaptiveSimulatorTimer.hpp:40
double maxStepLength() const
return max step length used so far
Definition: AdaptiveSimulatorTimer.cpp:151
double currentStepLength() const override
Definition: AdaptiveSimulatorTimer.cpp:115
AdaptiveSimulatorTimer & operator++()
advance time by currentStepLength
Definition: AdaptiveSimulatorTimer.cpp:68
void advance() override
advance time by currentStepLength
Definition: AdaptiveSimulatorTimer.hpp:61
int reportStepNum() const override
return current report step
Definition: AdaptiveSimulatorTimer.cpp:113
bool done() const override
Definition: AdaptiveSimulatorTimer.cpp:139
void provideTimeStepEstimate(const double dt_estimate)
provide and estimate for new time step size
Definition: AdaptiveSimulatorTimer.cpp:79
double stepLengthTaken() const override
Previous step length.
Definition: AdaptiveSimulatorTimer.cpp:127
bool lastStepFailed() const override
Return true if last time step failed.
Definition: AdaptiveSimulatorTimer.hpp:110
double averageStepLength() const
return average step length used so far
Definition: AdaptiveSimulatorTimer.cpp:141
int currentStepNum() const override
Definition: AdaptiveSimulatorTimer.cpp:110
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
void setLastStepFailed(bool last_step_failed)
tell the timestepper whether timestep failed or not
Definition: AdaptiveSimulatorTimer.hpp:113
void report(std::ostream &os) const
report start and end time as well as used steps so far
Definition: AdaptiveSimulatorTimer.cpp:166
boost::posix_time::ptime startDateTime() const override
start date time of simulation
Definition: AdaptiveSimulatorTimer.cpp:176
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
Definition: AdaptiveSimulatorTimer.cpp:39
double simulationTimeElapsed() const override
Definition: AdaptiveSimulatorTimer.cpp:137
Interface class for SimulatorTimer objects, to be improved.
Definition: SimulatorTimerInterface.hpp:33
double minStepLength() const
return min step length used so far
Definition: AdaptiveSimulatorTimer.cpp:158
bool initialStep() const override
Whether this is the first step.
Definition: AdaptiveSimulatorTimer.cpp:63
double totalTime() const
Definition: AdaptiveSimulatorTimer.cpp:135
std::unique_ptr< SimulatorTimerInterface > clone() const override
return copy of object
Definition: AdaptiveSimulatorTimer.cpp:183