changed: move the NewtonMaxIterations parameter to Opm::Parameters

This commit is contained in:
Arne Morten Kvarving 2024-07-01 10:20:05 +02:00
parent 7a4a91c3bf
commit e28284b68a
5 changed files with 21 additions and 19 deletions

View File

@ -189,11 +189,6 @@ struct LinearSolverAbsTolerance<TypeTag, TTag::CO2PTBaseProblem> {
static constexpr type value = 0.;
};
template <class TypeTag>
struct NewtonMaxIterations<TypeTag, TTag::CO2PTBaseProblem> {
static constexpr int value = 30;
};
// output
template <class TypeTag>
struct VtkWriteFilterVelocities<TypeTag, TTag::CO2PTBaseProblem> {
@ -301,6 +296,10 @@ struct NewtonTargetIterations<TypeTag, Properties::TTag::CO2PTBaseProblem>
static constexpr type value = 6;
};
template <class TypeTag>
struct NewtonMaxIterations<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr int value = 30; };
} // namespace Opm::Parameters
namespace Opm {

View File

@ -107,10 +107,6 @@ struct EnableGravity<TypeTag, TTag::RichardsLensProblem> { static constexpr bool
template<class TypeTag>
struct NumericDifferenceMethod<TypeTag, TTag::RichardsLensProblem> { static constexpr int value = 0; };
// Set the maximum number of newton iterations of a time step
template<class TypeTag>
struct NewtonMaxIterations<TypeTag, TTag::RichardsLensProblem> { static constexpr int value = 28; };
// The default for the end time of the simulation
template<class TypeTag>
struct EndTime<TypeTag, TTag::RichardsLensProblem>
@ -145,6 +141,11 @@ template<class TypeTag>
struct NewtonTargetIterations<TypeTag, Properties::TTag::RichardsLensProblem>
{ static constexpr int value = 18; };
// Set the maximum number of newton iterations of a time step
template<class TypeTag>
struct NewtonMaxIterations<TypeTag, Properties::TTag::RichardsLensProblem>
{ static constexpr int value = 28; };
} // namespace Opm::Parameters
namespace Opm {

View File

@ -76,10 +76,6 @@ template<class TypeTag>
struct NewtonMethod<TypeTag, TTag::NewtonMethod> { using type = ::Opm::NewtonMethod<TypeTag>; };
template<class TypeTag>
struct NewtonConvergenceWriter<TypeTag, TTag::NewtonMethod> { using type = NullConvergenceWriter<TypeTag>; };
// set the abortion tolerace to some very large value. if not
// overwritten at run-time this basically disables abortions
template<class TypeTag>
struct NewtonMaxIterations<TypeTag, TTag::NewtonMethod> { static constexpr int value = 20; };
} // namespace Opm::Properties
@ -100,6 +96,8 @@ struct NewtonTolerance<TypeTag, Properties::TTag::NewtonMethod>
static constexpr type value = 1e-8;
};
// set the abortion tolerance to some very large value. if not
// overwritten at run-time this basically disables abortions
template<class TypeTag>
struct NewtonMaxError<TypeTag, Properties::TTag::NewtonMethod>
{
@ -111,6 +109,10 @@ template<class TypeTag>
struct NewtonTargetIterations<TypeTag, Properties::TTag::NewtonMethod>
{ static constexpr int value = 10; };
template<class TypeTag>
struct NewtonMaxIterations<TypeTag, Properties::TTag::NewtonMethod>
{ static constexpr int value = 20; };
} // namespace Opm::Parameters
namespace Opm {
@ -172,7 +174,7 @@ public:
"method to a VTK file");
Parameters::registerParam<TypeTag, Parameters::NewtonTargetIterations>
("The 'optimum' number of Newton iterations per time step");
Parameters::registerParam<TypeTag, Properties::NewtonMaxIterations>
Parameters::registerParam<TypeTag, Parameters::NewtonMaxIterations>
("The maximum number of Newton iterations per time step");
Parameters::registerParam<TypeTag, Parameters::NewtonTolerance>
("The maximum raw error tolerated by the Newton"
@ -869,7 +871,7 @@ protected:
{ return Parameters::get<TypeTag, Parameters::NewtonTargetIterations>(); }
// maximum number of iterations we do before giving up
int maxIterations_() const
{ return Parameters::get<TypeTag, Properties::NewtonMaxIterations>(); }
{ return Parameters::get<TypeTag, Parameters::NewtonMaxIterations>(); }
static bool enableConstraints_()
{ return getPropValue<TypeTag, Properties::EnableConstraints>(); }

View File

@ -61,6 +61,10 @@ struct NewtonMaxError { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct NewtonTargetIterations { using type = Properties::UndefinedProperty; };
//! Number of maximum iterations for the Newton method.
template<class TypeTag, class MyTypeTag>
struct NewtonMaxIterations { using type = Properties::UndefinedProperty; };
} // end namespace Opm::Parameters
#endif

View File

@ -44,10 +44,6 @@ struct NewtonConvergenceWriter { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct ConvergenceWriter { using type = UndefinedProperty; };
//! Number of maximum iterations for the Newton method.
template<class TypeTag, class MyTypeTag>
struct NewtonMaxIterations { using type = UndefinedProperty; };
} // end namespace Opm::Properties
#endif