diff --git a/ebos/eclbasevanguard.hh b/ebos/eclbasevanguard.hh index 2c99f33a1..9bd3fa268 100644 --- a/ebos/eclbasevanguard.hh +++ b/ebos/eclbasevanguard.hh @@ -327,7 +327,7 @@ public: } if (!externalEclState_) { - internalEclState_.reset(new Opm::EclipseState(*deck_, *parseContext_, *errorGuard_)); + internalEclState_.reset(new Opm::EclipseState(*deck_)); eclState_ = internalEclState_.get(); } else { @@ -375,7 +375,7 @@ public: // written to disk (every N report step) int outputInterval = EWOMS_GET_PARAM(TypeTag, int, EclOutputInterval); if (outputInterval >= 0) - eclState_->getRestartConfig().overrideRestartWriteInterval(outputInterval); + schedule().restart().overrideRestartWriteInterval(outputInterval); } /*! diff --git a/ebos/ecloutputblackoilmodule.hh b/ebos/ecloutputblackoilmodule.hh index bc1985ed2..19d08b485 100644 --- a/ebos/ecloutputblackoilmodule.hh +++ b/ebos/ecloutputblackoilmodule.hh @@ -219,7 +219,7 @@ public: const Opm::SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig(); // Only output RESTART_AUXILIARY asked for by the user. - const Opm::RestartConfig& restartConfig = simulator_.vanguard().eclState().getRestartConfig(); + const Opm::RestartConfig& restartConfig = simulator_.vanguard().schedule().restart(); std::map rstKeywords = restartConfig.getRestartKeywords(reportStepNum); for (auto& keyValue: rstKeywords) { keyValue.second = restartConfig.getKeyword(keyValue.first, reportStepNum); diff --git a/flow/flow.cpp b/flow/flow.cpp index a2f1b613e..f1bc21816 100644 --- a/flow/flow.cpp +++ b/flow/flow.cpp @@ -350,7 +350,7 @@ int main(int argc, char** argv) if ( outputCout ) Opm::checkDeck(*deck, parser, parseContext, errorGuard); - eclipseState.reset( new Opm::EclipseState(*deck, parseContext, errorGuard )); + eclipseState.reset( new Opm::EclipseState(*deck)); if (mpiRank == 0) { schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard)); setupMessageLimiter(schedule->getMessageLimits(), "STDOUT_LOGGER"); diff --git a/flow/flow_tag.hpp b/flow/flow_tag.hpp index 7773e3056..0d2a04cac 100644 --- a/flow/flow_tag.hpp +++ b/flow/flow_tag.hpp @@ -376,7 +376,7 @@ int mainFlow(int argc, char** argv) if ( outputCout ) Opm::checkDeck(*deck, parser, parseContext, errorGuard); - eclipseState.reset( new Opm::EclipseState(*deck, parseContext, errorGuard )); + eclipseState.reset( new Opm::EclipseState(*deck )); schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard)); summaryConfig.reset( new Opm::SummaryConfig(*deck, *schedule, eclipseState->getTableManager(), parseContext, errorGuard)); setupMessageLimiter(schedule->getMessageLimits(), "STDOUT_LOGGER"); diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 445967d90..7306218d6 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -642,8 +642,7 @@ std::size_t packSize(const TimeMap& data, Dune::MPIHelper::MPICommunicator comm) std::size_t packSize(const RestartConfig& data, Dune::MPIHelper::MPICommunicator comm) { - return packSize(data.ioConfig(), comm) + - packSize(data.timeMap(), comm) + + return packSize(data.timeMap(), comm) + packSize(data.getFirstRestartStep(), comm) + packSize(data.writeInitialRst(), comm) + packSize(data.restartSchedule(), comm) + @@ -1754,6 +1753,7 @@ std::size_t packSize(const Schedule& data, packSizeDynState(data.getActions(), comm) + packSize(data.rftConfig(), comm) + packSize(data.getNupCol(), comm) + + packSize(data.restart(), comm) + packSize(data.getWellGroupEvents(), comm); } @@ -1913,7 +1913,7 @@ std::size_t packSize(const EclipseConfig& data, Dune::MPIHelper::MPICommunicator comm) { return packSize(data.init(), comm) + - packSize(data.restart(), comm); + packSize(data.io(), comm); } std::size_t packSize(const TransMult& data, @@ -2387,7 +2387,6 @@ void pack(const TimeMap& data, std::vector& buffer, int& position, void pack(const RestartConfig& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { - pack(data.ioConfig(), buffer, position, comm); pack(data.timeMap(), buffer, position, comm); pack(data.getFirstRestartStep(), buffer, position, comm); pack(data.writeInitialRst(), buffer, position, comm); @@ -3531,6 +3530,7 @@ void pack(const Schedule& data, packDynState(data.getActions(), buffer, position, comm); pack(data.rftConfig(), buffer, position, comm); pack(data.getNupCol(), buffer, position, comm); + pack(data.restart(), buffer, position, comm); pack(data.getWellGroupEvents(), buffer, position, comm); } @@ -3707,7 +3707,7 @@ void pack(const EclipseConfig& data, Dune::MPIHelper::MPICommunicator comm) { pack(data.init(), buffer, position, comm); - pack(data.restart(), buffer, position, comm); + pack(data.io(), buffer, position, comm); } void pack(const TransMult& data, @@ -4319,21 +4319,19 @@ void unpack(TimeMap& data, std::vector& buffer, int& position, void unpack(RestartConfig& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { - IOConfig ioConfig; TimeMap timemap; int firstRstStep; bool writeInitialRst; DynamicState restart_sched; DynamicState> restart_keyw; std::vector save_keyw; - unpack(ioConfig, buffer, position, comm); unpack(timemap, buffer, position, comm); unpack(firstRstStep, buffer, position, comm); unpack(writeInitialRst, buffer, position, comm); unpack(restart_sched, buffer, position, comm); unpack(restart_keyw, buffer, position, comm); unpack(save_keyw, buffer, position, comm); - data = RestartConfig(ioConfig, timemap, firstRstStep, writeInitialRst, restart_sched, + data = RestartConfig(timemap, firstRstStep, writeInitialRst, restart_sched, restart_keyw, save_keyw); } @@ -6053,6 +6051,7 @@ void unpack(Schedule& data, std::vector& buffer, int& position, DynamicState> actions; RFTConfig rftConfig; DynamicState nupCol; + RestartConfig restartConfig; std::map wellGroupEvents; unpack(timeMap, buffer, position, comm); @@ -6078,13 +6077,14 @@ void unpack(Schedule& data, std::vector& buffer, int& position, unpack(rftConfig, buffer, position, comm); unpack(nupCol, buffer, position, comm); + unpack(restartConfig, buffer, position, comm); unpack(wellGroupEvents, buffer, position, comm); data = Schedule(timeMap, staticWells, groups, oilVapProps, events, modifierDeck, tuning, messageLimits, runspec, vfpProdTables, vfpInjTables, wellTestConfig, wListManager, udqConfig, udqActive, guideRateConfig, gconSale, gconSump, globalWhistCtlMode, actions, - rftConfig, nupCol, wellGroupEvents); + rftConfig, nupCol, restartConfig, wellGroupEvents); } void unpack(BrineDensityTable& data, std::vector& buffer, int& position, @@ -6323,11 +6323,11 @@ void unpack(EclipseConfig& data, Dune::MPIHelper::MPICommunicator comm) { InitConfig init; - RestartConfig restart; + IOConfig io; unpack(init, buffer, position, comm); - unpack(restart, buffer, position, comm); - data = EclipseConfig(init, restart); + unpack(io, buffer, position, comm); + data = EclipseConfig(init, io); } void unpack(TransMult& data, diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 9824cd955..ad47b484f 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -1251,7 +1251,7 @@ namespace Opm { computeAverageFormationFactor(B_avg); const Opm::SummaryConfig& summaryConfig = ebosSimulator_.vanguard().summaryConfig(); - const bool write_restart_file = ebosSimulator_.vanguard().eclState().getRestartConfig().getWriteRestartFile(reportStepIdx); + const bool write_restart_file = ebosSimulator_.vanguard().schedule().restart().getWriteRestartFile(reportStepIdx); int exception_thrown = 0; try { for (const auto& well : well_container_) { diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 59d7b5099..f8e9cd24a 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -250,6 +250,17 @@ Opm::TimeMap getTimeMap() return Opm::TimeMap({123}); } + +Opm::RestartConfig getRestartConfig() +{ + Opm::DynamicState rsched({Opm::RestartSchedule(1, 2, 3)}, 2); + Opm::DynamicState> rkw({{{"test",3}}}, 3); + Opm::IOConfig io(true, false, true, false, false, true, "test1", true, + "test2", true, "test3", false); + return Opm::RestartConfig(getTimeMap(), 1, true, rsched, rkw, {false, true}); +} + + Opm::PvtgTable getPvtgTable() { return Opm::PvtgTable(Opm::ColumnSchema("test1", Opm::Table::INCREASING, @@ -804,7 +815,7 @@ BOOST_AUTO_TEST_CASE(RestartConfig) Opm::DynamicState> rkw({{{"test",3}}}, 3); Opm::IOConfig io(true, false, true, false, false, true, "test1", true, "test2", true, "test3", false); - Opm::RestartConfig val1(io, getTimeMap(), 1, true, rsched, rkw, {false, true}); + Opm::RestartConfig val1(getTimeMap(), 1, true, rsched, rkw, {false, true}); auto val2 = PackUnpack(val1); DO_CHECKS(RestartConfig) #endif @@ -2201,6 +2212,7 @@ BOOST_AUTO_TEST_CASE(Schedule) {{std::make_shared(acnts)}, 1}, rftc, {std::vector{1}, 1}, + getRestartConfig(), {{"test", events}}); auto val2 = PackUnpack(val1); @@ -2307,10 +2319,7 @@ BOOST_AUTO_TEST_CASE(EclipseConfig) Opm::InitConfig init(Opm::Equil({getEquilRecord(), getEquilRecord()}), Opm::FoamConfig({getFoamData(), getFoamData()}), true, true, true, 20, "test1"); - Opm::DynamicState rsched({Opm::RestartSchedule(1, 2, 3)}, 2); - Opm::DynamicState> rkw({{{"test",3}}}, 3); - Opm::RestartConfig restart(io, getTimeMap(), 1, true, rsched, rkw, {false, true}); - Opm::EclipseConfig val1{init, restart}; + Opm::EclipseConfig val1{init, io}; auto val2 = PackUnpack(val1); DO_CHECKS(EclipseConfig) diff --git a/tests/test_norne_pvt.cpp b/tests/test_norne_pvt.cpp index 7f1b58cb3..ac9acb55a 100644 --- a/tests/test_norne_pvt.cpp +++ b/tests/test_norne_pvt.cpp @@ -279,7 +279,7 @@ BOOST_AUTO_TEST_CASE( Test_Norne_PVT) { auto deck = parser.parseFile("norne_pvt.data", parseContext, errorGuard); - Opm::EclipseState eclState(deck, parseContext, errorGuard); + Opm::EclipseState eclState(deck); verify_norne_oil_pvt_region1( deck, eclState ); verify_norne_oil_pvt_region2( deck, eclState ); diff --git a/tests/test_vfpproperties.cpp b/tests/test_vfpproperties.cpp index b62d7d2f7..36d9dfb7a 100644 --- a/tests/test_vfpproperties.cpp +++ b/tests/test_vfpproperties.cpp @@ -35,11 +35,9 @@ #include #include -#include -#include -#include +#include +#include #include - #include #include @@ -591,12 +589,7 @@ VFPPROD \n\ auto units = Opm::UnitSystem::newFIELD(); Opm::Parser parser; auto deck = parser.parseString(table_str); - - BOOST_REQUIRE(deck.hasKeyword("VFPPROD")); - BOOST_CHECK_EQUAL(deck.count("VFPPROD"), 1); - Opm::VFPProdTable table(deck.getKeyword("VFPPROD", 0), units); - Opm::VFPProdProperties properties(&table); const int n = 5; //Number of points to check per axis @@ -653,7 +646,6 @@ BOOST_AUTO_TEST_CASE(ParseInterpolateRealisticVFPPROD) Opm::filesystem::path file("VFPPROD2"); auto deck = parser.parseFile(file.string()); - Opm::checkDeck(deck, parser, parseContext, errorGuard); BOOST_REQUIRE(deck.hasKeyword("VFPPROD")); BOOST_CHECK_EQUAL(deck.count("VFPPROD"), 1);