mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-25 10:40:21 -06:00
move MaxTimestepDivisions to TypeTag-free parameter system
This commit is contained in:
parent
508422faf5
commit
07dcd1a431
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user