diff --git a/examples/problems/co2ptflashproblem.hh b/examples/problems/co2ptflashproblem.hh index ee54d0234..a1c17e872 100644 --- a/examples/problems/co2ptflashproblem.hh +++ b/examples/problems/co2ptflashproblem.hh @@ -194,12 +194,6 @@ struct NewtonMaxIterations { static constexpr int value = 30; }; -template -struct NewtonTargetIterations { - using type = GetPropType; - static constexpr type value = 6; -}; - // output template struct VtkWriteFilterVelocities { @@ -300,6 +294,13 @@ struct NewtonTolerance static constexpr type value = 1e-3; }; +template +struct NewtonTargetIterations +{ + using type = GetPropType; + static constexpr type value = 6; +}; + } // namespace Opm::Parameters namespace Opm { diff --git a/examples/problems/richardslensproblem.hh b/examples/problems/richardslensproblem.hh index 6b23b1bf2..2942016c8 100644 --- a/examples/problems/richardslensproblem.hh +++ b/examples/problems/richardslensproblem.hh @@ -111,10 +111,6 @@ struct NumericDifferenceMethod { static cons template struct NewtonMaxIterations { static constexpr int value = 28; }; -// Set the "desireable" number of newton iterations of a time step -template -struct NewtonTargetIterations { static constexpr int value = 18; }; - // The default for the end time of the simulation template struct EndTime @@ -144,6 +140,11 @@ template struct NewtonWriteConvergence { static constexpr bool value = false; }; +// Set the "desireable" number of newton iterations of a time step +template +struct NewtonTargetIterations +{ static constexpr int value = 18; }; + } // namespace Opm::Parameters namespace Opm { diff --git a/opm/models/nonlinear/newtonmethod.hh b/opm/models/nonlinear/newtonmethod.hh index c12f5b749..855fbd481 100644 --- a/opm/models/nonlinear/newtonmethod.hh +++ b/opm/models/nonlinear/newtonmethod.hh @@ -79,8 +79,6 @@ struct NewtonConvergenceWriter { using type = NullC // set the abortion tolerace to some very large value. if not // overwritten at run-time this basically disables abortions template -struct NewtonTargetIterations { static constexpr int value = 10; }; -template struct NewtonMaxIterations { static constexpr int value = 20; }; } // namespace Opm::Properties @@ -109,6 +107,10 @@ struct NewtonMaxError static constexpr type value = 1e100; }; +template +struct NewtonTargetIterations +{ static constexpr int value = 10; }; + } // namespace Opm::Parameters namespace Opm { @@ -168,7 +170,7 @@ public: Parameters::registerParam ("Write the convergence behaviour of the Newton " "method to a VTK file"); - Parameters::registerParam + Parameters::registerParam ("The 'optimum' number of Newton iterations per time step"); Parameters::registerParam ("The maximum number of Newton iterations per time step"); @@ -864,7 +866,7 @@ protected: // optimal number of iterations we want to achieve int targetIterations_() const - { return Parameters::get(); } + { return Parameters::get(); } // maximum number of iterations we do before giving up int maxIterations_() const { return Parameters::get(); } diff --git a/opm/models/nonlinear/newtonmethodparameters.hh b/opm/models/nonlinear/newtonmethodparameters.hh index f5a6bdc95..e73273370 100644 --- a/opm/models/nonlinear/newtonmethodparameters.hh +++ b/opm/models/nonlinear/newtonmethodparameters.hh @@ -50,6 +50,17 @@ struct NewtonTolerance { using type = Properties::UndefinedProperty; }; template struct NewtonMaxError { using type = Properties::UndefinedProperty; }; +/*! + * \brief The number of iterations at which the Newton method + * should aim at. + * + * This is used to control the time-step size. The heuristic used + * is to scale the last time-step size by the deviation of the + * number of iterations used from the target steps. + */ +template +struct NewtonTargetIterations { using type = Properties::UndefinedProperty; }; + } // end namespace Opm::Parameters #endif diff --git a/opm/models/nonlinear/newtonmethodproperties.hh b/opm/models/nonlinear/newtonmethodproperties.hh index 3d4de9a49..07adeb3dc 100644 --- a/opm/models/nonlinear/newtonmethodproperties.hh +++ b/opm/models/nonlinear/newtonmethodproperties.hh @@ -44,17 +44,6 @@ struct NewtonConvergenceWriter { using type = UndefinedProperty; }; template struct ConvergenceWriter { using type = UndefinedProperty; }; -/*! - * \brief The number of iterations at which the Newton method - * should aim at. - * - * This is used to control the time-step size. The heuristic used - * is to scale the last time-step size by the deviation of the - * number of iterations used from the target steps. - */ -template -struct NewtonTargetIterations { using type = UndefinedProperty; }; - //! Number of maximum iterations for the Newton method. template struct NewtonMaxIterations { using type = UndefinedProperty; };