diff --git a/flow/flow.cpp b/flow/flow.cpp index f4f782f10..ff6cdc37f 100644 --- a/flow/flow.cpp +++ b/flow/flow.cpp @@ -47,6 +47,9 @@ #include #include +#include +#include + #include #include #include @@ -352,7 +355,22 @@ int main(int argc, char** argv) eclipseState.reset( new Opm::EclipseState(*deck)); if (mpiRank == 0) { - schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard)); + /* + For the time being initializing wells and groups from the + restart file is not possible, but work is underways and it is + included here as a switch. + */ + const bool init_from_restart_file = false; + const auto& init_config = eclipseState->getInitConfig(); + if (init_config.restartRequested() && init_from_restart_file) { + int report_step = init_config.getRestartStep(); + const auto& rst_filename = eclipseState->getIOConfig().getRestartFileName( init_config.getRestartRootName(), report_step, false ); + Opm::EclIO::ERst rst_file(rst_filename); + const auto& rst_state = Opm::RestartIO::RstState::load(rst_file, report_step); + schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard, &rst_state) ); + } else + schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard)); + setupMessageLimiter(schedule->getMessageLimits(), "STDOUT_LOGGER"); summaryConfig.reset( new Opm::SummaryConfig(*deck, *schedule, eclipseState->getTableManager(), parseContext, errorGuard)); #ifdef HAVE_MPI