From d43f1097704ef8b107288b741d2fa1e66637e77c Mon Sep 17 00:00:00 2001 From: chflo Date: Thu, 10 Dec 2015 14:47:33 +0100 Subject: [PATCH] OPM-251: Support for restart --- opm/simulators/timestepping/SimulatorTimer.cpp | 6 ++++-- opm/simulators/timestepping/SimulatorTimer.hpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/opm/simulators/timestepping/SimulatorTimer.cpp b/opm/simulators/timestepping/SimulatorTimer.cpp index 757857519..34d58fb03 100644 --- a/opm/simulators/timestepping/SimulatorTimer.cpp +++ b/opm/simulators/timestepping/SimulatorTimer.cpp @@ -49,14 +49,16 @@ namespace Opm } /// Use the SimulatorTimer as a shim around opm-parser's Opm::TimeMap - void SimulatorTimer::init(Opm::TimeMapConstPtr timeMap) + void SimulatorTimer::init(Opm::TimeMapConstPtr timeMap, bool restart, size_t report_step) { - current_step_ = 0; total_time_ = timeMap->getTotalTime(); timesteps_.resize(timeMap->numTimesteps()); for ( size_t i = 0; i < timeMap->numTimesteps(); ++i ) { timesteps_[i] = timeMap->getTimeStepLength(i); } + + setCurrentStepNum(report_step); + boost::posix_time::ptime start_time = timeMap->getStartTime(0); start_date_ = start_time.date(); } diff --git a/opm/simulators/timestepping/SimulatorTimer.hpp b/opm/simulators/timestepping/SimulatorTimer.hpp index 1f2e66b26..25ca48840 100644 --- a/opm/simulators/timestepping/SimulatorTimer.hpp +++ b/opm/simulators/timestepping/SimulatorTimer.hpp @@ -47,7 +47,7 @@ namespace Opm void init(const parameter::ParameterGroup& param); /// Use the SimulatorTimer as a shim around opm-parser's Opm::TimeMap - void init(TimeMapConstPtr timeMap); + void init(TimeMapConstPtr timeMap, bool restart = false, size_t report_step = 0); /// Total number of steps. int numSteps() const;