mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
OPM-251: Support for restart
This commit is contained in:
@@ -49,14 +49,16 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Use the SimulatorTimer as a shim around opm-parser's Opm::TimeMap
|
/// 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();
|
total_time_ = timeMap->getTotalTime();
|
||||||
timesteps_.resize(timeMap->numTimesteps());
|
timesteps_.resize(timeMap->numTimesteps());
|
||||||
for ( size_t i = 0; i < timeMap->numTimesteps(); ++i ) {
|
for ( size_t i = 0; i < timeMap->numTimesteps(); ++i ) {
|
||||||
timesteps_[i] = timeMap->getTimeStepLength(i);
|
timesteps_[i] = timeMap->getTimeStepLength(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setCurrentStepNum(report_step);
|
||||||
|
|
||||||
boost::posix_time::ptime start_time = timeMap->getStartTime(0);
|
boost::posix_time::ptime start_time = timeMap->getStartTime(0);
|
||||||
start_date_ = start_time.date();
|
start_date_ = start_time.date();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace Opm
|
|||||||
void init(const parameter::ParameterGroup& param);
|
void init(const parameter::ParameterGroup& param);
|
||||||
|
|
||||||
/// Use the SimulatorTimer as a shim around opm-parser's Opm::TimeMap
|
/// 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.
|
/// Total number of steps.
|
||||||
int numSteps() const;
|
int numSteps() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user