diff --git a/opm/parser/eclipse/EclipseState/Schedule/Events.hpp b/opm/parser/eclipse/EclipseState/Schedule/Events.hpp index 12e8a5b82..3449455fc 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Events.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Events.hpp @@ -65,7 +65,13 @@ namespace Opm /* The well group topolyg has changed. */ - GROUP_CHANGE = 128 + GROUP_CHANGE = 128, + + + /* + Geology modifier. + */ + GEO_MODIFIER = 256 }; } diff --git a/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index 97a08926d..eb7cc0f43 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -86,21 +86,21 @@ namespace Opm { } void Schedule::iterateScheduleSection(const ParseMode& parseMode , std::shared_ptr section, IOConfigPtr ioConfig) { - const std::map unsupportedModifiers = {{"MULTFLT" , true}, - {"MULTPV" , true}, - {"MULTX" , true}, - {"MULTX-" , true}, - {"MULTY" , true}, - {"MULTY-" , true}, - {"MULTZ" , true}, - {"MULTZ-" , true}, - {"MULTREGT" , true}, - {"MULTR" , true}, - {"MULTR-" , true}, - {"MULTSIG" , true}, - {"MULTSIGV" , true}, - {"MULTTHT" , true}, - {"MULTTHT-" , true}}; + const std::map geoModifiers = {{"MULTFLT" , true}, + {"MULTPV" , true}, + {"MULTX" , true}, + {"MULTX-" , true}, + {"MULTY" , true}, + {"MULTY-" , true}, + {"MULTZ" , true}, + {"MULTZ-" , true}, + {"MULTREGT" , true}, + {"MULTR" , true}, + {"MULTR-" , true}, + {"MULTSIG" , true}, + {"MULTSIGV" , true}, + {"MULTTHT" , true}, + {"MULTTHT-" , true}}; size_t currentStep = 0; std::vector > rftProperties; @@ -185,7 +185,7 @@ namespace Opm { if (keyword->name() == "COMPORD") handleCOMPORD(parseMode , keyword, currentStep); - + if (keyword->name() == "DRSDT") handleDRSDT(keyword, currentStep); @@ -196,9 +196,14 @@ namespace Opm { handleVAPPARS(keyword, currentStep); - if (unsupportedModifiers.find( keyword->name() ) != unsupportedModifiers.end()) { - std::string msg = "OPM does not support grid property modifier " + keyword->name() + " in the Schedule section. Error at report: " + std::to_string( currentStep ); - parseMode.handleError( ParseMode::UNSUPPORTED_SCHEDULE_GEO_MODIFIER , msg ); + if (geoModifiers.find( keyword->name() ) != geoModifiers.end()) { + { + std::string msg = "OPM does not support grid property modifier " + keyword->name() + " in the Schedule section. Error at report: " + std::to_string( currentStep ); + parseMode.handleError( ParseMode::UNSUPPORTED_SCHEDULE_GEO_MODIFIER , msg ); + } + { + m_events->addEvent( ScheduleEvents::GEO_MODIFIER , currentStep); + } } } diff --git a/opm/parser/eclipse/EclipseState/Schedule/tests/CMakeLists.txt b/opm/parser/eclipse/EclipseState/Schedule/tests/CMakeLists.txt index d4527b1f8..ca272cf83 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/tests/CMakeLists.txt +++ b/opm/parser/eclipse/EclipseState/Schedule/tests/CMakeLists.txt @@ -4,7 +4,8 @@ foreach(tapp TimeMapTest ScheduleTests WellTests CompletionTests CompletionSetTests DynamicStateTests GroupTreeNodeTests GroupTreeTests TuningTests EventTests - WellSolventTests DynamicVectorTests) + WellSolventTests DynamicVectorTests + GeomodifierTests) opm_add_test(run${tapp} SOURCES ${tapp}.cpp LIBRARIES opmparser ${Boost_LIBRARIES}) endforeach() diff --git a/opm/parser/eclipse/EclipseState/Schedule/tests/GeomodifierTests.cpp b/opm/parser/eclipse/EclipseState/Schedule/tests/GeomodifierTests.cpp new file mode 100644 index 000000000..a6e88ac51 --- /dev/null +++ b/opm/parser/eclipse/EclipseState/Schedule/tests/GeomodifierTests.cpp @@ -0,0 +1,71 @@ +/* + Copyright 2013 Statoil ASA. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . + */ + +#include +#include +#include +#define BOOST_TEST_MODULE GeoModifiersTests +#include + + +#include +#include +#include +#include + +#include +#include +#include + +using namespace Opm; + + +BOOST_AUTO_TEST_CASE( CheckUnsoppertedInSCHEDULE ) { + const char * deckString = + "START\n" + " 10 'JAN' 2000 /\n" + "RUNSPEC\n" + "DIMENS\n" + " 10 10 10 / \n" + "SCHEDULE\n" + "TSTEP -- 1,2\n" + " 10 10/\n" + "MULTFLT\n" + " 'F1' 100 /\n" + "/\n" + "TSTEP -- 3,4\n" + " 10 10/\n" + "\n"; + + ParseMode parseMode; + Parser parser(true); + + auto deck = parser.parseString( deckString , parseMode ); + std::shared_ptr grid = std::make_shared( deck ); + std::shared_ptr ioconfig = std::make_shared( "path" ); + + parseMode.update( ParseMode::UNSUPPORTED_SCHEDULE_GEO_MODIFIER , InputError::IGNORE ); + { + Schedule schedule( parseMode , grid , deck , ioconfig ); + auto events = schedule.getEvents( ); + BOOST_CHECK_EQUAL( false , events.hasEvent( ScheduleEvents::GEO_MODIFIER , 1 )); + BOOST_CHECK_EQUAL( true , events.hasEvent( ScheduleEvents::GEO_MODIFIER , 2 )); + BOOST_CHECK_EQUAL( false , events.hasEvent( ScheduleEvents::GEO_MODIFIER , 3 )); + } +}