From 704c33f08f3f9e76d29c69c3cce6b325e9661d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Fri, 25 Jun 2021 09:11:09 +0200 Subject: [PATCH] Chase Restart Loading API Change --- opm/simulators/utils/readDeck.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/opm/simulators/utils/readDeck.cpp b/opm/simulators/utils/readDeck.cpp index 21e87dd64..2b188cc08 100644 --- a/opm/simulators/utils/readDeck.cpp +++ b/opm/simulators/utils/readDeck.cpp @@ -36,6 +36,8 @@ #include #include +#include +#include #include #include @@ -58,6 +60,8 @@ #include #include +#include +#include namespace Opm { @@ -232,10 +236,11 @@ void readDeck(int rank, std::string& deckFilename, std::unique_ptr& d */ const auto& init_config = eclipseState->getInitConfig(); if (init_config.restartRequested() && initFromRestart) { - 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); + const int report_step = init_config.getRestartStep(); + const auto rst_filename = eclipseState->getIOConfig().getRestartFileName( init_config.getRestartRootName(), report_step, false ); + auto rst_file = std::make_shared(rst_filename); + auto rst_view = std::make_shared(std::move(rst_file), report_step); + const auto rst_state = Opm::RestartIO::RstState::load(std::move(rst_view)); if (!schedule) schedule = std::make_unique(*deck, *eclipseState, *parseContext, *errorGuard, python, outputInterval, &rst_state); }