diff --git a/flow/flow.cpp b/flow/flow.cpp index f81c97e2b..4db369aa3 100644 --- a/flow/flow.cpp +++ b/flow/flow.cpp @@ -40,6 +40,8 @@ #include #include +#include +#include #include #include @@ -178,8 +180,9 @@ int main(int argc, char** argv) tmp.push_back(ParseModePair(Opm::ParseContext::SUMMARY_UNKNOWN_WELL, Opm::InputError::WARN)); tmp.push_back(ParseModePair(Opm::ParseContext::SUMMARY_UNKNOWN_GROUP, Opm::InputError::WARN)); Opm::ParseContext parseContext(tmp); + Opm::ErrorGuard errorGuard; - std::shared_ptr deck = std::make_shared< Opm::Deck >( parser.parseFile(deckFilename , parseContext) ); + std::shared_ptr deck = std::make_shared< Opm::Deck >( parser.parseFile(deckFilename , parseContext, errorGuard) ); if ( outputCout ) { Opm::checkDeck(*deck, parser); Opm::MissingFeatures::checkKeywords(*deck); @@ -187,7 +190,7 @@ int main(int argc, char** argv) Opm::Runspec runspec( *deck ); const auto& phases = runspec.phases(); - std::shared_ptr eclipseState = std::make_shared< Opm::EclipseState > ( *deck, parseContext ); + std::shared_ptr eclipseState = std::make_shared< Opm::EclipseState > ( *deck, parseContext, errorGuard ); // run the actual simulator // diff --git a/opm/autodiff/FlowMainEbos.hpp b/opm/autodiff/FlowMainEbos.hpp index 6f3f2db59..0f2ce66a7 100755 --- a/opm/autodiff/FlowMainEbos.hpp +++ b/opm/autodiff/FlowMainEbos.hpp @@ -41,7 +41,6 @@ #include #include -#include #include #include #include diff --git a/tests/test_norne_pvt.cpp b/tests/test_norne_pvt.cpp index d4c87ce7e..7f1b58cb3 100644 --- a/tests/test_norne_pvt.cpp +++ b/tests/test_norne_pvt.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -273,11 +274,12 @@ void verify_norne_oil_pvt_region2(const Opm::Deck& deck, const Opm::EclipseState BOOST_AUTO_TEST_CASE( Test_Norne_PVT) { Opm::ParseContext parseContext({{ ParseContext::PARSE_RANDOM_SLASH , InputError::IGNORE }}); + Opm::ErrorGuard errorGuard; Opm::Parser parser; - auto deck = parser.parseFile("norne_pvt.data", parseContext); + auto deck = parser.parseFile("norne_pvt.data", parseContext, errorGuard); - Opm::EclipseState eclState(deck, parseContext); + Opm::EclipseState eclState(deck, parseContext, errorGuard); verify_norne_oil_pvt_region1( deck, eclState ); verify_norne_oil_pvt_region2( deck, eclState ); diff --git a/tests/test_relpermdiagnostics.cpp b/tests/test_relpermdiagnostics.cpp index 986bb9d50..ae1a37a2b 100644 --- a/tests/test_relpermdiagnostics.cpp +++ b/tests/test_relpermdiagnostics.cpp @@ -37,7 +37,6 @@ #include #include -#include #include BOOST_AUTO_TEST_SUITE () @@ -46,10 +45,9 @@ BOOST_AUTO_TEST_CASE(diagnosis) { using namespace Opm; Parser parser; - Opm::ParseContext parseContext; - Opm::Deck deck = parser.parseFile("../tests/relpermDiagnostics.DATA", parseContext); - EclipseState eclState(deck, parseContext); + Opm::Deck deck = parser.parseFile("../tests/relpermDiagnostics.DATA"); + EclipseState eclState(deck); GridManager gm(eclState.getInputGrid()); const UnstructuredGrid& grid = *gm.c_grid(); std::shared_ptr counterLog = std::make_shared(Log::DefaultMessageTypes); diff --git a/tests/test_stoppedwells.cpp b/tests/test_stoppedwells.cpp index 679a68648..2d09597e2 100644 --- a/tests/test_stoppedwells.cpp +++ b/tests/test_stoppedwells.cpp @@ -23,7 +23,6 @@ #include #include -#include #include #include @@ -38,16 +37,15 @@ using namespace Opm; BOOST_AUTO_TEST_CASE(TestStoppedWells) { const std::string filename = "wells_stopped.data"; - Opm::ParseContext parseContext; Opm::Parser parser; - Opm::Deck deck(parser.parseFile(filename , parseContext)); - Opm::EclipseState eclipseState(deck , parseContext); + Opm::Deck deck(parser.parseFile(filename)); + Opm::EclipseState eclipseState(deck); Opm::GridManager vanguard(eclipseState.getInputGrid()); const auto& grid = eclipseState.getInputGrid(); const TableManager table ( deck ); const Eclipse3DProperties eclipseProperties ( deck , table, grid); const Opm::Runspec runspec (deck); - const Schedule sched(deck, grid, eclipseProperties, runspec, parseContext ); + const Schedule sched(deck, grid, eclipseProperties, runspec); double target_surfacerate_inj; diff --git a/tests/test_timer.cpp b/tests/test_timer.cpp index 4b3468c56..e7f3e6a54 100644 --- a/tests/test_timer.cpp +++ b/tests/test_timer.cpp @@ -27,7 +27,6 @@ #include #include -#include #include #include @@ -39,9 +38,8 @@ BOOST_AUTO_TEST_CASE(CreateTimer) { const std::string filename1 = "TESTTIMER.DATA"; - Opm::ParseContext parseContext; Opm::Parser parser; - Opm::Deck parserDeck = parser.parseFile( filename1 , parseContext); + Opm::Deck parserDeck = parser.parseFile( filename1); Opm::TimeMap timeMap( parserDeck ); Opm::SimulatorTimer simtimer; diff --git a/tests/test_vfpproperties.cpp b/tests/test_vfpproperties.cpp index 41e2916f5..12eb34f67 100644 --- a/tests/test_vfpproperties.cpp +++ b/tests/test_vfpproperties.cpp @@ -35,7 +35,6 @@ #include #include -#include #include #include #include @@ -592,8 +591,7 @@ VFPPROD \n\ auto units = Opm::UnitSystem::newFIELD(); Opm::Parser parser; - Opm::ParseContext parse_mode; - auto deck = parser.parseString(table_str, parse_mode); + auto deck = parser.parseString(table_str); BOOST_REQUIRE(deck.hasKeyword("VFPPROD")); BOOST_CHECK_EQUAL(deck.count("VFPPROD"), 1); @@ -651,10 +649,9 @@ BOOST_AUTO_TEST_CASE(ParseInterpolateRealisticVFPPROD) auto units = Opm::UnitSystem::newMETRIC(); Opm::Parser parser; - Opm::ParseContext parse_mode; boost::filesystem::path file("VFPPROD2"); - auto deck = parser.parseFile(file.string(), parse_mode); + auto deck = parser.parseFile(file.string()); Opm::checkDeck(deck, parser); BOOST_REQUIRE(deck.hasKeyword("VFPPROD")); diff --git a/tests/test_wellcollection.cpp b/tests/test_wellcollection.cpp index 21cafc50c..77e48e778 100644 --- a/tests/test_wellcollection.cpp +++ b/tests/test_wellcollection.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -38,15 +37,14 @@ using namespace Opm; BOOST_AUTO_TEST_CASE(AddWellsAndGroupToCollection) { Parser parser; std::string scheduleFile("wells_group.data"); - ParseContext parseContext; - Deck deck = parser.parseFile(scheduleFile, parseContext); - EclipseState eclipseState(deck, parseContext); + Deck deck = parser.parseFile(scheduleFile); + EclipseState eclipseState(deck); PhaseUsage pu = phaseUsageFromDeck(eclipseState); const auto& grid = eclipseState.getInputGrid(); const TableManager table ( deck ); const Eclipse3DProperties eclipseProperties ( deck , table, grid); const Runspec runspec(deck); - const Schedule sched(deck, grid, eclipseProperties, runspec, parseContext ); + const Schedule sched(deck, grid, eclipseProperties, runspec); WellCollection collection; @@ -78,15 +76,14 @@ BOOST_AUTO_TEST_CASE(AddWellsAndGroupToCollection) { BOOST_AUTO_TEST_CASE(EfficiencyFactor) { Parser parser; std::string scheduleFile("wells_group.data"); - ParseContext parseContext; - Deck deck = parser.parseFile(scheduleFile, parseContext); - EclipseState eclipseState(deck, parseContext); + Deck deck = parser.parseFile(scheduleFile); + EclipseState eclipseState(deck); PhaseUsage pu = phaseUsageFromDeck(eclipseState); const auto& grid = eclipseState.getInputGrid(); const TableManager table ( deck ); const Eclipse3DProperties eclipseProperties ( deck , table, grid); const Runspec runspec(deck); - const Schedule sched(deck, grid, eclipseProperties, runspec, parseContext ); + const Schedule sched(deck, grid, eclipseProperties, runspec); size_t timestep = 2; WellCollection collection; diff --git a/tests/test_wellmodel.cpp b/tests/test_wellmodel.cpp index 98295e6e7..c48761b6b 100644 --- a/tests/test_wellmodel.cpp +++ b/tests/test_wellmodel.cpp @@ -29,7 +29,6 @@ #include #include -#include #include #include #include @@ -69,15 +68,14 @@ struct SetupTest { SetupTest () { - Opm::ParseContext parse_context; Opm::Parser parser; - auto deck = parser.parseFile("TESTWELLMODEL.DATA", parse_context); - ecl_state.reset(new Opm::EclipseState(deck , parse_context) ); + auto deck = parser.parseFile("TESTWELLMODEL.DATA"); + ecl_state.reset(new Opm::EclipseState(deck) ); { const Opm::TableManager table ( deck ); const Opm::Eclipse3DProperties eclipseProperties ( deck , table, ecl_state->getInputGrid()); const Opm::Runspec runspec (deck); - schedule.reset( new Opm::Schedule(deck, ecl_state->getInputGrid(), eclipseProperties, runspec, parse_context )); + schedule.reset( new Opm::Schedule(deck, ecl_state->getInputGrid(), eclipseProperties, runspec)); } // Create grid. diff --git a/tests/test_wellsgroup.cpp b/tests/test_wellsgroup.cpp index d69f7b848..0a59885c2 100644 --- a/tests/test_wellsgroup.cpp +++ b/tests/test_wellsgroup.cpp @@ -33,7 +33,6 @@ #include #include -#include #include #include @@ -45,15 +44,14 @@ using namespace Opm; BOOST_AUTO_TEST_CASE(ConstructGroupFromWell) { std::string scheduleFile("wells_group.data"); - ParseContext parseContext; Parser parser; - Deck deck = parser.parseFile(scheduleFile, parseContext); - EclipseState eclipseState(deck , parseContext); + Deck deck = parser.parseFile(scheduleFile); + EclipseState eclipseState(deck); const auto& grid = eclipseState.getInputGrid(); const TableManager table ( deck ); const Eclipse3DProperties eclipseProperties ( deck , table, grid); const Opm::Runspec runspec (deck); - const Schedule sched(deck, grid, eclipseProperties, runspec, parseContext ); + const Schedule sched(deck, grid, eclipseProperties, runspec); PhaseUsage pu = phaseUsageFromDeck(eclipseState); @@ -84,16 +82,15 @@ BOOST_AUTO_TEST_CASE(ConstructGroupFromWell) { BOOST_AUTO_TEST_CASE(ConstructGroupFromGroup) { Parser parser; - ParseContext parseContext; std::string scheduleFile("wells_group.data"); - Deck deck = parser.parseFile(scheduleFile, parseContext); - EclipseState eclipseState(deck , parseContext); + Deck deck = parser.parseFile(scheduleFile); + EclipseState eclipseState(deck); PhaseUsage pu = phaseUsageFromDeck(eclipseState); const auto& grid = eclipseState.getInputGrid(); const TableManager table ( deck ); const Eclipse3DProperties eclipseProperties ( deck , table, grid); const Opm::Runspec runspec (deck); - const Schedule sched(deck, grid, eclipseProperties, runspec, parseContext ); + const Schedule sched(deck, grid, eclipseProperties, runspec); const auto& nodes = sched.getGroupTree(2); @@ -122,16 +119,15 @@ BOOST_AUTO_TEST_CASE(ConstructGroupFromGroup) { BOOST_AUTO_TEST_CASE(EfficiencyFactor) { Parser parser; - ParseContext parseContext; std::string scheduleFile("wells_group.data"); - Deck deck = parser.parseFile(scheduleFile, parseContext); - EclipseState eclipseState(deck , parseContext); + Deck deck = parser.parseFile(scheduleFile); + EclipseState eclipseState(deck); PhaseUsage pu = phaseUsageFromDeck(eclipseState); const auto& grid = eclipseState.getInputGrid(); const TableManager table ( deck ); const Eclipse3DProperties eclipseProperties ( deck , table, grid); const Opm::Runspec runspec (deck); - const Schedule sched(deck, grid, eclipseProperties, runspec, parseContext ); + const Schedule sched(deck, grid, eclipseProperties, runspec); const auto& nodes = sched.getGroupTree(2); diff --git a/tests/test_wellsmanager.cpp b/tests/test_wellsmanager.cpp index 9da84eddd..60bd4b3d3 100644 --- a/tests/test_wellsmanager.cpp +++ b/tests/test_wellsmanager.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -176,16 +175,15 @@ BOOST_AUTO_TEST_CASE(New_Constructor_Works) { const std::string filename = "wells_manager_data.data"; Opm::Parser parser; - Opm::ParseContext parseContext; - Opm::Deck deck = parser.parseFile(filename, parseContext); + Opm::Deck deck = parser.parseFile(filename); - Opm::EclipseState eclipseState(deck, parseContext); + Opm::EclipseState eclipseState(deck); Opm::GridManager vanguard(eclipseState.getInputGrid()); const auto& grid = eclipseState.getInputGrid(); const Opm::TableManager table ( deck ); const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid); const Opm::Runspec runspec (deck); - const Opm::Schedule sched(deck, grid, eclipseProperties, runspec, parseContext ); + const Opm::Schedule sched(deck, grid, eclipseProperties, runspec); { @@ -218,16 +216,15 @@ BOOST_AUTO_TEST_CASE(New_Constructor_Works) { BOOST_AUTO_TEST_CASE(WellsEqual) { const std::string filename = "wells_manager_data.data"; - Opm::ParseContext parseContext; Opm::Parser parser; - Opm::Deck deck(parser.parseFile(filename, parseContext)); - Opm::EclipseState eclipseState(deck, parseContext); + Opm::Deck deck(parser.parseFile(filename)); + Opm::EclipseState eclipseState(deck); Opm::GridManager vanguard(eclipseState.getInputGrid()); const auto& grid = eclipseState.getInputGrid(); const Opm::TableManager table ( deck ); const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid); const Opm::Runspec runspec (deck); - const Opm::Schedule sched(deck, grid, eclipseProperties, runspec, parseContext ); + const Opm::Schedule sched(deck, grid, eclipseProperties, runspec); Opm::WellsManager wellsManager0(eclipseState, sched, 0, *vanguard.c_grid()); @@ -239,16 +236,15 @@ BOOST_AUTO_TEST_CASE(WellsEqual) { BOOST_AUTO_TEST_CASE(ControlsEqual) { const std::string filename = "wells_manager_data.data"; - Opm::ParseContext parseContext; Opm::Parser parser; - Opm::Deck deck(parser.parseFile(filename, parseContext)); - Opm::EclipseState eclipseState(deck, parseContext); + Opm::Deck deck(parser.parseFile(filename)); + Opm::EclipseState eclipseState(deck); Opm::GridManager vanguard(eclipseState.getInputGrid()); const auto& grid = eclipseState.getInputGrid(); const Opm::TableManager table ( deck ); const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid); const Opm::Runspec runspec (deck); - const Opm::Schedule sched(deck, grid, eclipseProperties, runspec, parseContext ); + const Opm::Schedule sched(deck, grid, eclipseProperties, runspec); @@ -268,16 +264,15 @@ BOOST_AUTO_TEST_CASE(ControlsEqual) { BOOST_AUTO_TEST_CASE(WellShutOK) { const std::string filename = "wells_manager_data.data"; - Opm::ParseContext parseContext; Opm::Parser parser; - Opm::Deck deck(parser.parseFile(filename, parseContext)); - Opm::EclipseState eclipseState(deck, parseContext); + Opm::Deck deck(parser.parseFile(filename)); + Opm::EclipseState eclipseState(deck); Opm::GridManager vanguard(eclipseState.getInputGrid()); const auto& grid = eclipseState.getInputGrid(); const Opm::TableManager table ( deck ); const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid); const Opm::Runspec runspec (deck); - const Opm::Schedule sched(deck, grid, eclipseProperties, runspec, parseContext ); + const Opm::Schedule sched(deck, grid, eclipseProperties, runspec); Opm::WellsManager wellsManager2(eclipseState, sched, 2, *vanguard.c_grid()); @@ -290,16 +285,15 @@ BOOST_AUTO_TEST_CASE(WellShutOK) { BOOST_AUTO_TEST_CASE(WellSTOPOK) { const std::string filename = "wells_manager_data_wellSTOP.data"; - Opm::ParseContext parseContext; Opm::Parser parser; - Opm::Deck deck(parser.parseFile(filename, parseContext)); - Opm::EclipseState eclipseState(deck, parseContext); + Opm::Deck deck(parser.parseFile(filename)); + Opm::EclipseState eclipseState(deck); Opm::GridManager vanguard(eclipseState.getInputGrid()); const auto& grid = eclipseState.getInputGrid(); const Opm::TableManager table ( deck ); const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid); const Opm::Runspec runspec (deck); - const Opm::Schedule sched(deck, grid, eclipseProperties, runspec, parseContext ); + const Opm::Schedule sched(deck, grid, eclipseProperties, runspec);