mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
parameter system: add support for positional parameters
further, this cleans up the code of the parameter system and the startup routines a bit and finally, it adds positional parameters support to ebos as well as brief descriptions to ebos and the lens problem.
This commit is contained in:
parent
91c209eb09
commit
739a0ef0d0
@ -295,6 +295,7 @@ template <class TypeTag>
|
|||||||
class EclProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
|
class EclProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
|
||||||
{
|
{
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
|
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
|
||||||
|
typedef typename GET_PROP_TYPE(TypeTag, Problem) Implementation;
|
||||||
|
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
|
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
|
||||||
@ -352,7 +353,6 @@ class EclProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
|
|||||||
|
|
||||||
typedef typename GridView::template Codim<0>::Iterator ElementIterator;
|
typedef typename GridView::template Codim<0>::Iterator ElementIterator;
|
||||||
|
|
||||||
|
|
||||||
struct RockParams {
|
struct RockParams {
|
||||||
Scalar referencePressure;
|
Scalar referencePressure;
|
||||||
Scalar compressibility;
|
Scalar compressibility;
|
||||||
@ -379,6 +379,48 @@ public:
|
|||||||
"The frequencies of which time steps are serialized to disk");
|
"The frequencies of which time steps are serialized to disk");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \copydoc FvBaseProblem::handlePositionalParameter
|
||||||
|
*/
|
||||||
|
static int handlePositionalParameter(std::string& errorMsg,
|
||||||
|
int argc OPM_UNUSED,
|
||||||
|
const char** argv,
|
||||||
|
int paramIdx,
|
||||||
|
int posParamIdx OPM_UNUSED)
|
||||||
|
{
|
||||||
|
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
|
||||||
|
Dune::ParameterTree& tree = ParamsMeta::tree();
|
||||||
|
|
||||||
|
if (tree.hasKey("EclDeckFileName")) {
|
||||||
|
errorMsg = "File name of ECL specified multiple times";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
tree["EclDeckFileName"] = argv[paramIdx];
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \copydoc FvBaseProblem::helpPreamble
|
||||||
|
*/
|
||||||
|
static std::string helpPreamble(int argc OPM_UNUSED,
|
||||||
|
const char **argv)
|
||||||
|
{
|
||||||
|
std::string desc = Implementation::briefDescription();
|
||||||
|
if (!desc.empty())
|
||||||
|
desc = desc + "\n";
|
||||||
|
|
||||||
|
return
|
||||||
|
"Usage: "+std::string(argv[0]) + " [OPTIONS] [ECL_DECK_FILENAME]\n"
|
||||||
|
+ desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \copydoc FvBaseProblem::briefDescription
|
||||||
|
*/
|
||||||
|
static std::string briefDescription()
|
||||||
|
{ return "ebos, the Ecl Black-Oil reservoir Simulator. A program to process ECL input files."; }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \copydoc Doxygen::defaultProblemConstructor
|
* \copydoc Doxygen::defaultProblemConstructor
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user