mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-22 09:16:27 -06:00
move RestartTime to TypeTag-free parameter system
This commit is contained in:
parent
0e3d9604ab
commit
d95c049936
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user