Merge pull request #1916 from andlaus/abort_on_unknown_parameters

mebos, flow: adapt to the eWoms changes in handling unknown parameters
This commit is contained in:
Tor Harald Sandve 2019-06-27 14:59:35 +02:00 committed by GitHub
commit e2420a4361
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View File

@ -38,7 +38,11 @@ bool ebosBlackOilDeckFileNameIsSet(int argc, char** argv)
// use the ewoms parameter machinery and the blackoil vanguard to handle the grunt of
// the work
EWOMS_RESET_PARAMS_(ProblemTypeTag);
Ewoms::setupParameters_<ProblemTypeTag>(argc, const_cast<const char**>(argv), /*doRegistration=*/true);
Ewoms::setupParameters_<ProblemTypeTag>(argc,
const_cast<const char**>(argv),
/*doRegistration=*/true,
/*allowUnused=*/true,
/*handleHelp=*/false);
bool result = EWOMS_PARAM_IS_SET(ProblemTypeTag, std::string, EclDeckFileName);
EWOMS_RESET_PARAMS_(ProblemTypeTag);
@ -53,7 +57,11 @@ std::string ebosBlackOilGetDeckFileName(int argc, char** argv)
// use the ewoms parameter machinery and the blackoil vanguard to handle the grunt of
// the work
EWOMS_RESET_PARAMS_(ProblemTypeTag);
Ewoms::setupParameters_<ProblemTypeTag>(argc, const_cast<const char**>(argv), /*doRegistration=*/true);
Ewoms::setupParameters_<ProblemTypeTag>(argc,
const_cast<const char**>(argv),
/*doRegistration=*/true,
/*allowUnused=*/true,
/*handleHelp=*/false);
std::string rawDeckFileName = EWOMS_GET_PARAM(ProblemTypeTag, std::string, EclDeckFileName);
std::string result = Vanguard::canonicalDeckPath(rawDeckFileName).string();
EWOMS_RESET_PARAMS_(ProblemTypeTag);
@ -69,7 +77,11 @@ std::unique_ptr<Opm::ParseContext> ebosBlackOilCreateParseContext(int argc, char
// use the ewoms parameter machinery and the blackoil vanguard to handle the grunt of
// the work
EWOMS_RESET_PARAMS_(ProblemTypeTag);
Ewoms::setupParameters_<ProblemTypeTag>(argc, const_cast<const char**>(argv), /*doRegistration=*/true);
Ewoms::setupParameters_<ProblemTypeTag>(argc,
const_cast<const char**>(argv),
/*doRegistration=*/true,
/*allowUnused=*/true,
/*handleHelp=*/false);
std::unique_ptr<Opm::ParseContext> result = Vanguard::createParseContext();
EWOMS_RESET_PARAMS_(ProblemTypeTag);

View File

@ -162,7 +162,7 @@ namespace Opm
EWOMS_END_PARAM_REGISTRATION(TypeTag);
// read in the command line parameters
int status = Ewoms::setupParameters_<TypeTag>(argc, const_cast<const char**>(argv), /*doRegistration=*/false);
int status = Ewoms::setupParameters_<TypeTag>(argc, const_cast<const char**>(argv), /*doRegistration=*/false, /*allowUnused=*/true, /*handleHelp=*/true);
if (status == 0) {
// deal with --print-properties and --print-parameters