mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add commandline parameter --ignore-keywords=
This commit is contained in:
parent
d5328fe69c
commit
cee74bb2b5
@ -65,7 +65,9 @@ NEW_PROP_TAG(EclDeckFileName);
|
||||
NEW_PROP_TAG(OutputDir);
|
||||
NEW_PROP_TAG(EnableOpmRstFile);
|
||||
NEW_PROP_TAG(EclOutputInterval);
|
||||
NEW_PROP_TAG(IgnoreKeywords);
|
||||
|
||||
SET_STRING_PROP(EclBaseVanguard, IgnoreKeywords, "");
|
||||
SET_STRING_PROP(EclBaseVanguard, EclDeckFileName, "");
|
||||
SET_INT_PROP(EclBaseVanguard, EclOutputInterval, -1); // use the deck-provided value
|
||||
SET_BOOL_PROP(EclBaseVanguard, EnableOpmRstFile, true);
|
||||
@ -106,6 +108,8 @@ public:
|
||||
"The number of report steps that ought to be skipped between two writes of ECL results");
|
||||
EWOMS_REGISTER_PARAM(TypeTag, bool, EnableOpmRstFile,
|
||||
"Include OPM-specific keywords in the ECL restart file to enable restart of OPM simulators from these files");
|
||||
EWOMS_REGISTER_PARAM(TypeTag, std::string, IgnoreKeywords,
|
||||
"List of Eclipse keywords which should be ignored. As a ':' separated string.");
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -215,7 +219,21 @@ public:
|
||||
tmp.emplace_back(Opm::ParseContext::SUMMARY_UNKNOWN_WELL, Opm::InputError::WARN);
|
||||
tmp.emplace_back(Opm::ParseContext::SUMMARY_UNKNOWN_GROUP, Opm::InputError::WARN);
|
||||
Opm::ParseContext parseContext(tmp);
|
||||
|
||||
{
|
||||
const std::string ignoredKeywords = EWOMS_GET_PARAM(TypeTag, std::string, IgnoreKeywords);
|
||||
if (ignoredKeywords.size() > 0 ) {
|
||||
size_t pos, offset = 0;
|
||||
while (true) {
|
||||
pos = ignoredKeywords.find(':', offset);
|
||||
if (pos == std::string::npos) {
|
||||
parseContext.ignoreKeyword( ignoredKeywords.substr(offset));
|
||||
break;
|
||||
}
|
||||
parseContext.ignoreKeyword( ignoredKeywords.substr(offset, pos - offset));
|
||||
offset = pos + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
internalDeck_.reset(new Opm::Deck(parser.parseFile(fileName , parseContext)));
|
||||
internalEclState_.reset(new Opm::EclipseState(*internalDeck_, parseContext));
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user