diff --git a/opm/simulators/linalg/HyprePreconditioner.hpp b/opm/simulators/linalg/HyprePreconditioner.hpp index 54d0911cb..5af6c3a5b 100644 --- a/opm/simulators/linalg/HyprePreconditioner.hpp +++ b/opm/simulators/linalg/HyprePreconditioner.hpp @@ -31,11 +31,11 @@ #include #include -namespace Dune { +namespace Hypre { /// Wrapper for Hypre's BoomerAMG preconditioner template -class HyprePreconditioner : public PreconditionerWithUpdate { +class HyprePreconditioner : public Dune::PreconditionerWithUpdate { public: //! \brief The matrix type the preconditioner is for using matrix_type = M; @@ -47,8 +47,8 @@ public: using field_type = typename X::field_type; // Constructor - HyprePreconditioner (const M& A) - : A_(A) + HyprePreconditioner (const M& A, const Opm::PropertyTree& prm) + : A_(A), prm_(prm) { OPM_TIMEBLOCK(prec_construct); @@ -129,8 +129,8 @@ public: DUNE_UNUSED_PARAMETER(x); } - SolverCategory::Category category() const override { - return SolverCategory::sequential; + Dune::SolverCategory::Category category() const override { + return Dune::SolverCategory::sequential; } bool hasPerfectUpdate() const override @@ -194,6 +194,8 @@ private: } const M& A_; + const Opm::PropertyTree& prm_; + HYPRE_Solver solver_ = nullptr; HYPRE_IJMatrix A_hypre_ = nullptr; HYPRE_ParCSRMatrix parcsr_A_ = nullptr; diff --git a/opm/simulators/linalg/PreconditionerFactory_impl.hpp b/opm/simulators/linalg/PreconditionerFactory_impl.hpp index 7b4e85285..4c56a9404 100644 --- a/opm/simulators/linalg/PreconditionerFactory_impl.hpp +++ b/opm/simulators/linalg/PreconditionerFactory_impl.hpp @@ -549,9 +549,8 @@ struct StandardPreconditioners { }); // Only add Hypre for scalar matrices if constexpr (M::block_type::rows == 1 && M::block_type::cols == 1) { - F::addCreator("HypreBoomerAMG", [](const O& op, const P& prm, const std::function&, std::size_t) { - DUNE_UNUSED_PARAMETER(prm); - return std::make_shared>(op.getmat()); + F::addCreator("hypre", [](const O& op, const P& prm, const std::function&, std::size_t) { + return std::make_shared>(op.getmat(), prm); }); } }