From dd7ce5b79e14e2cbf06896a6dd766703b551b38b Mon Sep 17 00:00:00 2001
From: Bernd Flemisch <bernd@iws.uni-stuttgart.de>
Date: Wed, 15 Jul 2020 11:37:20 +0200
Subject: [PATCH] [linear] fix macro calls and changelog entry

Replace calls to deprecated `DUNE_VERSION_NEWER_REV(DUNE_ISTL,2,7,1)`
by `DUNE_VERSION_GT_REV(DUNE_ISTL,2,7,0)` which also reads better than
the `GTE` version, as Dune 2.7.1 hasn't been released yet. Fix the
call to `DUNE_VERSION_GT(DUNE_ISTL,2,7)` in the solver factory
backend which would break things in case of a 2.7.1 release. Adapt
the corresponding changelog entry.
---
 CHANGELOG.md                                         | 2 +-
 dumux/linear/istlsolverfactorybackend.hh             | 4 ++--
 test/freeflow/shallowwater/dambreak/main.cc          | 4 ++--
 test/porousmediumflow/richards/implicit/lens/main.cc | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3358381e31..d2383d3664 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,7 +41,7 @@ An additional new option is `Vtk.CoordPrecision` which changes the precision of
 
 - __Examples__: The documentation of the examples has been improved further, focusing on readability and convenience. Further, three additional examples are included the folder `examples`. To get an overview, point your browser to https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/tree/master/examples.
 
-- __Linear solvers__: There is a new ISTL solver factory backend which allows to choose solvers at runtime (requires dune-istl 2.7) and also enables more parallel solvers (requires dune-istl > 2.7.1).
+- __Linear solvers__: There is a new ISTL solver factory backend which allows to choose solvers at runtime (requires dune-istl 2.7) and also enables more parallel solvers (requires dune-istl > 2.7.0).
 
 
 ### Immediate interface changes not allowing/requiring a deprecation period
diff --git a/dumux/linear/istlsolverfactorybackend.hh b/dumux/linear/istlsolverfactorybackend.hh
index 9cb4d61fb2..0d49a66147 100644
--- a/dumux/linear/istlsolverfactorybackend.hh
+++ b/dumux/linear/istlsolverfactorybackend.hh
@@ -238,7 +238,7 @@ private:
     template<class ParallelTraits, class Matrix, class Vector>
     void solveParallel_(Matrix& A, Vector& x, Vector& b)
     {
-#if DUNE_VERSION_GT(DUNE_ISTL,2,7)
+#if DUNE_VERSION_GT_REV(DUNE_ISTL,2,7,0)
         using Comm = typename ParallelTraits::Comm;
         using LinearOperator = typename ParallelTraits::LinearOperator;
         using ScalarProduct = typename ParallelTraits::ScalarProduct;
@@ -260,7 +260,7 @@ private:
         // solve linear system
         solver->apply(x, b, result_);
 #else
-        DUNE_THROW(Dune::NotImplemented, "Parallel solvers only available for dune-istl > 2.7");
+        DUNE_THROW(Dune::NotImplemented, "Parallel solvers only available for dune-istl > 2.7.0");
 #endif
     }
 #endif // HAVE_MPI
diff --git a/test/freeflow/shallowwater/dambreak/main.cc b/test/freeflow/shallowwater/dambreak/main.cc
index 18080ada72..7471c8ab89 100644
--- a/test/freeflow/shallowwater/dambreak/main.cc
+++ b/test/freeflow/shallowwater/dambreak/main.cc
@@ -43,7 +43,7 @@
 
 #include <dumux/linear/linearsolvertraits.hh>
 
-#if DUNE_VERSION_NEWER_REV(DUNE_ISTL,2,7,1)
+#if DUNE_VERSION_GT_REV(DUNE_ISTL,2,7,0)
 #include <dumux/linear/istlsolverfactorybackend.hh>
 #else
 #include <dumux/linear/amgbackend.hh>
@@ -131,7 +131,7 @@ int main(int argc, char** argv) try
     auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld);
 
     // the linear solver
-#if DUNE_VERSION_NEWER_REV(DUNE_ISTL,2,7,1)
+#if DUNE_VERSION_GT_REV(DUNE_ISTL,2,7,0)
     using LinearSolver = IstlSolverFactoryBackend<LinearSolverTraits<GridGeometry>>;
 #else
     using LinearSolver = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>;
diff --git a/test/porousmediumflow/richards/implicit/lens/main.cc b/test/porousmediumflow/richards/implicit/lens/main.cc
index a64ffec974..781509124a 100644
--- a/test/porousmediumflow/richards/implicit/lens/main.cc
+++ b/test/porousmediumflow/richards/implicit/lens/main.cc
@@ -39,7 +39,7 @@
 #include <dumux/common/dumuxmessage.hh>
 #include <dumux/linear/linearsolvertraits.hh>
 
-#if DUNE_VERSION_NEWER_REV(DUNE_ISTL,2,7,1)
+#if DUNE_VERSION_GT_REV(DUNE_ISTL,2,7,0)
 #include <dumux/linear/istlsolverfactorybackend.hh>
 #include <dumux/linear/linearsolvertraits.hh>
 #else
@@ -149,7 +149,7 @@ int main(int argc, char** argv) try
     auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld);
 
     // the linear solver
-#if DUNE_VERSION_NEWER_REV(DUNE_ISTL,2,7,1)
+#if DUNE_VERSION_GT_REV(DUNE_ISTL,2,7,0)
     using LinearSolver = IstlSolverFactoryBackend<LinearSolverTraits<GridGeometry>>;
 #else
     using LinearSolver = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>;
-- 
GitLab