Merge pull request #2107 from joakim-hove/rrpv

Rrpv
This commit is contained in:
Joakim Hove 2020-11-16 10:37:12 +01:00 committed by GitHub
commit e4ab6c43ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 4 deletions

View File

@ -1600,7 +1600,8 @@ static const std::unordered_map< std::string, Opm::UnitSystem::measure> region_u
{"RGIP" , Opm::UnitSystem::measure::gas_surface_volume },
{"RGIPL" , Opm::UnitSystem::measure::gas_surface_volume },
{"RGIPG" , Opm::UnitSystem::measure::gas_surface_volume },
{"RWIP" , Opm::UnitSystem::measure::liquid_surface_volume }
{"RWIP" , Opm::UnitSystem::measure::liquid_surface_volume },
{"RRPV" , Opm::UnitSystem::measure::geometric_volume }
};
static const std::unordered_map< std::string, Opm::UnitSystem::measure> block_units = {

View File

@ -707,9 +707,18 @@ void set_dimensions( ParserItem& item,
else if( m_deckNames.count( std::string(name) ) )
return true;
else if (hasMatchRegex())
return std::regex_match( name.begin(), name.end(), m_matchRegex);
else if (hasMatchRegex()) {
bool match = std::regex_match( name.begin(), name.end(), m_matchRegex);
if (match)
return true;
}
// Last desperate attempt - go through the deckNames list and
// interpret the elements as a regular expression.
for (const auto& deck_name : this->m_deckNames) {
if (std::regex_match(name.begin(), name.end(), std::regex(deck_name)))
return true;
}
return false;
}

View File

@ -5,6 +5,8 @@
],
"comment": "Tracer keywords where the 2nd letter is a 'T' should be compounded with the tracer name",
"deck_names": [
"RRPV_[0-9A-Z][0-9A-Z][0-9A-Z]",
"ROEW_[0-9A-Z][0-9A-Z][0-9A-Z]",
"ROSAT",
"ROIP",
"ROIPL",

View File

@ -1178,11 +1178,19 @@ RPR__REG
ROPT_REG
/
RRPV_REG
/
ROEW_REG
/
)";
const auto& summary_config = createSummary(deck_string);
BOOST_CHECK_EQUAL(summary_config.size(), 6U);
BOOST_CHECK_EQUAL(summary_config.size(), 12U);
BOOST_CHECK(summary_config.hasKeyword("RPR__REG"));
BOOST_CHECK(summary_config.hasKeyword("ROPT_REG"));
BOOST_CHECK(summary_config.hasKeyword("RRPV_REG"));
BOOST_CHECK(summary_config.hasKeyword("ROEW_REG"));
BOOST_CHECK(!summary_config.hasKeyword("RPR"));
BOOST_CHECK(!summary_config.match("BPR*"));
BOOST_CHECK(summary_config.match("RPR*"));