From 805e0a4bb77646a3c2e33ced0f725c26162b1fc7 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 5 Jul 2024 17:49:51 +0200 Subject: [PATCH] move EnableGridAdaptation to TypeTag-free parameter system --- opm/models/discretization/common/fvbasediscretization.hh | 9 ++------- opm/models/discretization/common/fvbaseparameters.hh | 9 ++++----- opm/models/discretization/common/fvbaseproblem.hh | 2 +- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/opm/models/discretization/common/fvbasediscretization.hh b/opm/models/discretization/common/fvbasediscretization.hh index fbcee5f93..d1b1d39fa 100644 --- a/opm/models/discretization/common/fvbasediscretization.hh +++ b/opm/models/discretization/common/fvbasediscretization.hh @@ -291,11 +291,6 @@ template struct ContinueOnConvergenceError { static constexpr bool value = false; }; -//! Disable grid adaptation by default -template -struct EnableGridAdaptation -{ static constexpr bool value = false; }; - //! by default, disable the intensive quantity cache. If the intensive quantities are //! relatively cheap to calculate, the cache basically does not yield any performance //! impact because of the intensive quantity cache will cause additional pressure on the @@ -484,7 +479,7 @@ public: , newtonMethod_(simulator) , localLinearizer_(ThreadManager::maxThreads()) , linearizer_(new Linearizer()) - , enableGridAdaptation_(Parameters::get() ) + , enableGridAdaptation_(Parameters::Get() ) , enableIntensiveQuantityCache_(Parameters::get()) , enableStorageCache_(Parameters::get()) , enableThermodynamicHints_(Parameters::get()) @@ -541,7 +536,7 @@ public: // register runtime parameters of the output modules VtkPrimaryVarsModule::registerParameters(); - Parameters::registerParam + Parameters::Register ("Enable adaptive grid refinement/coarsening"); Parameters::registerParam ("Global switch for turning on writing VTK files"); diff --git a/opm/models/discretization/common/fvbaseparameters.hh b/opm/models/discretization/common/fvbaseparameters.hh index 23ea6411c..ed3dd45ba 100644 --- a/opm/models/discretization/common/fvbaseparameters.hh +++ b/opm/models/discretization/common/fvbaseparameters.hh @@ -34,9 +34,6 @@ namespace Opm::Parameters { -//! \brief Number of threads per process. -struct ThreadsPerProcess { static constexpr int value = 1; }; - /*! * \brief Determines if the VTK output is written to disk asynchronously * @@ -54,8 +51,10 @@ struct EnableAsyncVtkOutput { static constexpr bool value = true; }; * Currently grid adaptation requires the presence of the dune-FEM module. If it is not * available and grid adaptation is enabled, an exception is thrown. */ -template -struct EnableGridAdaptation { using type = Properties::UndefinedProperty; }; +struct EnableGridAdaptation { static constexpr bool value = false; }; + +//! \brief Number of threads per process. +struct ThreadsPerProcess { static constexpr int value = 1; }; /*! * \brief The directory to which simulation output ought to be written to. diff --git a/opm/models/discretization/common/fvbaseproblem.hh b/opm/models/discretization/common/fvbaseproblem.hh index 09aed8cf9..ee406456b 100644 --- a/opm/models/discretization/common/fvbaseproblem.hh +++ b/opm/models/discretization/common/fvbaseproblem.hh @@ -147,7 +147,7 @@ public: // asynchonous VTK output currently does not work in conjunction with grid // adaptivity because the async-IO code assumes that the grid stays // constant. complain about that case. - bool enableGridAdaptation = Parameters::get(); + bool enableGridAdaptation = Parameters::Get(); if (asyncVtkOutput && enableGridAdaptation) throw std::runtime_error("Asynchronous VTK output currently cannot be used " "at the same time as grid adaptivity");