From d95c049936511f669d8b727af71ae0c76708921b Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 5 Jul 2024 17:49:51 +0200 Subject: [PATCH] move RestartTime to TypeTag-free parameter system --- opm/models/utils/basicparameters.hh | 4 ++-- opm/models/utils/basicproperties.hh | 8 -------- opm/models/utils/simulator.hh | 4 ++-- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/opm/models/utils/basicparameters.hh b/opm/models/utils/basicparameters.hh index 2dc23cab4..05a1ef28f 100644 --- a/opm/models/utils/basicparameters.hh +++ b/opm/models/utils/basicparameters.hh @@ -77,8 +77,8 @@ struct PredeterminedTimeStepsFile { static constexpr auto value = ""; }; struct PrintParameters { static constexpr int value = 2; }; //! The default value for the simulation's restart time -template -struct RestartTime { using type = Properties::UndefinedProperty; }; +template +struct RestartTime { static constexpr Scalar value = -1e35; }; } // namespace Opm:Parameters diff --git a/opm/models/utils/basicproperties.hh b/opm/models/utils/basicproperties.hh index 841384c12..c1553eae1 100644 --- a/opm/models/utils/basicproperties.hh +++ b/opm/models/utils/basicproperties.hh @@ -195,14 +195,6 @@ struct InitialTimeStepSize static constexpr type value = -1e35; }; -//! The default value for the simulation's restart time -template -struct RestartTime -{ - using type = GetPropType; - static constexpr type value = -1e35; -}; - } // namespace Opm::Parameters #endif diff --git a/opm/models/utils/simulator.hh b/opm/models/utils/simulator.hh index c80f85aba..3bada2a78 100644 --- a/opm/models/utils/simulator.hh +++ b/opm/models/utils/simulator.hh @@ -258,7 +258,7 @@ public: ("The simulation time at which the simulation is finished [s]"); Parameters::registerParam ("The size of the initial time step [s]"); - Parameters::registerParam + Parameters::Register> ("The simulation time at which a restart should be attempted [s]"); Parameters::Register ("A file with a list of predetermined time step sizes (one " @@ -649,7 +649,7 @@ public: TimerGuard writeTimerGuard(writeTimer_); setupTimer_.start(); - Scalar restartTime = Parameters::get(); + Scalar restartTime = Parameters::Get>(); if (restartTime > -1e30) { // try to restart a previous simulation time_ = restartTime;