Remove C++ Code and Place Conditions in JSON Files

Remove the C++ code checks and instead place the logic in the keyword JSON files. This is a cleaner approach.
Note we force that only one of the keywords is allowed in the deck to avoid confusion on what cut-off is actually being applied.
This commit is contained in:
OPMUSER 2022-07-11 15:02:10 +08:00
parent a5cfafe4de
commit 4fe559ba3c
4 changed files with 3 additions and 8 deletions

View File

@ -344,14 +344,6 @@ EclipseGrid::EclipseGrid(const Deck& deck, const int * actnum)
m_pinchGapMode = PinchMode::PinchModeFromString(pinchGapString);
}
if (deck.hasKeyword<ParserKeywords::MINPV>() && deck.hasKeyword<ParserKeywords::MINPVFIL>()) {
throw std::invalid_argument("Can not have both MINPV and MINPVFIL in the deck.");
} else if(deck.hasKeyword<ParserKeywords::MINPV>() && deck.hasKeyword<ParserKeywords::MINPORV>()) {
throw std::invalid_argument("Can not have both MINPV and MINPORV in the deck.");
} else if(deck.hasKeyword<ParserKeywords::MINPORV>() && deck.hasKeyword<ParserKeywords::MINPVFIL>()) {
throw std::invalid_argument("Can not have both MINPORV and MINPVFIL in the deck.");
}
m_minpvVector.resize(getCartesianSize(), 0.0);
if (deck.hasKeyword<ParserKeywords::MINPV>()) {
const auto& record = deck.get<ParserKeywords::MINPV>( ).back().getRecord(0);

View File

@ -3,6 +3,7 @@
"sections": [
"GRID"
],
"prohibits" : ["MINPV", "MINPVFIL"],
"size": 1,
"items": [
{

View File

@ -3,6 +3,7 @@
"sections": [
"GRID"
],
"prohibits" : ["MINPORV", "MINPVFIL"],
"size": 1,
"items": [
{

View File

@ -3,6 +3,7 @@
"sections": [
"GRID"
],
"prohibits" : ["MINPV", "MINPORV"],
"size": 1,
"items": [
{