changed: move the GMResRestart parameter to Opm::Parameters

This commit is contained in:
Arne Morten Kvarving 2024-07-01 14:13:14 +02:00
parent b5470dc3eb
commit f3af89447b
4 changed files with 15 additions and 10 deletions

View File

@ -125,7 +125,7 @@ public:
static void registerParameters()
{
Parameters::registerParam<TypeTag, Properties::GMResRestart>
Parameters::registerParam<TypeTag, Parameters::GMResRestart>
("Number of iterations after which the GMRES linear solver is restarted");
}
@ -140,7 +140,7 @@ public:
int verbosity = 0;
if (parOperator.overlap().myRank() == 0)
verbosity = Parameters::get<TypeTag, Parameters::LinearSolverVerbosity>();
int restartAfter = Parameters::get<TypeTag, Properties::GMResRestart>();
int restartAfter = Parameters::get<TypeTag, Parameters::GMResRestart>();
solver_ = std::make_shared<RawSolver>(parOperator,
parScalarProduct,
parPreCond,

View File

@ -33,6 +33,10 @@
namespace Opm::Parameters {
//! number of iterations between solver restarts for the GMRES solver
template<class TypeTag, class MyTypeTag>
struct GMResRestart { using type = Properties::UndefinedProperty; };
/*!
* \brief Maximum accepted error of the norm of the residual.
*/

View File

@ -45,10 +45,6 @@ struct PreconditionerWrapper { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LinearSolverScalar { using type = UndefinedProperty; };
//! number of iterations between solver restarts for the GMRES solver
template<class TypeTag, class MyTypeTag>
struct GMResRestart { using type = UndefinedProperty; };
//! The class that allows to manipulate sparse matrices
template<class TypeTag, class MyTypeTag>
struct SparseMatrixAdapter { using type = UndefinedProperty; };

View File

@ -156,10 +156,15 @@ template<class TypeTag>
struct PreconditionerWrapper<TypeTag, TTag::ParallelIstlLinearSolver>
{ using type = Opm::Linear::PreconditionerWrapperILU<TypeTag>; };
//! set the GMRes restart parameter to 10 by default
template<class TypeTag>
struct GMResRestart<TypeTag, TTag::ParallelIstlLinearSolver> { static constexpr int value = 10; };
} // namespace Opm::Properties
namespace Opm::Parameters {
//! set the GMRes restart parameter to 10 by default
template<class TypeTag>
struct GMResRestart<TypeTag, Properties::TTag::ParallelIstlLinearSolver>
{ static constexpr int value = 10; };
}
#endif