adapt to ParameterSystem typetag removal

This commit is contained in:
Arne Morten Kvarving 2024-07-05 14:42:27 +02:00
parent ad595fed5e
commit e1bcd00a36
5 changed files with 20 additions and 22 deletions

View File

@ -98,8 +98,7 @@ namespace Opm {
// Read the command line parameters. Throws an exception if something goes wrong.
static int setupParameters_(int argc, char** argv, Parallel::Communication comm)
{
using ParamsMeta = GetProp<TypeTag, Properties::ParameterMetaData>;
if (!ParamsMeta::registrationOpen()) {
if (!Parameters::MetaData::registrationOpen()) {
// We have already successfully run setupParameters_().
// For the dynamically chosen runs (as from the main flow
// executable) we must run this function again with the

View File

@ -255,9 +255,7 @@ public:
int paramIdx,
int)
{
using ParamsMeta = GetProp<TypeTag, Properties::ParameterMetaData>;
Dune::ParameterTree& tree = ParamsMeta::tree();
return eclPositionalParameter(tree,
return eclPositionalParameter(Parameters::MetaData::tree(),
seenParams,
errorMsg,
argv,

View File

@ -152,6 +152,7 @@ public:
{
int exitCode = EXIT_SUCCESS;
if (initialize_<Properties::TTag::FlowEarlyBird>(exitCode)) {
Parameters::reset();
if (isSimulationRank_) {
return this->dispatchDynamic_();
}

View File

@ -85,10 +85,14 @@ initSimulator(const char *filename)
filename_arg.c_str()
};
Parameters::reset();
registerAllParameters_<TypeTag>(false);
registerEclTimeSteppingParameters<TypeTag>();
BlackoilModelParameters<TypeTag>::registerParameters();
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);
return std::make_unique<Simulator>();
@ -97,18 +101,18 @@ initSimulator(const char *filename)
namespace {
struct GliftFixture {
GliftFixture() {
int argc = boost::unit_test::framework::master_test_suite().argc;
char** argv = boost::unit_test::framework::master_test_suite().argv;
#if HAVE_DUNE_FEM
Dune::Fem::MPIManager::initialize(argc, argv);
#else
Dune::MPIHelper::instance(argc, argv);
struct GliftFixture
{
GliftFixture()
{
int argc = boost::unit_test::framework::master_test_suite().argc;
char** argv = boost::unit_test::framework::master_test_suite().argv;
#if HAVE_DUNE_FEM
Dune::Fem::MPIManager::initialize(argc, argv);
#else
Dune::MPIHelper::instance(argc, argv);
#endif
Opm::FlowGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
using TypeTag = Opm::Properties::TTag::FlowProblem;
Opm::registerAllParameters_<TypeTag>();
}
};

View File

@ -114,9 +114,7 @@ BOOST_FIXTURE_TEST_CASE(WithOutputDir, Fixture)
const char* no_param[] = {"test_outputdir", input_file_path.c_str(),
output_path.c_str(), nullptr};
using ParamsMeta = Opm::GetProp<Opm::Properties::TTag::FlowEarlyBird,
Opm::Properties::ParameterMetaData>;
ParamsMeta::clear();
Opm::Parameters::reset();
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};
using ParamsMeta = Opm::GetProp<Opm::Properties::TTag::FlowEarlyBird,
Opm::Properties::ParameterMetaData>;
ParamsMeta::clear();
Opm::Parameters::reset();
Opm::Main main(2, const_cast<char**>(no_param), false);