diff --git a/examples/wells_example.cpp b/examples/wells_example.cpp index 02fe261b..fbb3db61 100644 --- a/examples/wells_example.cpp +++ b/examples/wells_example.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include @@ -35,10 +35,10 @@ try simtimer.init(parameters); // Read input file - ParseMode parseMode; + ParseContext parseContext; Opm::ParserPtr parser(new Opm::Parser()); - Opm::DeckConstPtr deck = parser->parseFile(file_name , parseMode); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::DeckConstPtr deck = parser->parseFile(file_name , parseContext); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); std::cout << "Done!" << std::endl; // Setup grid @@ -108,7 +108,7 @@ try TwophaseFluid fluid(incomp_properties); - TransportModel model(fluid, *grid->c_grid(), porevol, gravity[2], true); + TransportContextl model(fluid, *grid->c_grid(), porevol, gravity[2], true); TransportSolver tsolver(model); diff --git a/tests/test_EclipseWriteRFTHandler.cpp b/tests/test_EclipseWriteRFTHandler.cpp index b3f8e871..ee346a0e 100755 --- a/tests/test_EclipseWriteRFTHandler.cpp +++ b/tests/test_EclipseWriteRFTHandler.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include #include @@ -92,7 +92,7 @@ void verifyRFTFile(const std::string& rft_filename) { Opm::DeckConstPtr createDeck(const std::string& input_str) { Opm::ParserPtr parser = std::make_shared(); - Opm::DeckConstPtr deck = parser->parseString(input_str , Opm::ParseMode()); + Opm::DeckConstPtr deck = parser->parseString(input_str , Opm::ParseContext()); return deck; } @@ -202,7 +202,7 @@ BOOST_AUTO_TEST_CASE(test_EclipseWriterRFTHandler) test_area.reset(new_ptr, test_work_area_free); std::shared_ptr deck = createDeck(deckString); - std::shared_ptr eclipseState = std::make_shared(deck , Opm::ParseMode()); + std::shared_ptr eclipseState = std::make_shared(deck , Opm::ParseContext()); std::shared_ptr simulatorTimer = std::make_shared(); simulatorTimer->init(eclipseState->getSchedule()->getTimeMap()); diff --git a/tests/test_EclipseWriter.cpp b/tests/test_EclipseWriter.cpp index 538b16a2..9be2e79b 100644 --- a/tests/test_EclipseWriter.cpp +++ b/tests/test_EclipseWriter.cpp @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include #include @@ -59,14 +59,14 @@ std::shared_ptr wellState; void createEclipseWriter(const char *deckString) { - Opm::ParseMode parseMode; + Opm::ParseContext parseContext; Opm::ParserConstPtr parser(new Opm::Parser()); - deck = parser->parseString(deckString, parseMode); + deck = parser->parseString(deckString, parseContext); Opm::parameter::ParameterGroup params; params.insertParameter("deck_filename", "foo.data"); - eclipseState.reset(new Opm::EclipseState(deck , parseMode)); + eclipseState.reset(new Opm::EclipseState(deck , parseContext)); auto eclGrid = eclipseState->getEclipseGrid(); BOOST_CHECK(eclGrid->getNX() == 3); diff --git a/tests/test_blackoilstate.cpp b/tests/test_blackoilstate.cpp index eda7c780..fdce9c03 100644 --- a/tests/test_blackoilstate.cpp +++ b/tests/test_blackoilstate.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #if HAVE_DYNAMIC_BOOST_TEST @@ -30,12 +30,12 @@ using namespace std; BOOST_AUTO_TEST_CASE(EqualsDifferentDeckReturnFalse) { - ParseMode parseMode; + ParseContext parseContext; const string filename1 = "testBlackoilState1.DATA"; const string filename2 = "testBlackoilState2.DATA"; Opm::ParserPtr parser(new Opm::Parser()); - Opm::DeckConstPtr deck1(parser->parseFile(filename1, parseMode)); - Opm::DeckConstPtr deck2(parser->parseFile(filename2, parseMode)); + Opm::DeckConstPtr deck1(parser->parseFile(filename1, parseContext)); + Opm::DeckConstPtr deck2(parser->parseFile(filename2, parseContext)); GridManager gridManager1(deck1); const UnstructuredGrid* grid1 = gridManager1.c_grid(); @@ -56,9 +56,9 @@ BOOST_AUTO_TEST_CASE(EqualsDifferentDeckReturnFalse) { BOOST_AUTO_TEST_CASE(EqualsDifferentNumPhasesReturnFalse) { const string filename = "testBlackoilState1.DATA"; - Opm::ParseMode parseMode; + Opm::ParseContext parseContext; Opm::ParserPtr parser(new Opm::Parser()); - Opm::DeckConstPtr deck(parser->parseFile(filename, parseMode)); + Opm::DeckConstPtr deck(parser->parseFile(filename, parseContext)); GridManager gridManager(deck); const UnstructuredGrid* grid = gridManager.c_grid(); @@ -77,9 +77,9 @@ BOOST_AUTO_TEST_CASE(EqualsDifferentNumPhasesReturnFalse) { BOOST_AUTO_TEST_CASE(EqualsNumericalDifferenceReturnFalse) { const string filename = "testBlackoilState1.DATA"; - Opm::ParseMode parseMode; + Opm::ParseContext parseContext; Opm::ParserPtr parser(new Opm::Parser()); - Opm::DeckConstPtr deck(parser->parseFile(filename , parseMode)); + Opm::DeckConstPtr deck(parser->parseFile(filename , parseContext)); GridManager gridManager(deck); const UnstructuredGrid* grid = gridManager.c_grid(); diff --git a/tests/test_column_extract.cpp b/tests/test_column_extract.cpp index 865bdd97..a58053f0 100644 --- a/tests/test_column_extract.cpp +++ b/tests/test_column_extract.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include @@ -131,9 +131,9 @@ BOOST_AUTO_TEST_CASE(DisjointColumn) correct_answer[4].resize(1); correct_answer[9].resize(1); - Opm::ParseMode parseMode; + Opm::ParseContext parseContext; Opm::ParserPtr parser(new Opm::Parser()); - Opm::DeckConstPtr deck(parser->parseString(grdecl , parseMode)); + Opm::DeckConstPtr deck(parser->parseString(grdecl , parseContext)); Opm::GridManager manager(deck); VVI columns; diff --git a/tests/test_compressedpropertyaccess.cpp b/tests/test_compressedpropertyaccess.cpp index ab4200f8..f23be5dc 100644 --- a/tests/test_compressedpropertyaccess.cpp +++ b/tests/test_compressedpropertyaccess.cpp @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include @@ -44,10 +44,10 @@ struct SetupSimple { SetupSimple() { - Opm::ParseMode parseMode; + Opm::ParseContext parseContext; Opm::ParserPtr parser(new Opm::Parser()); - deck = parser->parseFile("compressed_gridproperty.data" , parseMode); - ecl.reset(new Opm::EclipseState(deck , parseMode)); + deck = parser->parseFile("compressed_gridproperty.data" , parseContext); + ecl.reset(new Opm::EclipseState(deck , parseContext)); } Opm::DeckConstPtr deck; diff --git a/tests/test_equil.cpp b/tests/test_equil.cpp index 863b384e..ed7f74ff 100644 --- a/tests/test_equil.cpp +++ b/tests/test_equil.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include @@ -363,10 +363,10 @@ BOOST_AUTO_TEST_CASE (DeckAllDead) { std::shared_ptr grid(create_grid_cart3d(1, 1, 10), destroy_grid); - Opm::ParseMode parseMode; + Opm::ParseContext parseContext; Opm::ParserPtr parser(new Opm::Parser() ); - Opm::DeckConstPtr deck = parser->parseFile("deadfluids.DATA" , parseMode); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck, parseMode)); + Opm::DeckConstPtr deck = parser->parseFile("deadfluids.DATA" , parseContext); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck, parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, *grid, false); Opm::EQUIL::DeckDependent::InitialStateComputer comp(props, deck, eclipseState, *grid, 10.0); const auto& pressures = comp.press(); @@ -392,9 +392,9 @@ BOOST_AUTO_TEST_CASE (CapillaryInversion) Opm::GridManager gm(1, 1, 40, 1.0, 1.0, 2.5); const UnstructuredGrid& grid = *(gm.c_grid()); Opm::ParserPtr parser(new Opm::Parser() ); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck = parser->parseFile("capillary.DATA" , parseMode); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck = parser->parseFile("capillary.DATA" , parseContext); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, false); // Test the capillary inversion for oil-water. @@ -446,9 +446,9 @@ BOOST_AUTO_TEST_CASE (DeckWithCapillary) Opm::GridManager gm(1, 1, 20, 1.0, 1.0, 5.0); const UnstructuredGrid& grid = *(gm.c_grid()); Opm::ParserPtr parser(new Opm::Parser() ); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck = parser->parseFile("capillary.DATA" , parseMode); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck = parser->parseFile("capillary.DATA" , parseContext); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, false); Opm::EQUIL::DeckDependent::InitialStateComputer comp(props, deck, eclipseState, grid, 10.0); @@ -487,9 +487,9 @@ BOOST_AUTO_TEST_CASE (DeckWithCapillaryOverlap) Opm::GridManager gm(1, 1, 20, 1.0, 1.0, 5.0); const UnstructuredGrid& grid = *(gm.c_grid()); Opm::ParserPtr parser(new Opm::Parser() ); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck = parser->parseFile("capillary_overlap.DATA" , parseMode); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck = parser->parseFile("capillary_overlap.DATA" , parseContext); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, false); Opm::EQUIL::DeckDependent::InitialStateComputer comp(props, deck, eclipseState, grid, 9.80665); @@ -550,9 +550,9 @@ BOOST_AUTO_TEST_CASE (DeckWithLiveOil) Opm::GridManager gm(1, 1, 20, 1.0, 1.0, 5.0); const UnstructuredGrid& grid = *(gm.c_grid()); Opm::ParserPtr parser(new Opm::Parser() ); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck = parser->parseFile("equil_liveoil.DATA" , parseMode); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck = parser->parseFile("equil_liveoil.DATA" , parseContext); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, false); Opm::EQUIL::DeckDependent::InitialStateComputer comp(props, deck, eclipseState, grid, 9.80665); @@ -630,9 +630,9 @@ BOOST_AUTO_TEST_CASE (DeckWithLiveGas) Opm::GridManager gm(1, 1, 20, 1.0, 1.0, 5.0); const UnstructuredGrid& grid = *(gm.c_grid()); Opm::ParserPtr parser(new Opm::Parser() ); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck = parser->parseFile("equil_livegas.DATA" , parseMode); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck = parser->parseFile("equil_livegas.DATA" , parseContext); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, false); Opm::EQUIL::DeckDependent::InitialStateComputer comp(props, deck, eclipseState, grid, 9.80665); @@ -713,9 +713,9 @@ BOOST_AUTO_TEST_CASE (DeckWithRSVDAndRVVD) Opm::GridManager gm(1, 1, 20, 1.0, 1.0, 5.0); const UnstructuredGrid& grid = *(gm.c_grid()); Opm::ParserPtr parser(new Opm::Parser() ); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck = parser->parseFile("equil_rsvd_and_rvvd.DATA", parseMode); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck = parser->parseFile("equil_rsvd_and_rvvd.DATA", parseContext); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, false); Opm::EQUIL::DeckDependent::InitialStateComputer comp(props, deck, eclipseState, grid, 9.80665); diff --git a/tests/test_norne_pvt.cpp b/tests/test_norne_pvt.cpp index 57e28fcd..664698fb 100644 --- a/tests/test_norne_pvt.cpp +++ b/tests/test_norne_pvt.cpp @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include #include @@ -275,13 +275,13 @@ void verify_norne_oil_pvt_region2(Opm::DeckConstPtr deck, Opm::EclipseStateConst } BOOST_AUTO_TEST_CASE( Test_Norne_PVT) { - Opm::ParseMode parseMode({{ ParseMode::PARSE_RANDOM_SLASH , InputError::IGNORE }}); + Opm::ParseContext parseContext({{ ParseContext::PARSE_RANDOM_SLASH , InputError::IGNORE }}); Opm::ParserPtr parser(new Parser()); std::shared_ptr deck; - deck = parser->parseFile("norne_pvt.data", parseMode); + deck = parser->parseFile("norne_pvt.data", parseContext); - Opm::EclipseStateConstPtr eclState(new EclipseState(deck, parseMode)); + Opm::EclipseStateConstPtr eclState(new EclipseState(deck, parseContext)); verify_norne_oil_pvt_region1( deck, eclState ); verify_norne_oil_pvt_region2( deck, eclState ); diff --git a/tests/test_parser.cpp b/tests/test_parser.cpp index 42b1d72b..fa078882 100644 --- a/tests/test_parser.cpp +++ b/tests/test_parser.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include @@ -42,9 +42,9 @@ BOOST_AUTO_TEST_CASE(CreateParser) { const std::string filename1 = "testBlackoilState1.DATA"; - Opm::ParseMode parseMode; + Opm::ParseContext parseContext; Opm::ParserPtr parser(new Opm::Parser() ); - Opm::DeckConstPtr deck = parser->parseFile( filename1 , parseMode); + Opm::DeckConstPtr deck = parser->parseFile( filename1 , parseContext); BOOST_CHECK_EQUAL( 6U , deck->size() ); const auto& actnum = deck->getKeyword("ACTNUM").getRecord(0).getItem(0); diff --git a/tests/test_pinchprocessor.cpp b/tests/test_pinchprocessor.cpp index aeeff61d..b79fc860 100644 --- a/tests/test_pinchprocessor.cpp +++ b/tests/test_pinchprocessor.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -52,9 +52,9 @@ BOOST_AUTO_TEST_CASE(Processing) { const std::string filename="../tests/testPinch1.DATA"; Opm::ParserPtr parser(new Opm::Parser()); - Opm::ParseMode parseMode({{ ParseMode::PARSE_RANDOM_SLASH , InputError::IGNORE }}); - Opm::DeckConstPtr deck = parser->parseFile(filename, parseMode); - std::shared_ptr eclstate (new Opm::EclipseState(deck, parseMode)); + Opm::ParseContext parseContext({{ ParseContext::PARSE_RANDOM_SLASH , InputError::IGNORE }}); + Opm::DeckConstPtr deck = parser->parseFile(filename, parseContext); + std::shared_ptr eclstate (new Opm::EclipseState(deck, parseContext)); std::vector porv = eclstate->getDoubleGridProperty("PORV")->getData(); EclipseGridConstPtr eclgrid = eclstate->getEclipseGrid(); diff --git a/tests/test_relpermdiagnostics.cpp b/tests/test_relpermdiagnostics.cpp index f83c0be0..379a6c14 100644 --- a/tests/test_relpermdiagnostics.cpp +++ b/tests/test_relpermdiagnostics.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include #include BOOST_AUTO_TEST_SUITE () @@ -50,12 +50,12 @@ BOOST_AUTO_TEST_CASE(diagnosis) using namespace Opm; EclipseStateConstPtr eclState; ParserPtr parser(new Opm::Parser); - Opm::ParseMode parseMode({{ ParseMode::PARSE_RANDOM_SLASH , InputError::IGNORE }, - { ParseMode::PARSE_UNKNOWN_KEYWORD, InputError::IGNORE}, - { ParseMode::PARSE_RANDOM_TEXT, InputError::IGNORE} + Opm::ParseContext parseContext({{ ParseContext::PARSE_RANDOM_SLASH , InputError::IGNORE }, + { ParseContext::PARSE_UNKNOWN_KEYWORD, InputError::IGNORE}, + { ParseContext::PARSE_RANDOM_TEXT, InputError::IGNORE} }); - Opm::DeckConstPtr deck(parser->parseFile("../tests/relpermDiagnostics.DATA", parseMode)); - eclState.reset(new EclipseState(deck, parseMode)); + Opm::DeckConstPtr deck(parser->parseFile("../tests/relpermDiagnostics.DATA", parseContext)); + eclState.reset(new EclipseState(deck, parseContext)); GridManager gm(deck); const UnstructuredGrid& grid = *gm.c_grid(); diff --git a/tests/test_satfunc.cpp b/tests/test_satfunc.cpp index c7ce9bfe..b5630589 100644 --- a/tests/test_satfunc.cpp +++ b/tests/test_satfunc.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -67,9 +67,9 @@ BOOST_AUTO_TEST_CASE (GwsegStandard) Opm::GridManager gm(1, 1, 10, 1.0, 1.0, 5.0); const UnstructuredGrid& grid = *(gm.c_grid()); Opm::ParserPtr parser(new Opm::Parser() ); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck = parser->parseFile("satfuncStandard.DATA", parseMode); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck = parser->parseFile("satfuncStandard.DATA", parseContext); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, param, false); const int np = 3; @@ -153,9 +153,9 @@ BOOST_AUTO_TEST_CASE (GwsegEPSBase) Opm::GridManager gm(1, 1, 10, 1.0, 1.0, 5.0); const UnstructuredGrid& grid = *(gm.c_grid()); Opm::ParserPtr parser(new Opm::Parser() ); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck = parser->parseFile("satfuncEPSBase.DATA" , parseMode); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck = parser->parseFile("satfuncEPSBase.DATA" , parseContext); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, param, false); const int np = 3; @@ -238,10 +238,10 @@ BOOST_AUTO_TEST_CASE (GwsegEPS_A) Opm::GridManager gm(1, 1, 10, 1.0, 1.0, 5.0); const UnstructuredGrid& grid = *(gm.c_grid()); - Opm::ParseMode parseMode; + Opm::ParseContext parseContext; Opm::ParserPtr parser(new Opm::Parser() ); - Opm::DeckConstPtr deck = parser->parseFile("satfuncEPS_A.DATA" , parseMode); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::DeckConstPtr deck = parser->parseFile("satfuncEPS_A.DATA" , parseContext); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, param, false); const int np = 3; @@ -491,9 +491,9 @@ BOOST_AUTO_TEST_CASE (GwsegEPS_C) Opm::GridManager gm(1, 1, 10, 1.0, 1.0, 5.0); const UnstructuredGrid& grid = *(gm.c_grid()); Opm::ParserPtr parser(new Opm::Parser() ); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck = parser->parseFile("satfuncEPS_C.DATA", parseMode); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck = parser->parseFile("satfuncEPS_C.DATA", parseContext); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, param, false); const int np = 3; @@ -594,9 +594,9 @@ BOOST_AUTO_TEST_CASE (GwsegEPS_D) Opm::GridManager gm(1, 1, 10, 1.0, 1.0, 5.0); const UnstructuredGrid& grid = *(gm.c_grid()); Opm::ParserPtr parser(new Opm::Parser() ); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck = parser->parseFile("satfuncEPS_D.DATA" , parseMode); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck = parser->parseFile("satfuncEPS_D.DATA" , parseContext); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, param, false); const int np = 3; diff --git a/tests/test_stoppedwells.cpp b/tests/test_stoppedwells.cpp index 39d4f60a..d706f61e 100644 --- a/tests/test_stoppedwells.cpp +++ b/tests/test_stoppedwells.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -44,10 +44,10 @@ BOOST_AUTO_TEST_CASE(TestStoppedWells) { const std::string filename = "wells_stopped.data"; Opm::ParserPtr parser(new Opm::Parser()); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck(parser->parseFile(filename , parseMode)); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck(parser->parseFile(filename , parseContext)); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::GridManager gridManager(deck); double target_surfacerate_inj; diff --git a/tests/test_thresholdpressure.cpp b/tests/test_thresholdpressure.cpp index 61d2b41a..d82ed0b7 100644 --- a/tests/test_thresholdpressure.cpp +++ b/tests/test_thresholdpressure.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include @@ -32,7 +32,7 @@ static DeckPtr createDeckSimConfig() { ParserPtr parser(new Parser()); - return parser->parseString(inputStr, ParseMode()) ; + return parser->parseString(inputStr, ParseContext()) ; } /* @@ -42,15 +42,15 @@ static DeckPtr createDeckSimConfig() { */ BOOST_AUTO_TEST_CASE(CreateSimulationConfig) { - ParseMode parseMode; + ParseContext parseContext; typedef UnstructuredGrid Grid; DeckPtr deck = createDeckSimConfig(); - EclipseState state(deck, parseMode); + EclipseState state(deck, parseContext); EclipseGridConstPtr eclipseGrid = state.getEclipseGrid(); std::vector porv = eclipseState->getDoubleGridProperty("PORV")->getData(); GridManager gridManager( eclipseState->getEclipseGrid(), porv ); const Grid& grid = *(gridManager.c_grid()); - std::vector threshold_pressures = thresholdPressures(parseMode, eclipseState, grid); + std::vector threshold_pressures = thresholdPressures(parseContext, eclipseState, grid); BOOST_CHECK( threshold_pressures.size() > 0 ); } diff --git a/tests/test_timer.cpp b/tests/test_timer.cpp index 4b7552a2..3512ddd6 100644 --- a/tests/test_timer.cpp +++ b/tests/test_timer.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include @@ -44,8 +44,8 @@ BOOST_AUTO_TEST_CASE(CreateTimer) { const std::string filename1 = "TESTTIMER.DATA"; Opm::ParserPtr parser(new Opm::Parser() ); - Opm::ParseMode parseMode; - Opm::DeckConstPtr parserDeck = parser->parseFile( filename1 , parseMode); + Opm::ParseContext parseContext; + Opm::DeckConstPtr parserDeck = parser->parseFile( filename1 , parseContext); Opm::TimeMapPtr timeMap(new Opm::TimeMap(parserDeck)); Opm::SimulatorTimer simtimer; diff --git a/tests/test_ug.cpp b/tests/test_ug.cpp index 08e7d6cd..0a38788a 100644 --- a/tests/test_ug.cpp +++ b/tests/test_ug.cpp @@ -23,7 +23,7 @@ #include /* compute_geometry */ #include #include -#include +#include #include #include #include @@ -34,7 +34,7 @@ using namespace std; BOOST_AUTO_TEST_CASE(Equal) { - Opm::ParseMode parseMode; + Opm::ParseContext parseContext; const std::string filename1 = "CORNERPOINT_ACTNUM.DATA"; const char *deck2Data = "RUNSPEC\n" @@ -54,8 +54,8 @@ BOOST_AUTO_TEST_CASE(Equal) { "\n"; Opm::ParserPtr parser(new Opm::Parser() ); - Opm::DeckConstPtr deck1 = parser->parseFile( filename1 , parseMode); - Opm::DeckConstPtr deck2 = parser->parseString( deck2Data , parseMode); + Opm::DeckConstPtr deck1 = parser->parseFile( filename1 , parseContext); + Opm::DeckConstPtr deck2 = parser->parseString( deck2Data , parseContext); BOOST_CHECK( deck1->hasKeyword("ZCORN") ); BOOST_CHECK( deck1->hasKeyword("COORD") ); @@ -78,8 +78,8 @@ BOOST_AUTO_TEST_CASE(Equal) { BOOST_AUTO_TEST_CASE(EqualEclipseGrid) { const std::string filename = "CORNERPOINT_ACTNUM.DATA"; Opm::ParserPtr parser(new Opm::Parser() ); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck = parser->parseFile( filename , parseMode); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck = parser->parseFile( filename , parseContext); std::shared_ptr grid(new Opm::EclipseGrid(deck)); @@ -151,9 +151,9 @@ BOOST_AUTO_TEST_CASE(TOPS_Fully_Specified) { "\n"; Opm::ParserPtr parser(new Opm::Parser() ); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck1 = parser->parseString( deck1Data , parseMode); - Opm::DeckConstPtr deck2 = parser->parseString( deck2Data , parseMode); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck1 = parser->parseString( deck1Data , parseContext); + Opm::DeckConstPtr deck2 = parser->parseString( deck2Data , parseContext); std::shared_ptr grid1(new Opm::EclipseGrid(deck1)); std::shared_ptr grid2(new Opm::EclipseGrid(deck2)); diff --git a/tests/test_wellcollection.cpp b/tests/test_wellcollection.cpp index ac6e4934..6870853d 100644 --- a/tests/test_wellcollection.cpp +++ b/tests/test_wellcollection.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -42,9 +42,9 @@ using namespace Opm; BOOST_AUTO_TEST_CASE(AddWellsAndGroupToCollection) { ParserPtr parser(new Parser()); std::string scheduleFile("wells_group.data"); - ParseMode parseMode; - DeckConstPtr deck = parser->parseFile(scheduleFile, parseMode); - EclipseStateConstPtr eclipseState(new EclipseState(deck, parseMode)); + ParseContext parseContext; + DeckConstPtr deck = parser->parseFile(scheduleFile, parseContext); + EclipseStateConstPtr eclipseState(new EclipseState(deck, parseContext)); PhaseUsage pu = phaseUsageFromDeck(eclipseState); GroupTreeNodePtr field=eclipseState->getSchedule()->getGroupTree(2)->getNode("FIELD"); diff --git a/tests/test_wellsgroup.cpp b/tests/test_wellsgroup.cpp index 8f9a76ee..0556bc71 100644 --- a/tests/test_wellsgroup.cpp +++ b/tests/test_wellsgroup.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include @@ -50,9 +50,9 @@ using namespace Opm; BOOST_AUTO_TEST_CASE(ConstructGroupFromWell) { ParserPtr parser(new Parser()); std::string scheduleFile("wells_group.data"); - ParseMode parseMode; - DeckConstPtr deck = parser->parseFile(scheduleFile, parseMode); - EclipseStateConstPtr eclipseState(new EclipseState(deck , parseMode)); + ParseContext parseContext; + DeckConstPtr deck = parser->parseFile(scheduleFile, parseContext); + EclipseStateConstPtr eclipseState(new EclipseState(deck , parseContext)); PhaseUsage pu = phaseUsageFromDeck(eclipseState); std::vector wells = eclipseState->getSchedule()->getWells(); @@ -82,10 +82,10 @@ BOOST_AUTO_TEST_CASE(ConstructGroupFromWell) { BOOST_AUTO_TEST_CASE(ConstructGroupFromGroup) { ParserPtr parser(new Parser()); - ParseMode parseMode; + ParseContext parseContext; std::string scheduleFile("wells_group.data"); - DeckConstPtr deck = parser->parseFile(scheduleFile, parseMode); - EclipseStateConstPtr eclipseState(new EclipseState(deck , parseMode)); + DeckConstPtr deck = parser->parseFile(scheduleFile, parseContext); + EclipseStateConstPtr eclipseState(new EclipseState(deck , parseContext)); PhaseUsage pu = phaseUsageFromDeck(eclipseState); std::vector nodes = eclipseState->getSchedule()->getGroupTree(2)->getNodes(); diff --git a/tests/test_wellsmanager.cpp b/tests/test_wellsmanager.cpp index 2daebf63..da5995f2 100644 --- a/tests/test_wellsmanager.cpp +++ b/tests/test_wellsmanager.cpp @@ -29,270 +29,270 @@ #include #include -#include -#include + #include + #include -#include -#include -#include + #include + #include + #include -#include + #include -void wells_static_check(const Wells* wells) { - BOOST_CHECK_EQUAL(2 , wells->number_of_wells); - BOOST_CHECK_EQUAL(3 , wells->number_of_phases); + void wells_static_check(const Wells* wells) { + BOOST_CHECK_EQUAL(2 , wells->number_of_wells); + BOOST_CHECK_EQUAL(3 , wells->number_of_phases); - BOOST_CHECK_EQUAL("INJ1" , wells->name[0]); - BOOST_CHECK_EQUAL("PROD1" , wells->name[1]); + BOOST_CHECK_EQUAL("INJ1" , wells->name[0]); + BOOST_CHECK_EQUAL("PROD1" , wells->name[1]); - /* The mapping from well number into the wells->WI and wells->well_cells arrays. */ - BOOST_CHECK_EQUAL(0 , wells->well_connpos[0]); - BOOST_CHECK_EQUAL(1 , wells->well_connpos[1]); - BOOST_CHECK_EQUAL(2 , wells->well_connpos[2]); + /* The mapping from well number into the wells->WI and wells->well_cells arrays. */ + BOOST_CHECK_EQUAL(0 , wells->well_connpos[0]); + BOOST_CHECK_EQUAL(1 , wells->well_connpos[1]); + BOOST_CHECK_EQUAL(2 , wells->well_connpos[2]); - /* Connection factor */ - BOOST_CHECK_CLOSE(1.2279166666666664e-12 , wells->WI[0] , 0.001); - BOOST_CHECK_CLOSE(1.2279166666666664e-12 , wells->WI[1] , 0.001); + /* Connection factor */ + BOOST_CHECK_CLOSE(1.2279166666666664e-12 , wells->WI[0] , 0.001); + BOOST_CHECK_CLOSE(1.2279166666666664e-12 , wells->WI[1] , 0.001); - /* Completed cells */ - BOOST_CHECK_EQUAL(0 , wells->well_cells[0]); - BOOST_CHECK_EQUAL(9 + 2*10 + 2*10*10 , wells->well_cells[1]); -} - - -/* - The number of controls is determined by looking at which elements - have been given explicit - non-default - values in the WCONxxxx - keyword. Is that at all interesting? -*/ - - -void check_controls_epoch0( struct WellControls ** ctrls) { - // The injector - { - const struct WellControls * ctrls0 = ctrls[0]; - BOOST_CHECK_EQUAL( 3 , well_controls_get_num(ctrls0)); // The number of controls for the injector == 3?? - - BOOST_CHECK_EQUAL( SURFACE_RATE , well_controls_iget_type(ctrls0 , 0) ); - BOOST_CHECK_EQUAL( RESERVOIR_RATE , well_controls_iget_type(ctrls0 , 1) ); - BOOST_CHECK_EQUAL( BHP , well_controls_iget_type(ctrls0 , 2) ); - - // The different targets - BOOST_CHECK_EQUAL( 100.0 / 86400 , well_controls_iget_target(ctrls0,0)); - BOOST_CHECK_EQUAL( 200.0 / 86400 , well_controls_iget_target(ctrls0,1)); - BOOST_CHECK_EQUAL( 400 * 100000 , well_controls_iget_target(ctrls0,2)); - - // Which control is active - BOOST_CHECK_EQUAL( 0 , well_controls_get_current(ctrls0) ); - - // The phase distribution in the active target - { - const double * distr = well_controls_iget_distr( ctrls0 , 0 ); - BOOST_CHECK_EQUAL( 0 , distr[0] ); // Water - BOOST_CHECK_EQUAL( 0 , distr[1] ); // Oil - BOOST_CHECK_EQUAL( 1 , distr[2] ); // Gas + /* Completed cells */ + BOOST_CHECK_EQUAL(0 , wells->well_cells[0]); + BOOST_CHECK_EQUAL(9 + 2*10 + 2*10*10 , wells->well_cells[1]); } - } - // The producer - { - const struct WellControls * ctrls1 = ctrls[1]; - BOOST_CHECK_EQUAL( 2 , well_controls_get_num( ctrls1 )); // The number of controls for the producer == 2?? - BOOST_CHECK_EQUAL( SURFACE_RATE , well_controls_iget_type(ctrls1 , 0) ); - BOOST_CHECK_EQUAL( BHP , well_controls_iget_type(ctrls1 , 1) ); - // The different targets - BOOST_CHECK_EQUAL( -20000.0 / 86400 , well_controls_iget_target(ctrls1,0)); - BOOST_CHECK_EQUAL( 1000 * 100000 , well_controls_iget_target(ctrls1,1)); + /* + The number of controls is determined by looking at which elements + have been given explicit - non-default - values in the WCONxxxx + keyword. Is that at all interesting? + */ - // Which control is active - BOOST_CHECK_EQUAL( 0 , well_controls_get_current(ctrls1)); - // The phase distribution in the active target - { - const double * distr = well_controls_iget_distr( ctrls1 , 0 ); - BOOST_CHECK_EQUAL( 0 , distr[0] ); // Water - BOOST_CHECK_EQUAL( 1 , distr[1] ); // Oil - BOOST_CHECK_EQUAL( 0 , distr[2] ); // Gas + void check_controls_epoch0( struct WellControls ** ctrls) { + // The injector + { + const struct WellControls * ctrls0 = ctrls[0]; + BOOST_CHECK_EQUAL( 3 , well_controls_get_num(ctrls0)); // The number of controls for the injector == 3?? + + BOOST_CHECK_EQUAL( SURFACE_RATE , well_controls_iget_type(ctrls0 , 0) ); + BOOST_CHECK_EQUAL( RESERVOIR_RATE , well_controls_iget_type(ctrls0 , 1) ); + BOOST_CHECK_EQUAL( BHP , well_controls_iget_type(ctrls0 , 2) ); + + // The different targets + BOOST_CHECK_EQUAL( 100.0 / 86400 , well_controls_iget_target(ctrls0,0)); + BOOST_CHECK_EQUAL( 200.0 / 86400 , well_controls_iget_target(ctrls0,1)); + BOOST_CHECK_EQUAL( 400 * 100000 , well_controls_iget_target(ctrls0,2)); + + // Which control is active + BOOST_CHECK_EQUAL( 0 , well_controls_get_current(ctrls0) ); + + // The phase distribution in the active target + { + const double * distr = well_controls_iget_distr( ctrls0 , 0 ); + BOOST_CHECK_EQUAL( 0 , distr[0] ); // Water + BOOST_CHECK_EQUAL( 0 , distr[1] ); // Oil + BOOST_CHECK_EQUAL( 1 , distr[2] ); // Gas + } + } + + // The producer + { + const struct WellControls * ctrls1 = ctrls[1]; + BOOST_CHECK_EQUAL( 2 , well_controls_get_num( ctrls1 )); // The number of controls for the producer == 2?? + BOOST_CHECK_EQUAL( SURFACE_RATE , well_controls_iget_type(ctrls1 , 0) ); + BOOST_CHECK_EQUAL( BHP , well_controls_iget_type(ctrls1 , 1) ); + + // The different targets + BOOST_CHECK_EQUAL( -20000.0 / 86400 , well_controls_iget_target(ctrls1,0)); + BOOST_CHECK_EQUAL( 1000 * 100000 , well_controls_iget_target(ctrls1,1)); + + // Which control is active + BOOST_CHECK_EQUAL( 0 , well_controls_get_current(ctrls1)); + + // The phase distribution in the active target + { + const double * distr = well_controls_iget_distr( ctrls1 , 0 ); + BOOST_CHECK_EQUAL( 0 , distr[0] ); // Water + BOOST_CHECK_EQUAL( 1 , distr[1] ); // Oil + BOOST_CHECK_EQUAL( 0 , distr[2] ); // Gas + } + } } - } -} -void check_controls_epoch1( struct WellControls ** ctrls) { - // The injector - { - const struct WellControls * ctrls0 = ctrls[0]; - BOOST_CHECK_EQUAL( 3 , well_controls_get_num(ctrls0)); // The number of controls for the injector == 3?? + void check_controls_epoch1( struct WellControls ** ctrls) { + // The injector + { + const struct WellControls * ctrls0 = ctrls[0]; + BOOST_CHECK_EQUAL( 3 , well_controls_get_num(ctrls0)); // The number of controls for the injector == 3?? - BOOST_CHECK_EQUAL( SURFACE_RATE , well_controls_iget_type(ctrls0 , 0 )); - BOOST_CHECK_EQUAL( RESERVOIR_RATE , well_controls_iget_type(ctrls0 , 1 )); - BOOST_CHECK_EQUAL( BHP , well_controls_iget_type(ctrls0 , 2 )); + BOOST_CHECK_EQUAL( SURFACE_RATE , well_controls_iget_type(ctrls0 , 0 )); + BOOST_CHECK_EQUAL( RESERVOIR_RATE , well_controls_iget_type(ctrls0 , 1 )); + BOOST_CHECK_EQUAL( BHP , well_controls_iget_type(ctrls0 , 2 )); - // The different targets - BOOST_CHECK_CLOSE( 10.0 / 86400 , well_controls_iget_target(ctrls0 , 0) , 0.001); - BOOST_CHECK_CLOSE( 20.0 / 86400 , well_controls_iget_target(ctrls0 , 1) , 0.001); - BOOST_CHECK_CLOSE( 40 * 100000 , well_controls_iget_target(ctrls0 , 2) , 0.001); + // The different targets + BOOST_CHECK_CLOSE( 10.0 / 86400 , well_controls_iget_target(ctrls0 , 0) , 0.001); + BOOST_CHECK_CLOSE( 20.0 / 86400 , well_controls_iget_target(ctrls0 , 1) , 0.001); + BOOST_CHECK_CLOSE( 40 * 100000 , well_controls_iget_target(ctrls0 , 2) , 0.001); - // Which control is active - BOOST_CHECK_EQUAL( 1 , well_controls_get_current(ctrls0)); + // Which control is active + BOOST_CHECK_EQUAL( 1 , well_controls_get_current(ctrls0)); - { - const double * distr = well_controls_iget_distr( ctrls0 , 1 ); - BOOST_CHECK_EQUAL( 1 , distr[0] ); // Water - BOOST_CHECK_EQUAL( 0 , distr[1] ); // Oil - BOOST_CHECK_EQUAL( 0 , distr[2] ); // Gas + { + const double * distr = well_controls_iget_distr( ctrls0 , 1 ); + BOOST_CHECK_EQUAL( 1 , distr[0] ); // Water + BOOST_CHECK_EQUAL( 0 , distr[1] ); // Oil + BOOST_CHECK_EQUAL( 0 , distr[2] ); // Gas + } + } + + // The producer + { + const struct WellControls * ctrls1 = ctrls[1]; + BOOST_CHECK_EQUAL( 3 , well_controls_get_num(ctrls1)); // The number of controls for the producer - now 3. + BOOST_CHECK_EQUAL( SURFACE_RATE , well_controls_iget_type(ctrls1 , 0) ); + BOOST_CHECK_EQUAL( RESERVOIR_RATE , well_controls_iget_type(ctrls1 , 1) ); + BOOST_CHECK_EQUAL( BHP , well_controls_iget_type(ctrls1 , 2) ); + + // The different targets + BOOST_CHECK_CLOSE( -999.0 / 86400 , well_controls_iget_target(ctrls1 , 0), 0.001); + BOOST_CHECK_CLOSE( -123.0 / 86400 , well_controls_iget_target(ctrls1 , 1), 0.001); + BOOST_CHECK_CLOSE( 100 * 100000 , well_controls_iget_target(ctrls1 , 2), 0.001); + + // Which control is active + BOOST_CHECK_EQUAL( 1 , well_controls_get_current(ctrls1) ); + + { + const double * distr = well_controls_iget_distr( ctrls1 , 1 ); + BOOST_CHECK_EQUAL( 1 , distr[0] ); // Water + BOOST_CHECK_EQUAL( 1 , distr[1] ); // Oil + BOOST_CHECK_EQUAL( 1 , distr[2] ); // Gas + } + } } - } - // The producer - { - const struct WellControls * ctrls1 = ctrls[1]; - BOOST_CHECK_EQUAL( 3 , well_controls_get_num(ctrls1)); // The number of controls for the producer - now 3. - BOOST_CHECK_EQUAL( SURFACE_RATE , well_controls_iget_type(ctrls1 , 0) ); - BOOST_CHECK_EQUAL( RESERVOIR_RATE , well_controls_iget_type(ctrls1 , 1) ); - BOOST_CHECK_EQUAL( BHP , well_controls_iget_type(ctrls1 , 2) ); - // The different targets - BOOST_CHECK_CLOSE( -999.0 / 86400 , well_controls_iget_target(ctrls1 , 0), 0.001); - BOOST_CHECK_CLOSE( -123.0 / 86400 , well_controls_iget_target(ctrls1 , 1), 0.001); - BOOST_CHECK_CLOSE( 100 * 100000 , well_controls_iget_target(ctrls1 , 2), 0.001); - - // Which control is active - BOOST_CHECK_EQUAL( 1 , well_controls_get_current(ctrls1) ); - - { - const double * distr = well_controls_iget_distr( ctrls1 , 1 ); - BOOST_CHECK_EQUAL( 1 , distr[0] ); // Water - BOOST_CHECK_EQUAL( 1 , distr[1] ); // Oil - BOOST_CHECK_EQUAL( 1 , distr[2] ); // Gas + void check_controls_epoch3( struct WellControls ** ctrls) { + // The new producer + const struct WellControls * ctrls1 = ctrls[1]; + // Note: controls include default (1 atm) BHP control. + BOOST_CHECK_EQUAL( 6 , well_controls_get_num(ctrls1)); } - } -} - - -void check_controls_epoch3( struct WellControls ** ctrls) { - // The new producer - const struct WellControls * ctrls1 = ctrls[1]; - // Note: controls include default (1 atm) BHP control. - BOOST_CHECK_EQUAL( 6 , well_controls_get_num(ctrls1)); -} -BOOST_AUTO_TEST_CASE(New_Constructor_Works) { + BOOST_AUTO_TEST_CASE(New_Constructor_Works) { - const std::string filename = "wells_manager_data.data"; - Opm::ParserPtr parser(new Opm::Parser()); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck(parser->parseFile(filename , parseMode)); + const std::string filename = "wells_manager_data.data"; + Opm::ParserPtr parser(new Opm::Parser()); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck(parser->parseFile(filename , parseContext)); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); - Opm::GridManager gridManager(deck); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); + Opm::GridManager gridManager(deck); - { - Opm::WellsManager wellsManager(eclipseState, 0, *gridManager.c_grid(), NULL); - wells_static_check( wellsManager.c_wells() ); - check_controls_epoch0( wellsManager.c_wells()->ctrls ); - } + { + Opm::WellsManager wellsManager(eclipseState, 0, *gridManager.c_grid(), NULL); + wells_static_check( wellsManager.c_wells() ); + check_controls_epoch0( wellsManager.c_wells()->ctrls ); + } - { - Opm::WellsManager wellsManager(eclipseState, 1, *gridManager.c_grid(), NULL); - wells_static_check( wellsManager.c_wells() ); - check_controls_epoch1( wellsManager.c_wells()->ctrls ); - } + { + Opm::WellsManager wellsManager(eclipseState, 1, *gridManager.c_grid(), NULL); + wells_static_check( wellsManager.c_wells() ); + check_controls_epoch1( wellsManager.c_wells()->ctrls ); + } - { - Opm::WellsManager wellsManager(eclipseState, 3, *gridManager.c_grid(), NULL); - const Wells* wells = wellsManager.c_wells(); + { + Opm::WellsManager wellsManager(eclipseState, 3, *gridManager.c_grid(), NULL); + const Wells* wells = wellsManager.c_wells(); - // There is 3 wells in total in the deck at the 3rd schedule step. - // PROD1 is shut and should therefore not be counted. - // The new well is therefore the secound well. - BOOST_CHECK_EQUAL(2 , wells->number_of_wells); - BOOST_CHECK_EQUAL( wells->name[0] , "INJ1"); - BOOST_CHECK_EQUAL( wells->name[1] , "NEW"); + // There is 3 wells in total in the deck at the 3rd schedule step. + // PROD1 is shut and should therefore not be counted. + // The new well is therefore the secound well. + BOOST_CHECK_EQUAL(2 , wells->number_of_wells); + BOOST_CHECK_EQUAL( wells->name[0] , "INJ1"); + BOOST_CHECK_EQUAL( wells->name[1] , "NEW"); - check_controls_epoch3( wellsManager.c_wells()->ctrls ); - } + check_controls_epoch3( wellsManager.c_wells()->ctrls ); + } -} + } -BOOST_AUTO_TEST_CASE(WellsEqual) { - const std::string filename = "wells_manager_data.data"; - Opm::ParserPtr parser(new Opm::Parser()); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck(parser->parseFile(filename , parseMode)); + BOOST_AUTO_TEST_CASE(WellsEqual) { + const std::string filename = "wells_manager_data.data"; + Opm::ParserPtr parser(new Opm::Parser()); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck(parser->parseFile(filename , parseContext)); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); - Opm::GridManager gridManager(deck); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); + Opm::GridManager gridManager(deck); - Opm::WellsManager wellsManager0(eclipseState , 0 , *gridManager.c_grid(), NULL); - Opm::WellsManager wellsManager1(eclipseState , 1 , *gridManager.c_grid(), NULL); + Opm::WellsManager wellsManager0(eclipseState , 0 , *gridManager.c_grid(), NULL); + Opm::WellsManager wellsManager1(eclipseState , 1 , *gridManager.c_grid(), NULL); - BOOST_CHECK( wells_equal( wellsManager0.c_wells() , wellsManager0.c_wells(),false) ); - BOOST_CHECK( !wells_equal( wellsManager0.c_wells() , wellsManager1.c_wells(),false) ); -} + BOOST_CHECK( wells_equal( wellsManager0.c_wells() , wellsManager0.c_wells(),false) ); + BOOST_CHECK( !wells_equal( wellsManager0.c_wells() , wellsManager1.c_wells(),false) ); + } -BOOST_AUTO_TEST_CASE(ControlsEqual) { - const std::string filename = "wells_manager_data.data"; - Opm::ParseMode parseMode; - Opm::ParserPtr parser(new Opm::Parser()); - Opm::DeckConstPtr deck(parser->parseFile(filename , parseMode)); + BOOST_AUTO_TEST_CASE(ControlsEqual) { + const std::string filename = "wells_manager_data.data"; + Opm::ParseContext parseContext; + Opm::ParserPtr parser(new Opm::Parser()); + Opm::DeckConstPtr deck(parser->parseFile(filename , parseContext)); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); - Opm::GridManager gridManager(deck); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); + Opm::GridManager gridManager(deck); - Opm::WellsManager wellsManager0(eclipseState , 0 , *gridManager.c_grid(), NULL); - Opm::WellsManager wellsManager1(eclipseState , 1 , *gridManager.c_grid(), NULL); + Opm::WellsManager wellsManager0(eclipseState , 0 , *gridManager.c_grid(), NULL); + Opm::WellsManager wellsManager1(eclipseState , 1 , *gridManager.c_grid(), NULL); - BOOST_CHECK( well_controls_equal( wellsManager0.c_wells()->ctrls[0] , wellsManager0.c_wells()->ctrls[0] , false)); - BOOST_CHECK( well_controls_equal( wellsManager0.c_wells()->ctrls[1] , wellsManager0.c_wells()->ctrls[1] , false)); - BOOST_CHECK( well_controls_equal( wellsManager1.c_wells()->ctrls[0] , wellsManager1.c_wells()->ctrls[0] , false)); - BOOST_CHECK( well_controls_equal( wellsManager1.c_wells()->ctrls[1] , wellsManager1.c_wells()->ctrls[1] , false)); + BOOST_CHECK( well_controls_equal( wellsManager0.c_wells()->ctrls[0] , wellsManager0.c_wells()->ctrls[0] , false)); + BOOST_CHECK( well_controls_equal( wellsManager0.c_wells()->ctrls[1] , wellsManager0.c_wells()->ctrls[1] , false)); + BOOST_CHECK( well_controls_equal( wellsManager1.c_wells()->ctrls[0] , wellsManager1.c_wells()->ctrls[0] , false)); + BOOST_CHECK( well_controls_equal( wellsManager1.c_wells()->ctrls[1] , wellsManager1.c_wells()->ctrls[1] , false)); - BOOST_CHECK( !well_controls_equal( wellsManager0.c_wells()->ctrls[0] , wellsManager0.c_wells()->ctrls[1] , false)); - BOOST_CHECK( !well_controls_equal( wellsManager0.c_wells()->ctrls[1] , wellsManager0.c_wells()->ctrls[0] , false)); - BOOST_CHECK( !well_controls_equal( wellsManager1.c_wells()->ctrls[0] , wellsManager0.c_wells()->ctrls[0] , false)); - BOOST_CHECK( !well_controls_equal( wellsManager1.c_wells()->ctrls[1] , wellsManager0.c_wells()->ctrls[1] , false)); -} + BOOST_CHECK( !well_controls_equal( wellsManager0.c_wells()->ctrls[0] , wellsManager0.c_wells()->ctrls[1] , false)); + BOOST_CHECK( !well_controls_equal( wellsManager0.c_wells()->ctrls[1] , wellsManager0.c_wells()->ctrls[0] , false)); + BOOST_CHECK( !well_controls_equal( wellsManager1.c_wells()->ctrls[0] , wellsManager0.c_wells()->ctrls[0] , false)); + BOOST_CHECK( !well_controls_equal( wellsManager1.c_wells()->ctrls[1] , wellsManager0.c_wells()->ctrls[1] , false)); + } -BOOST_AUTO_TEST_CASE(WellShutOK) { - const std::string filename = "wells_manager_data.data"; - Opm::ParserPtr parser(new Opm::Parser()); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck(parser->parseFile(filename , parseMode)); + BOOST_AUTO_TEST_CASE(WellShutOK) { + const std::string filename = "wells_manager_data.data"; + Opm::ParserPtr parser(new Opm::Parser()); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck(parser->parseFile(filename , parseContext)); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); - Opm::GridManager gridManager(deck); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); + Opm::GridManager gridManager(deck); - Opm::WellsManager wellsManager2(eclipseState , 2 , *gridManager.c_grid(), NULL); + Opm::WellsManager wellsManager2(eclipseState , 2 , *gridManager.c_grid(), NULL); - // Shut wells are not added to the deck. i.e number of wells should be 2-1 - BOOST_CHECK( wellsManager2.c_wells()->number_of_wells == 1); + // Shut wells are not added to the deck. i.e number of wells should be 2-1 + BOOST_CHECK( wellsManager2.c_wells()->number_of_wells == 1); - //BOOST_CHECK_NO_THROW( Opm::WellsManager wellsManager2(eclipseState , 2 , *gridManager.c_grid(), NULL)); -} + //BOOST_CHECK_NO_THROW( Opm::WellsManager wellsManager2(eclipseState , 2 , *gridManager.c_grid(), NULL)); + } -BOOST_AUTO_TEST_CASE(WellSTOPOK) { - const std::string filename = "wells_manager_data_wellSTOP.data"; - Opm::ParserPtr parser(new Opm::Parser()); - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck(parser->parseFile(filename , parseMode)); + BOOST_AUTO_TEST_CASE(WellSTOPOK) { + const std::string filename = "wells_manager_data_wellSTOP.data"; + Opm::ParserPtr parser(new Opm::Parser()); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck(parser->parseFile(filename , parseContext)); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::GridManager gridManager(deck); Opm::WellsManager wellsManager(eclipseState , 0 , *gridManager.c_grid(), NULL); diff --git a/tests/test_writeReadRestartFile.cpp b/tests/test_writeReadRestartFile.cpp index b5df7a84..1900034a 100644 --- a/tests/test_writeReadRestartFile.cpp +++ b/tests/test_writeReadRestartFile.cpp @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include #include @@ -252,9 +252,9 @@ BOOST_AUTO_TEST_CASE(EclipseReadWriteWellStateData) test_work_area_type * test_area = test_work_area_alloc("EclipseReadWriteWellStateData"); Opm::Parser parser; - Opm::ParseMode parseMode; - Opm::DeckConstPtr deck = parser.parseString(input, parseMode); - Opm::EclipseStatePtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::ParseContext parseContext; + Opm::DeckConstPtr deck = parser.parseString(input, parseContext); + Opm::EclipseStatePtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::EclipseWriterPtr eclipseWriter = createEclipseWriter(deck, eclipseState, eclipse_data_filename); std::shared_ptr simTimer( new Opm::SimulatorTimer() ); diff --git a/tests/test_writenumwells.cpp b/tests/test_writenumwells.cpp index 0b20b9b5..580e7b88 100644 --- a/tests/test_writenumwells.cpp +++ b/tests/test_writenumwells.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include #include @@ -137,7 +137,7 @@ std::shared_ptr createBlackOilState(Opm::EclipseGridConstPtr Opm::DeckConstPtr createDeck(const std::string& eclipse_data_filename) { Opm::ParserPtr parser(new Opm::Parser()); - Opm::DeckConstPtr deck = parser->parseFile(eclipse_data_filename , Opm::ParseMode()); + Opm::DeckConstPtr deck = parser->parseFile(eclipse_data_filename , Opm::ParseContext()); return deck; } @@ -170,9 +170,9 @@ BOOST_AUTO_TEST_CASE(EclipseWriteRestartWellInfo) test_work_area_type * test_area = test_work_area_alloc("TEST_EclipseWriteNumWells"); test_work_area_copy_file(test_area, eclipse_data_filename.c_str()); - Opm::ParseMode parseMode; + Opm::ParseContext parseContext; Opm::DeckConstPtr deck = createDeck(eclipse_data_filename); - Opm::EclipseStatePtr eclipseState(new Opm::EclipseState(deck , parseMode)); + Opm::EclipseStatePtr eclipseState(new Opm::EclipseState(deck , parseContext)); Opm::EclipseWriterPtr eclipseWriter = createEclipseWriter(deck, eclipseState, eclipse_data_filename); std::shared_ptr simTimer( new Opm::SimulatorTimer() );