From 508422faf558bb17b30c2416ad658cfdd55956ca Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 5 Jul 2024 17:49:51 +0200 Subject: [PATCH] move MinTimestepSize to TypeTag-free parameter system --- .../common/fvbasediscretization.hh | 8 -------- .../discretization/common/fvbaseparameters.hh | 16 ++++++++-------- .../discretization/common/fvbaseproblem.hh | 4 ++-- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/opm/models/discretization/common/fvbasediscretization.hh b/opm/models/discretization/common/fvbasediscretization.hh index 0cb9f5d8f..bfab37424 100644 --- a/opm/models/discretization/common/fvbasediscretization.hh +++ b/opm/models/discretization/common/fvbasediscretization.hh @@ -335,14 +335,6 @@ template struct MaxTimeStepDivisions { static constexpr unsigned value = 10; }; -//! By default, accept any time step larger than zero -template -struct MinTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 0.0; -}; - } // namespace Opm::Parameters namespace Opm { diff --git a/opm/models/discretization/common/fvbaseparameters.hh b/opm/models/discretization/common/fvbaseparameters.hh index d9cc4dc31..c8baea3c5 100644 --- a/opm/models/discretization/common/fvbaseparameters.hh +++ b/opm/models/discretization/common/fvbaseparameters.hh @@ -71,6 +71,14 @@ struct EnableVtkOutput { static constexpr bool value = true; }; template struct MaxTimeStepSize { static constexpr Scalar value = std::numeric_limits::infinity(); }; +/*! + * \brief Specify the minimal size of a time integration [s]. + * + * The default is to not limit the step size. + */ +template +struct MinTimeStepSize { static constexpr Scalar value = 0.0; }; + /*! * \brief The directory to which simulation output ought to be written to. */ @@ -79,14 +87,6 @@ struct OutputDir { static constexpr auto value = ""; }; //! \brief Number of threads per process. struct ThreadsPerProcess { static constexpr int value = 1; }; -/*! - * \brief Specify the minimal size of a time integration [s]. - * - * The default is to not limit the step size. - */ -template -struct MinTimeStepSize { using type = Properties::UndefinedProperty; }; - /*! * \brief The maximum allowed number of timestep divisions for the * Newton solver. diff --git a/opm/models/discretization/common/fvbaseproblem.hh b/opm/models/discretization/common/fvbaseproblem.hh index 522e60af6..fed5e3dd7 100644 --- a/opm/models/discretization/common/fvbaseproblem.hh +++ b/opm/models/discretization/common/fvbaseproblem.hh @@ -171,7 +171,7 @@ public: Model::registerParameters(); Parameters::Register> ("The maximum size to which all time steps are limited to [s]"); - Parameters::registerParam + Parameters::Register> ("The minimum size to which all time steps are limited to [s]"); Parameters::registerParam ("The maximum number of divisions by two of the timestep size " @@ -560,7 +560,7 @@ public: * \brief Returns the minimum allowable size of a time step. */ Scalar minTimeStepSize() const - { return Parameters::get(); } + { return Parameters::Get>(); } /*! * \brief Returns the maximum number of subsequent failures for the time integration