Merge pull request #2343 from joakim-hove/move-rstconfig

RestartConfig has moved from EclipseState to Schedule
This commit is contained in:
Joakim Hove
2020-02-20 07:07:37 +01:00
committed by GitHub
9 changed files with 35 additions and 34 deletions
+14 -5
View File
@@ -254,6 +254,17 @@ Opm::TimeMap getTimeMap()
return Opm::TimeMap({123});
}
Opm::RestartConfig getRestartConfig()
{
Opm::DynamicState<Opm::RestartSchedule> rsched({Opm::RestartSchedule(1, 2, 3)}, 2);
Opm::DynamicState<std::map<std::string,int>> 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,
@@ -840,7 +851,7 @@ BOOST_AUTO_TEST_CASE(RestartConfig)
Opm::DynamicState<std::map<std::string,int>> 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
@@ -2282,6 +2293,7 @@ BOOST_AUTO_TEST_CASE(Schedule)
{{std::make_shared<Opm::Action::Actions>(acnts)}, 1},
rftc,
{std::vector<int>{1}, 1},
getRestartConfig(),
{{"test", events}});
auto val2 = PackUnpack(val1);
@@ -2388,10 +2400,7 @@ BOOST_AUTO_TEST_CASE(EclipseConfig)
Opm::InitConfig init(Opm::Equil({getEquilRecord(), getEquilRecord()}),
Opm::FoamConfig({getFoamData(), getFoamData()}),
true, true, true, 20, "test1");
Opm::DynamicState<Opm::RestartSchedule> rsched({Opm::RestartSchedule(1, 2, 3)}, 2);
Opm::DynamicState<std::map<std::string,int>> 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)
+1 -1
View File
@@ -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 );
+2 -10
View File
@@ -35,11 +35,9 @@
#include <opm/common/utility/platform_dependent/reenable_warnings.h>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
#include <opm/simulators/wells/VFPHelpers.hpp>
#include <opm/simulators/wells/VFPProdProperties.hpp>
@@ -593,12 +591,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
@@ -655,7 +648,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);