From 4e0cdd289d542550a08e1a1d3143b9c98b206ede Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 1 Jul 2024 14:13:14 +0200 Subject: [PATCH] changed: move the AmgCoarsenTarget parameter to Opm::Parameters --- opm/simulators/linalg/linalgparameters.hh | 3 +++ opm/simulators/linalg/linalgproperties.hh | 3 --- opm/simulators/linalg/parallelamgbackend.hh | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/opm/simulators/linalg/linalgparameters.hh b/opm/simulators/linalg/linalgparameters.hh index 88baf26b5..62ca4c552 100644 --- a/opm/simulators/linalg/linalgparameters.hh +++ b/opm/simulators/linalg/linalgparameters.hh @@ -33,6 +33,9 @@ namespace Opm::Parameters { +template +struct AmgCoarsenTarget { using type = Properties::UndefinedProperty; }; + //! number of iterations between solver restarts for the GMRES solver template struct GMResRestart { using type = Properties::UndefinedProperty; }; diff --git a/opm/simulators/linalg/linalgproperties.hh b/opm/simulators/linalg/linalgproperties.hh index 78027affe..cd63c7024 100644 --- a/opm/simulators/linalg/linalgproperties.hh +++ b/opm/simulators/linalg/linalgproperties.hh @@ -53,9 +53,6 @@ struct SparseMatrixAdapter { using type = UndefinedProperty; }; template struct GlobalEqVector { using type = UndefinedProperty; }; -template -struct AmgCoarsenTarget { using type = UndefinedProperty; }; - template struct LinearSolverWrapper { using type = UndefinedProperty; }; diff --git a/opm/simulators/linalg/parallelamgbackend.hh b/opm/simulators/linalg/parallelamgbackend.hh index b56834f5f..e3bc26448 100644 --- a/opm/simulators/linalg/parallelamgbackend.hh +++ b/opm/simulators/linalg/parallelamgbackend.hh @@ -59,12 +59,6 @@ struct ParallelAmgLinearSolver } // end namespace TTag -//! The target number of DOFs per processor for the parallel algebraic -//! multi-grid solver -template -struct AmgCoarsenTarget -{ static constexpr int value = 5000; }; - template struct LinearSolverBackend { using type = Opm::Linear::ParallelAmgBackend; }; @@ -73,6 +67,12 @@ struct LinearSolverBackend namespace Opm::Parameters { +//! The target number of DOFs per processor for the parallel algebraic +//! multi-grid solver +template +struct AmgCoarsenTarget +{ static constexpr int value = 5000; }; + template struct LinearSolverMaxError { @@ -163,7 +163,7 @@ public: Parameters::registerParam ("The maximum residual error which the linear solver tolerates " "without giving up"); - Parameters::registerParam + Parameters::registerParam ("The coarsening target for the agglomerations of " "the AMG preconditioner"); } @@ -299,7 +299,7 @@ protected: // Dune::Amg::FirstDiagonal>> using CoarsenCriterion = Dune::Amg:: CoarsenCriterion >; - int coarsenTarget = Parameters::get(); + int coarsenTarget = Parameters::get(); CoarsenCriterion coarsenCriterion(/*maxLevel=*/15, coarsenTarget); coarsenCriterion.setDefaultValuesAnisotropic(GridView::dimension, /*aggregateSizePerDim=*/3);