diff --git a/src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp b/src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp index fb8d11807..f61d37c6e 100644 --- a/src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp +++ b/src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp @@ -26,6 +26,8 @@ #include #include +#include + #include #include @@ -209,17 +211,8 @@ EclipseGrid::EclipseGrid(const Deck& deck, const int * actnum) m_multzMode(PinchMode::ModeEnum::TOP), m_pinchGapMode(PinchMode::ModeEnum::GAP) { - OpmLog::info("Creating grid"); if (deck.hasKeyword("GDFILE")){ - if (deck.hasKeyword("COORD")){ - throw std::invalid_argument("COORD can't be used together with GDFILE"); - } - - if (deck.hasKeyword("ZCORN")){ - throw std::invalid_argument("ZCORN can't be used together with GDFILE"); - } - if (deck.hasKeyword("ACTNUM")){ if (keywInputBeforeGdfile(deck, "ACTNUM")) { m_useActnumFromGdfile = true; @@ -333,6 +326,7 @@ EclipseGrid::EclipseGrid(const Deck& deck, const int * actnum) } void EclipseGrid::initGridFromEGridFile(Opm::EclIO::EclFile& egridfile, std::string fileName){ + OpmLog::info(fmt::format("Creating grid from: {} ", fileName)); if (!egridfile.hasKey("GRIDHEAD")) { throw std::invalid_argument("file: " + fileName + " is not a valid egrid file, GRIDHEAD not found"); @@ -517,7 +511,7 @@ EclipseGrid::EclipseGrid(const Deck& deck, const int * actnum) } void EclipseGrid::initDVDEPTHZGrid(const Deck& deck) { - + OpmLog::info("Creating grid from keywords DXV, DYV, DZV and DEPTHZ"); const std::vector& DXV = deck.getKeyword().getSIDoubleData(); const std::vector& DYV = deck.getKeyword().getSIDoubleData(); const std::vector& DZV = deck.getKeyword().getSIDoubleData(); @@ -539,6 +533,7 @@ EclipseGrid::EclipseGrid(const Deck& deck, const int * actnum) } void EclipseGrid::initDTOPSGrid(const Deck& deck) { + OpmLog::info("Creating grid from keywords DX, DY, DZ and TOPS"); std::vector DX = EclipseGrid::createDVector( this->getNXYZ(), 0 , "DX" , "DXV" , deck); std::vector DY = EclipseGrid::createDVector( this->getNXYZ(), 1 , "DY" , "DYV" , deck); @@ -951,6 +946,7 @@ EclipseGrid::EclipseGrid(const Deck& deck, const int * actnum) const std::vector& dthetav = deck.getKeyword().getSIDoubleData(); const std::vector& dzv = deck.getKeyword().getSIDoubleData(); const std::vector& tops = deck.getKeyword().getSIDoubleData(); + OpmLog::info("Creating cylindrical grid from keywords DRV, DTHETAV, DZV and TOPS"); if (drv.size() != this->getNX()) throw std::invalid_argument("DRV keyword should have exactly " + std::to_string( this->getNX() ) + " elements"); @@ -1087,7 +1083,9 @@ EclipseGrid::EclipseGrid(const Deck& deck, const int * actnum) throw std::invalid_argument("ACTNUM vector has wrong size"); actnum = actnumVector.data(); - } + OpmLog::info("Creating cornerpoint grid from keywords ZCORN, COORD and ACTNUM"); + } else + OpmLog::info("Creating cornerpoint grid from keywords ZCORN and COORD"); initCornerPointGrid( coord , zcorn, actnum, nullptr ); } diff --git a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/C/COORD b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/C/COORD index d70d0263e..5e0f3c4e0 100644 --- a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/C/COORD +++ b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/C/COORD @@ -3,6 +3,7 @@ "sections": [ "GRID" ], + "prohibits" : ["GDFILE"], "data": { "value_type": "DOUBLE", "dimension": "Length" diff --git a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/G/GDFILE b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/G/GDFILE index 39fefc858..adc6ead48 100644 --- a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/G/GDFILE +++ b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/G/GDFILE @@ -3,6 +3,7 @@ "sections": [ "GRID" ], + "prohibits" : ["COORD", "ZCORN"], "size": 1, "items": [ { diff --git a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/Z/ZCORN b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/Z/ZCORN index a8b0dabf2..e998a6e8e 100644 --- a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/Z/ZCORN +++ b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/Z/ZCORN @@ -3,6 +3,7 @@ "sections": [ "GRID" ], + "prohibits" : ["GDFILE"], "data": { "value_type": "DOUBLE", "dimension": "Length" diff --git a/tests/parser/EclipseGridTests.cpp b/tests/parser/EclipseGridTests.cpp index 223fdffcf..fe0f978b1 100644 --- a/tests/parser/EclipseGridTests.cpp +++ b/tests/parser/EclipseGridTests.cpp @@ -28,6 +28,7 @@ #include #include +#include #define BOOST_TEST_MODULE EclipseGridTests #include @@ -2451,44 +2452,9 @@ BOOST_AUTO_TEST_CASE(TEST_GDFILE_1) { "PORO\n" " 2*0.15 /\n"; - const char* deckData2 = - "RUNSPEC\n" - "DIMENS\n" - "1 1 2 /\n" - "GRID\n" - "GDFILE\n" - " 'BAD_CP_M.EGRID' /\n" - "COORD\n" - "10.0000 10.0000 2000.0000 9.8255 10.0000 2014.9977\n" - "109.9848 10.0000 2001.7452 109.8102 10.0000 2016.7430\n" - "10.0000 110.0000 2000.0000 9.8255 110.0000 2014.9977\n" - "109.9848 110.0000 2001.7452 109.8102 110.0000 2016.7430 /\n" - "PORO\n" - " 2*0.15 /\n"; - - const char* deckData3 = - "RUNSPEC\n" - "DIMENS\n" - "1 1 2 /\n" - "GRID\n" - "GDFILE\n" - " 'BAD_CP_M.EGRID' /\n" - "ZCORN\n" - "2000.0000 2001.7452 2000.0000 2001.7452 2004.9992 2006.7445\n" - "2004.9992 2006.7445 2004.9992 2006.7445 2004.9992 2006.7445\n" - "2014.9977 2016.7430 2014.9977 2016.7430 /\n" - "PORO\n" - " 2*0.15 /\n"; - - Opm::Parser parser; auto deck1 = parser.parseString( deckData1) ; - auto deck2 = parser.parseString( deckData2) ; - auto deck3 = parser.parseString( deckData3) ; - BOOST_CHECK_NO_THROW( Opm::EclipseGrid grid1(deck1) ); - BOOST_CHECK_THROW(Opm::EclipseGrid grid2(deck2), std::invalid_argument); - BOOST_CHECK_THROW(Opm::EclipseGrid grid3(deck3), std::invalid_argument); }