move MaxTimestepDivisions to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving 2024-07-05 17:49:51 +02:00
parent 508422faf5
commit 07dcd1a431
3 changed files with 8 additions and 15 deletions

View File

@ -329,12 +329,6 @@ struct LinearSolverTolerance<TypeTag, Properties::TTag::FvBaseDiscretization>
static constexpr type value = 1e-3;
};
//! The maximum allowed number of timestep divisions for the
//! Newton solver
template<class TypeTag>
struct MaxTimeStepDivisions<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr unsigned value = 10; };
} // namespace Opm::Parameters
namespace Opm {

View File

@ -71,6 +71,12 @@ struct EnableVtkOutput { static constexpr bool value = true; };
template<class Scalar>
struct MaxTimeStepSize { static constexpr Scalar value = std::numeric_limits<Scalar>::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<class TypeTag, class MyTypeTag>
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

View File

@ -173,7 +173,7 @@ public:
("The maximum size to which all time steps are limited to [s]");
Parameters::Register<Parameters::MinTimeStepSize<Scalar>>
("The minimum size to which all time steps are limited to [s]");
Parameters::registerParam<TypeTag, Parameters::MaxTimeStepDivisions>
Parameters::Register<Parameters::MaxTimeStepDivisions>
("The maximum number of divisions by two of the timestep size "
"before the simulation bails out");
Parameters::Register<Parameters::EnableAsyncVtkOutput>
@ -567,7 +567,7 @@ public:
* before giving up.
*/
unsigned maxTimeIntegrationFailures() const
{ return Parameters::get<TypeTag, Parameters::MaxTimeStepDivisions>(); }
{ return Parameters::Get<Parameters::MaxTimeStepDivisions>(); }
/*!
* \brief Returns if we should continue with a non-converged solution instead of