From 2bdafdb602e73282ddfb641f3467b8db5a5d77f3 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 11 Oct 2017 16:26:22 +0200 Subject: [PATCH] [cleanup] Removes unnecessary if clauses for unsupported DUNE versions. We are targetting DUNE 2.4.* and 2.5.* currently. Therefore this commit removes the if checks for lower versions to cleanup the code. --- opm/core/linalg/LinearSolverIstl.cpp | 18 ------------------ tests/DuneIstlTestHelpers.hpp | 5 ----- tests/test_linearsolver.cpp | 2 -- 3 files changed, 25 deletions(-) diff --git a/opm/core/linalg/LinearSolverIstl.cpp b/opm/core/linalg/LinearSolverIstl.cpp index 3165180c4..82ba13455 100644 --- a/opm/core/linalg/LinearSolverIstl.cpp +++ b/opm/core/linalg/LinearSolverIstl.cpp @@ -47,9 +47,7 @@ #include #include -#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 3) #include -#endif #include @@ -77,7 +75,6 @@ namespace Opm solveCG_AMG(O& A, Vector& x, Vector& b, S& sp, const C& comm, double tolerance, int maxit, int verbosity, double prolongateFactor, int smoothsteps); -#if defined(HAS_DUNE_FAST_AMG) || DUNE_VERSION_NEWER(DUNE_ISTL, 2, 3) template LinearSolverInterface::LinearSolverReport solveKAMG(O& A, Vector& x, Vector& b, S& sp, const C& comm, double tolerance, int maxit, int verbosity, @@ -87,7 +84,6 @@ namespace Opm LinearSolverInterface::LinearSolverReport solveFastAMG(O& A, Vector& x, Vector& b, S& sp, const C& comm, double tolerance, int maxit, int verbosity, double prolongateFactor); -#endif template LinearSolverInterface::LinearSolverReport @@ -223,16 +219,10 @@ namespace Opm linsolver_prolongate_factor_, linsolver_smooth_steps_); break; case KAMG: -#if defined(HAS_DUNE_FAST_AMG) || DUNE_VERSION_NEWER(DUNE_ISTL, 2, 3) res = solveKAMG(opA, x, b, sp, comm, linsolver_residual_tolerance_, maxit, linsolver_verbosity_, linsolver_prolongate_factor_, linsolver_smooth_steps_); -#else - throw std::runtime_error("KAMG not supported with this version of DUNE"); -#endif break; case FastAMG: -#if defined(HAS_DUNE_FAST_AMG) || DUNE_VERSION_NEWER(DUNE_ISTL, 2, 3) - #if HAVE_MPI if(std::is_same >::value) { @@ -242,12 +232,6 @@ namespace Opm res = solveFastAMG(opA, x, b, sp, comm, linsolver_residual_tolerance_, maxit, linsolver_verbosity_, linsolver_prolongate_factor_); -#else - if(linsolver_verbosity_) - std::cerr<<"Fast AMG is not available; falling back to CG preconditioned with the normal one"< LinearSolverInterface::LinearSolverReport solveKAMG(O& opA, Vector& x, Vector& b, S& /* sp */, const C& /* comm */, double tolerance, int maxit, int verbosity, @@ -509,7 +492,6 @@ namespace Opm res.residual_reduction = result.reduction; return res; } -#endif template LinearSolverInterface::LinearSolverReport diff --git a/tests/DuneIstlTestHelpers.hpp b/tests/DuneIstlTestHelpers.hpp index b6838b9d1..2161dbeb7 100644 --- a/tests/DuneIstlTestHelpers.hpp +++ b/tests/DuneIstlTestHelpers.hpp @@ -30,13 +30,8 @@ #endif #include -#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) #include #include -#else -#include -#include -#endif #include #include diff --git a/tests/test_linearsolver.cpp b/tests/test_linearsolver.cpp index 130ebde90..d1151232d 100644 --- a/tests/test_linearsolver.cpp +++ b/tests/test_linearsolver.cpp @@ -163,7 +163,6 @@ BOOST_AUTO_TEST_CASE(BiCGILUTest) run_test(param); } -#if defined(HAS_DUNE_FAST_AMG) || DUNE_VERSION_NEWER(DUNE_ISTL, 2, 3) BOOST_AUTO_TEST_CASE(FastAMGTest) { Opm::ParameterGroup param; @@ -183,7 +182,6 @@ BOOST_AUTO_TEST_CASE(KAMGTest) run_test(param); } #endif -#endif #if HAVE_PETSC BOOST_AUTO_TEST_CASE(PETScTest)