Merge pull request #2586 from atgeirr/fix-tag-for-init

Ensure that the typetag used for initialization is correct.
This commit is contained in:
Arne Morten Kvarving 2020-05-04 11:12:44 +02:00 committed by GitHub
commit fa5c4a8573
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,7 +144,7 @@ namespace Opm
int runDynamic() int runDynamic()
{ {
int exitCode = EXIT_SUCCESS; int exitCode = EXIT_SUCCESS;
if (initialize_(exitCode)) { if (initialize_<TTAG(FlowEarlyBird)>(exitCode)) {
return dispatchDynamic_(); return dispatchDynamic_();
} else { } else {
return exitCode; return exitCode;
@ -155,7 +155,7 @@ namespace Opm
int runStatic() int runStatic()
{ {
int exitCode = EXIT_SUCCESS; int exitCode = EXIT_SUCCESS;
if (initialize_(exitCode)) { if (initialize_<TypeTag>(exitCode)) {
return dispatchStatic_<TypeTag>(); return dispatchStatic_<TypeTag>();
} else { } else {
return exitCode; return exitCode;
@ -256,6 +256,7 @@ namespace Opm
return Opm::flowEbosMain<TypeTag>(argc_, argv_, outputCout_, outputFiles_); return Opm::flowEbosMain<TypeTag>(argc_, argv_, outputCout_, outputFiles_);
} }
template <class TypeTagEarlyBird>
bool initialize_(int& exitCode) bool initialize_(int& exitCode)
{ {
Dune::Timer externalSetupTimer; Dune::Timer externalSetupTimer;
@ -285,8 +286,8 @@ namespace Opm
// use a type tag just for parsing the parameters before we instantiate the actual // use a type tag just for parsing the parameters before we instantiate the actual
// simulator object. (Which parses the parameters again, but since this is done in an // simulator object. (Which parses the parameters again, but since this is done in an
// identical manner it does not matter.) // identical manner it does not matter.)
typedef TTAG(FlowEarlyBird) PreTypeTag; typedef TypeTagEarlyBird PreTypeTag;
typedef GET_PROP_TYPE(PreTypeTag, Problem) PreProblem; typedef typename GET_PROP_TYPE(PreTypeTag, Problem) PreProblem;
PreProblem::setBriefDescription("Flow, an advanced reservoir simulator for ECL-decks provided by the Open Porous Media project."); PreProblem::setBriefDescription("Flow, an advanced reservoir simulator for ECL-decks provided by the Open Porous Media project.");
int status = Opm::FlowMainEbos<PreTypeTag>::setupParameters_(argc_, argv_); int status = Opm::FlowMainEbos<PreTypeTag>::setupParameters_(argc_, argv_);