From 07dcd1a431b91c1011310debd7719367c5b5654f Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 5 Jul 2024 17:49:51 +0200 Subject: [PATCH] move MaxTimestepDivisions to TypeTag-free parameter system --- .../discretization/common/fvbasediscretization.hh | 6 ------ .../discretization/common/fvbaseparameters.hh | 13 ++++++------- opm/models/discretization/common/fvbaseproblem.hh | 4 ++-- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/opm/models/discretization/common/fvbasediscretization.hh b/opm/models/discretization/common/fvbasediscretization.hh index bfab37424..e7654c32d 100644 --- a/opm/models/discretization/common/fvbasediscretization.hh +++ b/opm/models/discretization/common/fvbasediscretization.hh @@ -329,12 +329,6 @@ struct LinearSolverTolerance static constexpr type value = 1e-3; }; -//! The maximum allowed number of timestep divisions for the -//! Newton solver -template -struct MaxTimeStepDivisions -{ static constexpr unsigned value = 10; }; - } // namespace Opm::Parameters namespace Opm { diff --git a/opm/models/discretization/common/fvbaseparameters.hh b/opm/models/discretization/common/fvbaseparameters.hh index c8baea3c5..abb019fc9 100644 --- a/opm/models/discretization/common/fvbaseparameters.hh +++ b/opm/models/discretization/common/fvbaseparameters.hh @@ -71,6 +71,12 @@ struct EnableVtkOutput { static constexpr bool value = true; }; template struct MaxTimeStepSize { static constexpr Scalar value = std::numeric_limits::infinity(); }; +/*! + * \brief The maximum allowed number of timestep divisions for the + * Newton solver. + */ +struct MaxTimeStepDivisions { static constexpr unsigned value = 10; }; + /*! * \brief Specify the minimal size of a time integration [s]. * @@ -87,13 +93,6 @@ struct OutputDir { static constexpr auto value = ""; }; //! \brief Number of threads per process. struct ThreadsPerProcess { static constexpr int value = 1; }; -/*! - * \brief The maximum allowed number of timestep divisions for the - * Newton solver. - */ -template -struct MaxTimeStepDivisions { using type = Properties::UndefinedProperty; }; - /*! * \brief Continue with a non-converged solution instead of giving up * if we encounter a time step size smaller than the minimum time diff --git a/opm/models/discretization/common/fvbaseproblem.hh b/opm/models/discretization/common/fvbaseproblem.hh index fed5e3dd7..7081055fe 100644 --- a/opm/models/discretization/common/fvbaseproblem.hh +++ b/opm/models/discretization/common/fvbaseproblem.hh @@ -173,7 +173,7 @@ public: ("The maximum size to which all time steps are limited to [s]"); Parameters::Register> ("The minimum size to which all time steps are limited to [s]"); - Parameters::registerParam + Parameters::Register ("The maximum number of divisions by two of the timestep size " "before the simulation bails out"); Parameters::Register @@ -567,7 +567,7 @@ public: * before giving up. */ unsigned maxTimeIntegrationFailures() const - { return Parameters::get(); } + { return Parameters::Get(); } /*! * \brief Returns if we should continue with a non-converged solution instead of