mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-22 09:16:27 -06:00
move MinTimestepSize to TypeTag-free parameter system
This commit is contained in:
parent
08002caa53
commit
508422faf5
@ -335,14 +335,6 @@ template<class TypeTag>
|
|||||||
struct MaxTimeStepDivisions<TypeTag, Properties::TTag::FvBaseDiscretization>
|
struct MaxTimeStepDivisions<TypeTag, Properties::TTag::FvBaseDiscretization>
|
||||||
{ static constexpr unsigned value = 10; };
|
{ static constexpr unsigned value = 10; };
|
||||||
|
|
||||||
//! By default, accept any time step larger than zero
|
|
||||||
template<class TypeTag>
|
|
||||||
struct MinTimeStepSize<TypeTag, Properties::TTag::FvBaseDiscretization>
|
|
||||||
{
|
|
||||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
|
||||||
static constexpr type value = 0.0;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Opm::Parameters
|
} // namespace Opm::Parameters
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
@ -71,6 +71,14 @@ struct EnableVtkOutput { static constexpr bool value = true; };
|
|||||||
template<class Scalar>
|
template<class Scalar>
|
||||||
struct MaxTimeStepSize { static constexpr Scalar value = std::numeric_limits<Scalar>::infinity(); };
|
struct MaxTimeStepSize { static constexpr Scalar value = std::numeric_limits<Scalar>::infinity(); };
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Specify the minimal size of a time integration [s].
|
||||||
|
*
|
||||||
|
* The default is to not limit the step size.
|
||||||
|
*/
|
||||||
|
template<class Scalar>
|
||||||
|
struct MinTimeStepSize { static constexpr Scalar value = 0.0; };
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief The directory to which simulation output ought to be written to.
|
* \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.
|
//! \brief Number of threads per process.
|
||||||
struct ThreadsPerProcess { static constexpr int value = 1; };
|
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<class TypeTag, class MyTypeTag>
|
|
||||||
struct MinTimeStepSize { using type = Properties::UndefinedProperty; };
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief The maximum allowed number of timestep divisions for the
|
* \brief The maximum allowed number of timestep divisions for the
|
||||||
* Newton solver.
|
* Newton solver.
|
||||||
|
@ -171,7 +171,7 @@ public:
|
|||||||
Model::registerParameters();
|
Model::registerParameters();
|
||||||
Parameters::Register<Parameters::MaxTimeStepSize<Scalar>>
|
Parameters::Register<Parameters::MaxTimeStepSize<Scalar>>
|
||||||
("The maximum size to which all time steps are limited to [s]");
|
("The maximum size to which all time steps are limited to [s]");
|
||||||
Parameters::registerParam<TypeTag, Parameters::MinTimeStepSize>
|
Parameters::Register<Parameters::MinTimeStepSize<Scalar>>
|
||||||
("The minimum size to which all time steps are limited to [s]");
|
("The minimum size to which all time steps are limited to [s]");
|
||||||
Parameters::registerParam<TypeTag, Parameters::MaxTimeStepDivisions>
|
Parameters::registerParam<TypeTag, Parameters::MaxTimeStepDivisions>
|
||||||
("The maximum number of divisions by two of the timestep size "
|
("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.
|
* \brief Returns the minimum allowable size of a time step.
|
||||||
*/
|
*/
|
||||||
Scalar minTimeStepSize() const
|
Scalar minTimeStepSize() const
|
||||||
{ return Parameters::get<TypeTag, Parameters::MinTimeStepSize>(); }
|
{ return Parameters::Get<Parameters::MinTimeStepSize<Scalar>>(); }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the maximum number of subsequent failures for the time integration
|
* \brief Returns the maximum number of subsequent failures for the time integration
|
||||||
|
Loading…
Reference in New Issue
Block a user