mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
ebos: handle positional parameters more robustly
previously, the exact behaviour was dependent on wheter the --ecl-deck-file-name parameter was defined or not. now the positional parameter is hopefully an exact alias for the value of --ecl-deck-file-name.
This commit is contained in:
parent
e7606d2afd
commit
0d864f8e71
@ -92,6 +92,7 @@
|
|||||||
|
|
||||||
#include <boost/date_time.hpp>
|
#include <boost/date_time.hpp>
|
||||||
|
|
||||||
|
#include <set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -394,7 +395,8 @@ public:
|
|||||||
/*!
|
/*!
|
||||||
* \copydoc FvBaseProblem::handlePositionalParameter
|
* \copydoc FvBaseProblem::handlePositionalParameter
|
||||||
*/
|
*/
|
||||||
static int handlePositionalParameter(std::string& errorMsg,
|
static int handlePositionalParameter(std::set<std::string>& seenParams,
|
||||||
|
std::string& errorMsg,
|
||||||
int argc OPM_UNUSED,
|
int argc OPM_UNUSED,
|
||||||
const char** argv,
|
const char** argv,
|
||||||
int paramIdx,
|
int paramIdx,
|
||||||
@ -403,12 +405,15 @@ public:
|
|||||||
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
|
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
|
||||||
Dune::ParameterTree& tree = ParamsMeta::tree();
|
Dune::ParameterTree& tree = ParamsMeta::tree();
|
||||||
|
|
||||||
if (tree.hasKey("EclDeckFileName")) {
|
if (seenParams.count("EclDeckFileName") > 0) {
|
||||||
errorMsg = "File name of ECL specified multiple times";
|
errorMsg =
|
||||||
|
"Parameter 'EclDeckFileName' specified multiple times"
|
||||||
|
" as a command line parameter";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
tree["EclDeckFileName"] = argv[paramIdx];
|
tree["EclDeckFileName"] = argv[paramIdx];
|
||||||
|
seenParams.insert("EclDeckFileName");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user