Opm Parser: Include PATHS when importing WSEGLINK

* Opm Parser: Include PATHS when importing WSEGLINK
Add PATHS to supported keywords to be able to use include files with alias in file path.
* Move opm-parser-tests into OPM solution folder
This commit is contained in:
Magne Sjaastad 2022-10-21 07:47:27 +02:00 committed by GitHub
parent 493531626f
commit 0fa001fc70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 2 deletions

View File

@ -25,6 +25,7 @@
#include "opm/input/eclipse/Parser/ParseContext.hpp"
#include "opm/input/eclipse/Parser/Parser.hpp"
#include "opm/input/eclipse/Parser/ParserKeywords/I.hpp"
#include "opm/input/eclipse/Parser/ParserKeywords/P.hpp"
#include "opm/input/eclipse/Parser/ParserKeywords/V.hpp"
#include "opm/input/eclipse/Parser/ParserKeywords/W.hpp"
@ -130,12 +131,15 @@ std::map<std::string, std::vector<std::pair<int, int>>> RiaOpmParserTools::extra
{
if ( !std::filesystem::exists( filename ) ) return {};
Opm::Parser parser( false );
Opm::Parser parser( false );
const Opm::ParserKeywords::WSEGLINK kw1;
const Opm::ParserKeywords::INCLUDE kw2;
const Opm::ParserKeywords::PATHS kw3;
parser.addParserKeyword( kw1 );
parser.addParserKeyword( kw2 );
parser.addParserKeyword( kw3 );
std::stringstream ss;
Opm::ParseContext parseContext( Opm::InputError::Action::WARN );

View File

@ -385,7 +385,9 @@ list(APPEND OPM_LIBRARIES custom-opm-flowdiagnostics custom-opm-flowdiag-app
custom-opm-common
)
set_property(TARGET ${OPM_LIBRARIES} PROPERTY FOLDER "Thirdparty/OPM")
set_property(
TARGET ${OPM_LIBRARIES} opm-parser-tests PROPERTY FOLDER "Thirdparty/OPM"
)
# ##############################################################################
# NRLib

View File

@ -0,0 +1,15 @@
-- WSEGLINK
-- well-name segment-no-1 segment-no-2
-- If item #2 and #3 are undefined, all segment links for the well are removed.
-- If either item #2 or #3 is undefined, all segment links are removed for the well and segment given.
--
WSEGLINK
PROD_N 20 30 /
/
WSEGLINK
PROD_M 20 /
/

View File

@ -4,6 +4,11 @@
-- If either item #2 or #3 is undefined, all segment links are removed for the well and segment given.
--
PATHS
'E' 'mysubfolder' /
/
WSEGLINK
PROD 22 30 /
PROD2 25 37 /
@ -20,3 +25,6 @@ WSEGLINK
WSEGLINK
PROD_A /
/
INCLUDE
'$E/test_wseglink_subfolder.DATA ' /

View File

@ -13,6 +13,7 @@
#include "opm/input/eclipse/Parser/ParserKeywords/W.hpp"
#include "opm/input/eclipse/Parser/ParserKeywords/I.hpp"
#include "opm/input/eclipse/Parser/ParserKeywords/S.hpp"
#include "opm/input/eclipse/Parser/ParserKeywords/P.hpp"
#include "OpmTestDataDirectory.h"
@ -92,9 +93,11 @@ TEST(OpmParserTest, ReadAndParseWSEGLINK)
const Opm::ParserKeywords::WSEGLINK kw1;
const Opm::ParserKeywords::INCLUDE kw2;
const Opm::ParserKeywords::PATHS kw3;
parser.addParserKeyword(kw1);
parser.addParserKeyword(kw2);
parser.addParserKeyword(kw3);
std::string testFilePath = std::string(TEST_DATA_DIR) + "/test_wseglink.DATA";