diff --git a/examples/problems/co2ptflashproblem.hh b/examples/problems/co2ptflashproblem.hh index d027bdb18..481d4f512 100644 --- a/examples/problems/co2ptflashproblem.hh +++ b/examples/problems/co2ptflashproblem.hh @@ -157,12 +157,6 @@ struct SimulationName { static constexpr auto value = "co2_ptflash"; }; -template -struct LinearSolverAbsTolerance { - using type = GetPropType; - static constexpr type value = 0.; -}; - // this is kinds of telling the report step length template struct EpisodeLength { @@ -244,6 +238,13 @@ struct InitialTimeStepSize static constexpr type value = 0.1 * 60. * 60.; }; +template +struct LinearSolverAbsTolerance +{ + using type = GetPropType; + static constexpr type value = 0.; +}; + template struct LinearSolverTolerance { diff --git a/opm/models/discretization/common/fvbasediscretization.hh b/opm/models/discretization/common/fvbasediscretization.hh index 8ee02a757..5e63416ac 100644 --- a/opm/models/discretization/common/fvbasediscretization.hh +++ b/opm/models/discretization/common/fvbasediscretization.hh @@ -242,14 +242,6 @@ template struct EnableConstraints { static constexpr bool value = false; }; -// use default initialization based on rule-of-thumb of Newton tolerance -template -struct LinearSolverAbsTolerance -{ - using type = GetPropType; - static constexpr type value = -1.; -}; - //! Set the history size of the time discretization to 2 (for implicit euler) template struct TimeDiscHistorySize @@ -335,6 +327,14 @@ template struct EnableThermodynamicHints { static constexpr bool value = false; }; +// use default initialization based on rule-of-thumb of Newton tolerance +template +struct LinearSolverAbsTolerance +{ + using type = GetPropType; + static constexpr type value = -1.; +}; + // if the deflection of the newton method is large, we do not need to solve the linear // approximation accurately. Assuming that the value for the current solution is quite // close to the final value, a reduction of 3 orders of magnitude in the defect should be diff --git a/opm/simulators/linalg/linalgparameters.hh b/opm/simulators/linalg/linalgparameters.hh index e4a787c1e..5b28ce541 100644 --- a/opm/simulators/linalg/linalgparameters.hh +++ b/opm/simulators/linalg/linalgparameters.hh @@ -33,6 +33,12 @@ namespace Opm::Parameters { +/*! + * \brief Maximum accepted error of the norm of the residual. + */ +template +struct LinearSolverAbsTolerance { using type = Properties::UndefinedProperty; }; + /*! * \brief The size of the algebraic overlap of the linear solver. * diff --git a/opm/simulators/linalg/linalgproperties.hh b/opm/simulators/linalg/linalgproperties.hh index 081f3a2af..1ab0d931f 100644 --- a/opm/simulators/linalg/linalgproperties.hh +++ b/opm/simulators/linalg/linalgproperties.hh @@ -41,17 +41,10 @@ struct LinearSolverBackend { using type = UndefinedProperty; }; template struct PreconditionerWrapper { using type = UndefinedProperty; }; - //! The floating point type used internally by the linear solver template struct LinearSolverScalar { using type = UndefinedProperty; }; -/*! - * \brief Maximum accepted error of the norm of the residual. - */ -template -struct LinearSolverAbsTolerance { using type = UndefinedProperty; }; - /*! * \brief Specifies the verbosity of the linear solver * @@ -88,18 +81,25 @@ struct GlobalEqVector { using type = UndefinedProperty; }; template struct AmgCoarsenTarget { using type = UndefinedProperty; }; + template struct LinearSolverMaxError { using type = UndefinedProperty; }; + template struct LinearSolverWrapper { using type = UndefinedProperty; }; + template struct Overlap { using type = UndefinedProperty; }; + template struct OverlappingLinearOperator { using type = UndefinedProperty; }; + template struct OverlappingMatrix { using type = UndefinedProperty; }; + template struct OverlappingScalarProduct { using type = UndefinedProperty; }; + template struct OverlappingVector { using type = UndefinedProperty; }; diff --git a/opm/simulators/linalg/parallelamgbackend.hh b/opm/simulators/linalg/parallelamgbackend.hh index 6954649a8..87b24086c 100644 --- a/opm/simulators/linalg/parallelamgbackend.hh +++ b/opm/simulators/linalg/parallelamgbackend.hh @@ -194,7 +194,7 @@ protected: using CCC = CombinedCriterion; Scalar linearSolverTolerance = Parameters::get(); - Scalar linearSolverAbsTolerance = Parameters::get(); + Scalar linearSolverAbsTolerance = Parameters::get(); if(linearSolverAbsTolerance < 0.0) linearSolverAbsTolerance = this->simulator_.model().newtonMethod().tolerance()/100.0; diff --git a/opm/simulators/linalg/parallelbasebackend.hh b/opm/simulators/linalg/parallelbasebackend.hh index de2edcc5c..d6eb29863 100644 --- a/opm/simulators/linalg/parallelbasebackend.hh +++ b/opm/simulators/linalg/parallelbasebackend.hh @@ -154,7 +154,7 @@ public: { Parameters::registerParam ("The maximum allowed error between of the linear solver"); - Parameters::registerParam + Parameters::registerParam ("The maximum accepted error of the norm of the residual"); Parameters::registerParam ("The size of the algebraic overlap for the linear solver"); diff --git a/opm/simulators/linalg/parallelbicgstabbackend.hh b/opm/simulators/linalg/parallelbicgstabbackend.hh index 2060cbdad..4be7dbadc 100644 --- a/opm/simulators/linalg/parallelbicgstabbackend.hh +++ b/opm/simulators/linalg/parallelbicgstabbackend.hh @@ -138,7 +138,7 @@ protected: using CCC = CombinedCriterion; Scalar linearSolverTolerance = Parameters::get(); - Scalar linearSolverAbsTolerance = Parameters::get(); + Scalar linearSolverAbsTolerance = Parameters::get(); if(linearSolverAbsTolerance < 0.0) linearSolverAbsTolerance = this->simulator_.model().newtonMethod().tolerance() / 100.0;