diff --git a/dumux/linear/istlsolverfactorybackend.hh b/dumux/linear/istlsolverfactorybackend.hh index 71ab33b3f47cf8abb064c5c7cab282695d36d6f3..3f5add0635567ae08300fdf2beff2013500c8cd7 100644 --- a/dumux/linear/istlsolverfactorybackend.hh +++ b/dumux/linear/istlsolverfactorybackend.hh @@ -26,8 +26,9 @@ #ifndef DUMUX_LINEAR_ISTL_SOLVERFACTORYBACKEND_HH #define DUMUX_LINEAR_ISTL_SOLVERFACTORYBACKEND_HH -#include <dune/common/version.hh> +#include <memory> +#include <dune/common/version.hh> #include <dune/common/parallel/mpihelper.hh> #include <dune/common/parametertree.hh> @@ -70,7 +71,11 @@ int initSolverFactoriesForMultiTypeBlockMatrix() using TL = Dune::TypeList<M,X,Y>; auto& dsfac = Dune::DirectSolverFactory<M,X,Y>::instance(); Dune::addRegistryToFactory<TL>(dsfac, Dumux::MultiTypeBlockMatrixDirectSolverTag{}); +#if DUNE_VERSION_GT(DUNE_ISTL,2,7) auto& pfac = Dune::PreconditionerFactory<LinearOperator,X,Y>::instance(); +#else + auto& pfac = Dune::PreconditionerFactory<M,X,Y>::instance(); +#endif Dune::addRegistryToFactory<TL>(pfac, Dumux::MultiTypeBlockMatrixPreconditionerTag{}); using TLS = Dune::TypeList<X,Y>; auto& isfac = Dune::IterativeSolverFactory<X,Y>::instance(); diff --git a/dumux/linear/linearsolverparameters.hh b/dumux/linear/linearsolverparameters.hh index a3d8164aa731a689dd60a322c8d0b32a4b414219..bf33ed39e33b5c6821c6cea4bacedeeda65b3be9 100644 --- a/dumux/linear/linearsolverparameters.hh +++ b/dumux/linear/linearsolverparameters.hh @@ -63,6 +63,7 @@ public: params["preconditioner.verbosity"] = "0"; params["preconditioner.defaultAggregationSizeMode"] = "isotropic"; params["preconditioner.defaultAggregationDimension"] = std::to_string(LinearSolverTraits::GridView::dimension); + params["preconditioner.maxLevel"] = "100"; params["ParameterGroup"] = paramGroup; params["preconditioner.ParameterGroup"] = paramGroup; } diff --git a/dumux/linear/preconditioners.hh b/dumux/linear/preconditioners.hh index f2ba6e10b4e06d101312c7227396e77a37e80e94..79d95e6f37efed7712f95081b8da43a285370b02 100644 --- a/dumux/linear/preconditioners.hh +++ b/dumux/linear/preconditioners.hh @@ -29,7 +29,6 @@ #include <dune/common/indices.hh> #include <dune/istl/preconditioners.hh> #include <dune/istl/paamg/amg.hh> -#include <dune/common/version.hh> #if HAVE_UMFPACK #include <dune/istl/umfpack.hh> @@ -37,10 +36,7 @@ #include <dumux/common/parameters.hh> #include <dumux/common/typetraits/matrix.hh> - -#if DUNE_VERSION_NEWER_REV(DUNE_ISTL,2,7,1) #include <dumux/linear/istlsolverregistry.hh> -#endif namespace Dumux { @@ -110,8 +106,13 @@ public: * \param mat The matrix to operate on. * \param params Collection of paramters. */ - SeqUzawa(const std::shared_ptr<const Dune::AssembledLinearOperator<M,X,Y>>& mat, const Dune::ParameterTree& params) - : matrix_(mat->getmat()) +#if DUNE_VERSION_GT(DUNE_ISTL,2,7) + SeqUzawa(const std::shared_ptr<const Dune::AssembledLinearOperator<M,X,Y>>& op, const Dune::ParameterTree& params) + : matrix_(op->getmat()) +#else + SeqUzawa(const M& mat, const Dune::ParameterTree& params) + : matrix_(mat) +#endif , numIterations_(params.get<std::size_t>("iterations")) , relaxationFactor_(params.get<scalar_field_type>("relaxation")) , verbosity_(params.get<int>("verbosity")) @@ -329,9 +330,7 @@ private: const bool useDirectVelocitySolverForA_; }; -#if DUNE_VERSION_NEWER_REV(DUNE_ISTL,2,7,1) DUMUX_REGISTER_PRECONDITIONER("uzawa", Dumux::MultiTypeBlockMatrixPreconditionerTag, Dune::defaultPreconditionerBlockLevelCreator<Dumux::SeqUzawa, 1>()); -#endif } // end namespace Dumux