changed: move the AmgCoarsenTarget parameter to Opm::Parameters

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

View File

@ -33,6 +33,9 @@
namespace Opm::Parameters {
template<class TypeTag, class MyTypeTag>
struct AmgCoarsenTarget { using type = Properties::UndefinedProperty; };
//! number of iterations between solver restarts for the GMRES solver
template<class TypeTag, class MyTypeTag>
struct GMResRestart { using type = Properties::UndefinedProperty; };

View File

@ -53,9 +53,6 @@ struct SparseMatrixAdapter { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct GlobalEqVector { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct AmgCoarsenTarget { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LinearSolverWrapper { using type = UndefinedProperty; };

View File

@ -59,12 +59,6 @@ struct ParallelAmgLinearSolver
} // end namespace TTag
//! The target number of DOFs per processor for the parallel algebraic
//! multi-grid solver
template<class TypeTag>
struct AmgCoarsenTarget<TypeTag, TTag::ParallelAmgLinearSolver>
{ static constexpr int value = 5000; };
template<class TypeTag>
struct LinearSolverBackend<TypeTag, TTag::ParallelAmgLinearSolver>
{ using type = Opm::Linear::ParallelAmgBackend<TypeTag>; };
@ -73,6 +67,12 @@ struct LinearSolverBackend<TypeTag, TTag::ParallelAmgLinearSolver>
namespace Opm::Parameters {
//! The target number of DOFs per processor for the parallel algebraic
//! multi-grid solver
template<class TypeTag>
struct AmgCoarsenTarget<TypeTag, Properties::TTag::ParallelAmgLinearSolver>
{ static constexpr int value = 5000; };
template<class TypeTag>
struct LinearSolverMaxError<TypeTag, Properties::TTag::ParallelAmgLinearSolver>
{
@ -163,7 +163,7 @@ public:
Parameters::registerParam<TypeTag, Parameters::LinearSolverMaxError>
("The maximum residual error which the linear solver tolerates "
"without giving up");
Parameters::registerParam<TypeTag, Properties::AmgCoarsenTarget>
Parameters::registerParam<TypeTag, Parameters::AmgCoarsenTarget>
("The coarsening target for the agglomerations of "
"the AMG preconditioner");
}
@ -299,7 +299,7 @@ protected:
// Dune::Amg::FirstDiagonal>>
using CoarsenCriterion = Dune::Amg::
CoarsenCriterion<Dune::Amg::SymmetricCriterion<IstlMatrix, Dune::Amg::FrobeniusNorm> >;
int coarsenTarget = Parameters::get<TypeTag, Properties::AmgCoarsenTarget>();
int coarsenTarget = Parameters::get<TypeTag, Parameters::AmgCoarsenTarget>();
CoarsenCriterion coarsenCriterion(/*maxLevel=*/15, coarsenTarget);
coarsenCriterion.setDefaultValuesAnisotropic(GridView::dimension,
/*aggregateSizePerDim=*/3);