From 55c866b698a5d92d7f9c2f49e4a3646d85a9488c Mon Sep 17 00:00:00 2001
From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de>
Date: Mon, 20 Apr 2020 15:12:16 +0200
Subject: [PATCH 1/4] [linear][istlsolverfactorybackend] Make compile with
 dune-2.7

---
 dumux/linear/istlsolverfactorybackend.hh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dumux/linear/istlsolverfactorybackend.hh b/dumux/linear/istlsolverfactorybackend.hh
index 71ab33b3f4..3f5add0635 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();
-- 
GitLab


From c57a816cb78e671e850363cdae2202ad5a213945 Mon Sep 17 00:00:00 2001
From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de>
Date: Mon, 20 Apr 2020 15:13:11 +0200
Subject: [PATCH 2/4] [linear][preconditioners] Remove check for dune-2.7

---
 dumux/linear/preconditioners.hh | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/dumux/linear/preconditioners.hh b/dumux/linear/preconditioners.hh
index f2ba6e10b4..64de4d0019 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 {
 
@@ -329,9 +325,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
 
-- 
GitLab


From e8e584dd8f23942105c844e9d71ad246e4b3e25e Mon Sep 17 00:00:00 2001
From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de>
Date: Mon, 20 Apr 2020 17:22:38 +0200
Subject: [PATCH 3/4] [linear][preconditioners] Make compile with dune-2.7

---
 dumux/linear/preconditioners.hh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/dumux/linear/preconditioners.hh b/dumux/linear/preconditioners.hh
index 64de4d0019..79d95e6f37 100644
--- a/dumux/linear/preconditioners.hh
+++ b/dumux/linear/preconditioners.hh
@@ -106,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"))
-- 
GitLab


From 40f655df2daa0697aae512725aba23715e26b9e1 Mon Sep 17 00:00:00 2001
From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de>
Date: Mon, 20 Apr 2020 17:23:22 +0200
Subject: [PATCH 4/4] [linearsolverparameters] Add AMG.MaxLevel as default
 param

---
 dumux/linear/linearsolverparameters.hh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dumux/linear/linearsolverparameters.hh b/dumux/linear/linearsolverparameters.hh
index a3d8164aa7..bf33ed39e3 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;
     }
-- 
GitLab