diff --git a/opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp b/opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp index 577cbbe42..f2b190fb2 100644 --- a/opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp +++ b/opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp @@ -51,7 +51,12 @@ namespace Opm provideTimeStepEstimate( lastStepTaken ); } - AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ () + bool AdaptiveSimulatorTimer::initialStep () const + { + return ( report_step_ == 0 ) && ( current_step_ == 0 ); + } + +AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ () { ++current_step_; current_time_ += dt_; diff --git a/opm/simulators/timestepping/AdaptiveSimulatorTimer.hpp b/opm/simulators/timestepping/AdaptiveSimulatorTimer.hpp index fd34af8c1..a813d6739 100644 --- a/opm/simulators/timestepping/AdaptiveSimulatorTimer.hpp +++ b/opm/simulators/timestepping/AdaptiveSimulatorTimer.hpp @@ -56,6 +56,9 @@ namespace Opm /// \brief provide and estimate for new time step size void provideTimeStepEstimate( const double dt_estimate ); + /// \brief Whether this is the first step + bool initialStep () const; + /// \brief \copydoc SimulationTimer::currentStepNum int currentStepNum () const; diff --git a/opm/simulators/timestepping/SimulatorTimerInterface.hpp b/opm/simulators/timestepping/SimulatorTimerInterface.hpp index d08b8778c..859db1c9c 100644 --- a/opm/simulators/timestepping/SimulatorTimerInterface.hpp +++ b/opm/simulators/timestepping/SimulatorTimerInterface.hpp @@ -83,6 +83,9 @@ namespace Opm /// Return true if timer indicates that simulation of timer interval is finished virtual bool done() const = 0; + /// Whether the current step is the first step. + virtual bool initialStep() const = 0; + /// Return start date of simulation virtual boost::posix_time::ptime startDateTime() const = 0;