diff --git a/examples/problems/co2ptflashproblem.hh b/examples/problems/co2ptflashproblem.hh index c4f8873c2..276956eeb 100644 --- a/examples/problems/co2ptflashproblem.hh +++ b/examples/problems/co2ptflashproblem.hh @@ -190,10 +190,6 @@ struct LinearSolverTolerance static constexpr type value = 1e-3; }; -template -struct NewtonMaxIterations -{ static constexpr int value = 30; }; - template struct SimulationName { static constexpr auto value = "co2_ptflash"; }; @@ -366,8 +362,9 @@ public: Parameters::SetDefault>(60. * 60.); Parameters::SetDefault>(0.1 * 60. * 60.); - Parameters::SetDefault>(1e-3); + Parameters::SetDefault(30); Parameters::SetDefault(6); + Parameters::SetDefault>(1e-3); } /*! diff --git a/examples/problems/richardslensproblem.hh b/examples/problems/richardslensproblem.hh index a33e42856..2fc9fc417 100644 --- a/examples/problems/richardslensproblem.hh +++ b/examples/problems/richardslensproblem.hh @@ -108,10 +108,6 @@ template struct EnableGravity { static constexpr bool value = true; }; -template -struct NewtonMaxIterations -{ static constexpr int value = 28; }; - } // namespace Opm::Parameters namespace Opm { @@ -248,6 +244,7 @@ public: Parameters::SetDefault>(3000.0); Parameters::SetDefault>(100.0); + Parameters::SetDefault(28); Parameters::SetDefault(18); } diff --git a/opm/models/nonlinear/newtonmethod.hh b/opm/models/nonlinear/newtonmethod.hh index a73877b1e..222a05a72 100644 --- a/opm/models/nonlinear/newtonmethod.hh +++ b/opm/models/nonlinear/newtonmethod.hh @@ -79,14 +79,6 @@ struct NewtonConvergenceWriter { using type = NullC } // namespace Opm::Properties -namespace Opm::Parameters { - -template -struct NewtonMaxIterations -{ static constexpr int value = 20; }; - -} // namespace Opm::Parameters - namespace Opm { /*! * \ingroup Newton @@ -146,7 +138,7 @@ public: "method to a VTK file"); Parameters::Register ("The 'optimum' number of Newton iterations per time step"); - Parameters::registerParam + Parameters::Register ("The maximum number of Newton iterations per time step"); Parameters::Register> ("The maximum raw error tolerated by the Newton" @@ -845,7 +837,7 @@ protected: { return Parameters::Get(); } // maximum number of iterations we do before giving up int maxIterations_() const - { return Parameters::get(); } + { return Parameters::Get(); } static bool enableConstraints_() { return getPropValue(); } diff --git a/opm/models/nonlinear/newtonmethodparameters.hh b/opm/models/nonlinear/newtonmethodparameters.hh index e9385082b..72afa9ece 100644 --- a/opm/models/nonlinear/newtonmethodparameters.hh +++ b/opm/models/nonlinear/newtonmethodparameters.hh @@ -23,8 +23,6 @@ #ifndef EWOMS_NEWTON_METHOD_PARAMETERS_HH #define EWOMS_NEWTON_METHOD_PARAMETERS_HH -#include - namespace Opm::Parameters { //! The maximum error which may occur in a simulation before the @@ -32,6 +30,9 @@ namespace Opm::Parameters { template struct NewtonMaxError { static constexpr Scalar value = 1e100; }; +//! Number of maximum iterations for the Newton method. +struct NewtonMaxIterations { static constexpr int value = 20; }; + /*! * \brief The number of iterations at which the Newton method * should aim at. @@ -58,10 +59,6 @@ struct NewtonVerbose { static constexpr bool value = true; }; //! gets written out to disk for every Newton iteration struct NewtonWriteConvergence { static constexpr bool value = false; }; -//! Number of maximum iterations for the Newton method. -template -struct NewtonMaxIterations { using type = Properties::UndefinedProperty; }; - } // end namespace Opm::Parameters #endif