move RestartTime to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving 2024-07-05 17:49:51 +02:00
parent 0e3d9604ab
commit d95c049936
3 changed files with 4 additions and 12 deletions

View File

@ -77,8 +77,8 @@ struct PredeterminedTimeStepsFile { static constexpr auto value = ""; };
struct PrintParameters { static constexpr int value = 2; }; struct PrintParameters { static constexpr int value = 2; };
//! The default value for the simulation's restart time //! The default value for the simulation's restart time
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct RestartTime { using type = Properties::UndefinedProperty; }; struct RestartTime { static constexpr Scalar value = -1e35; };
} // namespace Opm:Parameters } // namespace Opm:Parameters

View File

@ -195,14 +195,6 @@ struct InitialTimeStepSize<TypeTag, Properties::TTag::NumericModel>
static constexpr type value = -1e35; static constexpr type value = -1e35;
}; };
//! The default value for the simulation's restart time
template<class TypeTag>
struct RestartTime<TypeTag, Properties::TTag::NumericModel>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = -1e35;
};
} // namespace Opm::Parameters } // namespace Opm::Parameters
#endif #endif

View File

@ -258,7 +258,7 @@ public:
("The simulation time at which the simulation is finished [s]"); ("The simulation time at which the simulation is finished [s]");
Parameters::registerParam<TypeTag, Parameters::InitialTimeStepSize> Parameters::registerParam<TypeTag, Parameters::InitialTimeStepSize>
("The size of the initial time step [s]"); ("The size of the initial time step [s]");
Parameters::registerParam<TypeTag, Parameters::RestartTime> Parameters::Register<Parameters::RestartTime<Scalar>>
("The simulation time at which a restart should be attempted [s]"); ("The simulation time at which a restart should be attempted [s]");
Parameters::Register<Parameters::PredeterminedTimeStepsFile> Parameters::Register<Parameters::PredeterminedTimeStepsFile>
("A file with a list of predetermined time step sizes (one " ("A file with a list of predetermined time step sizes (one "
@ -649,7 +649,7 @@ public:
TimerGuard writeTimerGuard(writeTimer_); TimerGuard writeTimerGuard(writeTimer_);
setupTimer_.start(); setupTimer_.start();
Scalar restartTime = Parameters::get<TypeTag, Parameters::RestartTime>(); Scalar restartTime = Parameters::Get<Parameters::RestartTime<Scalar>>();
if (restartTime > -1e30) { if (restartTime > -1e30) {
// try to restart a previous simulation // try to restart a previous simulation
time_ = restartTime; time_ = restartTime;