mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
adapt to ParameterSystem typetag removal
This commit is contained in:
@@ -98,8 +98,7 @@ namespace Opm {
|
|||||||
// Read the command line parameters. Throws an exception if something goes wrong.
|
// Read the command line parameters. Throws an exception if something goes wrong.
|
||||||
static int setupParameters_(int argc, char** argv, Parallel::Communication comm)
|
static int setupParameters_(int argc, char** argv, Parallel::Communication comm)
|
||||||
{
|
{
|
||||||
using ParamsMeta = GetProp<TypeTag, Properties::ParameterMetaData>;
|
if (!Parameters::MetaData::registrationOpen()) {
|
||||||
if (!ParamsMeta::registrationOpen()) {
|
|
||||||
// We have already successfully run setupParameters_().
|
// We have already successfully run setupParameters_().
|
||||||
// For the dynamically chosen runs (as from the main flow
|
// For the dynamically chosen runs (as from the main flow
|
||||||
// executable) we must run this function again with the
|
// executable) we must run this function again with the
|
||||||
|
|||||||
@@ -255,9 +255,7 @@ public:
|
|||||||
int paramIdx,
|
int paramIdx,
|
||||||
int)
|
int)
|
||||||
{
|
{
|
||||||
using ParamsMeta = GetProp<TypeTag, Properties::ParameterMetaData>;
|
return eclPositionalParameter(Parameters::MetaData::tree(),
|
||||||
Dune::ParameterTree& tree = ParamsMeta::tree();
|
|
||||||
return eclPositionalParameter(tree,
|
|
||||||
seenParams,
|
seenParams,
|
||||||
errorMsg,
|
errorMsg,
|
||||||
argv,
|
argv,
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ public:
|
|||||||
{
|
{
|
||||||
int exitCode = EXIT_SUCCESS;
|
int exitCode = EXIT_SUCCESS;
|
||||||
if (initialize_<Properties::TTag::FlowEarlyBird>(exitCode)) {
|
if (initialize_<Properties::TTag::FlowEarlyBird>(exitCode)) {
|
||||||
|
Parameters::reset();
|
||||||
if (isSimulationRank_) {
|
if (isSimulationRank_) {
|
||||||
return this->dispatchDynamic_();
|
return this->dispatchDynamic_();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,10 +85,14 @@ initSimulator(const char *filename)
|
|||||||
filename_arg.c_str()
|
filename_arg.c_str()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Parameters::reset();
|
||||||
|
registerAllParameters_<TypeTag>(false);
|
||||||
registerEclTimeSteppingParameters<TypeTag>();
|
registerEclTimeSteppingParameters<TypeTag>();
|
||||||
BlackoilModelParameters<TypeTag>::registerParameters();
|
BlackoilModelParameters<TypeTag>::registerParameters();
|
||||||
Parameters::registerParam<TypeTag, Parameters::EnableTerminalOutput>("Do *NOT* use!");
|
Parameters::registerParam<TypeTag, Parameters::EnableTerminalOutput>("Do *NOT* use!");
|
||||||
setupParameters_<TypeTag>(/*argc=*/sizeof(argv)/sizeof(argv[0]), argv, /*registerParams=*/true);
|
Parameters::endRegistration();
|
||||||
|
setupParameters_<TypeTag>(/*argc=*/sizeof(argv) / sizeof(argv[0]),
|
||||||
|
argv, /*registerParams=*/false);
|
||||||
|
|
||||||
FlowGenericVanguard::readDeck(filename);
|
FlowGenericVanguard::readDeck(filename);
|
||||||
return std::make_unique<Simulator>();
|
return std::make_unique<Simulator>();
|
||||||
@@ -97,18 +101,18 @@ initSimulator(const char *filename)
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
struct GliftFixture {
|
struct GliftFixture
|
||||||
GliftFixture() {
|
{
|
||||||
int argc = boost::unit_test::framework::master_test_suite().argc;
|
GliftFixture()
|
||||||
char** argv = boost::unit_test::framework::master_test_suite().argv;
|
{
|
||||||
#if HAVE_DUNE_FEM
|
int argc = boost::unit_test::framework::master_test_suite().argc;
|
||||||
Dune::Fem::MPIManager::initialize(argc, argv);
|
char** argv = boost::unit_test::framework::master_test_suite().argv;
|
||||||
#else
|
#if HAVE_DUNE_FEM
|
||||||
Dune::MPIHelper::instance(argc, argv);
|
Dune::Fem::MPIManager::initialize(argc, argv);
|
||||||
|
#else
|
||||||
|
Dune::MPIHelper::instance(argc, argv);
|
||||||
#endif
|
#endif
|
||||||
Opm::FlowGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
|
Opm::FlowGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
|
||||||
using TypeTag = Opm::Properties::TTag::FlowProblem;
|
|
||||||
Opm::registerAllParameters_<TypeTag>();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -114,9 +114,7 @@ BOOST_FIXTURE_TEST_CASE(WithOutputDir, Fixture)
|
|||||||
const char* no_param[] = {"test_outputdir", input_file_path.c_str(),
|
const char* no_param[] = {"test_outputdir", input_file_path.c_str(),
|
||||||
output_path.c_str(), nullptr};
|
output_path.c_str(), nullptr};
|
||||||
|
|
||||||
using ParamsMeta = Opm::GetProp<Opm::Properties::TTag::FlowEarlyBird,
|
Opm::Parameters::reset();
|
||||||
Opm::Properties::ParameterMetaData>;
|
|
||||||
ParamsMeta::clear();
|
|
||||||
|
|
||||||
Opm::Main main(3, const_cast<char**>(no_param), false);
|
Opm::Main main(3, const_cast<char**>(no_param), false);
|
||||||
|
|
||||||
@@ -154,9 +152,7 @@ BOOST_FIXTURE_TEST_CASE(NoOutputDir, Fixture)
|
|||||||
|
|
||||||
const char* no_param[] = {"test_outputdir", input_file_path.c_str(), nullptr};
|
const char* no_param[] = {"test_outputdir", input_file_path.c_str(), nullptr};
|
||||||
|
|
||||||
using ParamsMeta = Opm::GetProp<Opm::Properties::TTag::FlowEarlyBird,
|
Opm::Parameters::reset();
|
||||||
Opm::Properties::ParameterMetaData>;
|
|
||||||
ParamsMeta::clear();
|
|
||||||
|
|
||||||
Opm::Main main(2, const_cast<char**>(no_param), false);
|
Opm::Main main(2, const_cast<char**>(no_param), false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user