From 0b3f885b33adf5a6bf811e67ae5559b81db930da Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Thu, 30 Jan 2020 11:08:20 +0100 Subject: [PATCH] Started to add skeleton load_rst function --- opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp | 1 + .../parser/eclipse/EclipseState/Schedule/Schedule.cpp | 8 ++++++++ tests/parser/ScheduleRestartTests.cpp | 9 ++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp b/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp index 59f48cf44..481052781 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp @@ -313,6 +313,7 @@ namespace Opm std::map wellgroup_events; + void load_rst(const RestartIO::RstState& rst, const UnitSystem& unit_system); void addWell(const std::string& wellName, const std::string& group, int headI, diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index 3db0791ae..085a0ef2b 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -133,6 +133,9 @@ namespace { rft_config(this->m_timeMap), m_nupcol(this->m_timeMap, ParserKeywords::NUPCOL::NUM_ITER::defaultValue) { + if (rst) + this->load_rst(*rst, deck.getActiveUnitSystem()); + addGroup( "FIELD", 0, deck.getActiveUnitSystem()); /* @@ -2954,4 +2957,9 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c this->getWellGroupEvents() == data.getWellGroupEvents(); } +void Schedule::load_rst(const RestartIO::RstState&, const UnitSystem&) +{ +} + + } diff --git a/tests/parser/ScheduleRestartTests.cpp b/tests/parser/ScheduleRestartTests.cpp index 85d0df224..f7a43c2fd 100644 --- a/tests/parser/ScheduleRestartTests.cpp +++ b/tests/parser/ScheduleRestartTests.cpp @@ -89,11 +89,14 @@ BOOST_AUTO_TEST_CASE(LoadRST) { BOOST_AUTO_TEST_CASE(LoadRestartSim) { Parser parser; auto deck = parser.parseFile("SPE1CASE2.DATA"); + EclipseState ecl_state(deck); + Schedule sched(deck, ecl_state); + auto restart_deck = parser.parseFile("SPE1CASE2_RESTART.DATA"); EclIO::ERst rst_file("SPE1CASE2.X0060"); auto rst_state = RestartIO::RstState::load(rst_file, 60); + EclipseState ecl_state_restart(restart_deck); + Schedule restart_sched(restart_deck, ecl_state_restart, &rst_state); - EclipseState ecl_state(deck); - Schedule sched(deck, ecl_state); - //Schedule restart_sched(deck, ecl_state, &rst_state); + // Verify that sched and restart_sched are identical from report_step 60 and onwords. }