diff --git a/dumux/linear/seqsolverbackend.hh b/dumux/linear/seqsolverbackend.hh index 659b893c9675318c0247cee5b2ff185bf230a692..867b528f7dacddae60acdde88ef16d74aada110f 100644 --- a/dumux/linear/seqsolverbackend.hh +++ b/dumux/linear/seqsolverbackend.hh @@ -30,6 +30,7 @@ #include <dune/istl/solvers.hh> #include <dune/istl/superlu.hh> #include <dune/istl/umfpack.hh> +#include <dune/common/version.hh> #include <dumux/common/parameters.hh> #include <dumux/common/properties.hh> @@ -177,7 +178,11 @@ public: template<int precondBlockLevel = 1, class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { +#if DUNE_VERSION_NEWER(DUNE_ISTL,2,6) + using Preconditioner = Dune::SeqILU<Matrix, Vector, Vector, precondBlockLevel>; +#else using Preconditioner = Dune::SeqILUn<Matrix, Vector, Vector, precondBlockLevel>; +#endif using Solver = Dune::BiCGSTABSolver<Vector>; return IterativePreconditionedSolverImpl::template solve<Preconditioner, Solver>(*this, A, x, b, this->paramGroup()); @@ -365,7 +370,11 @@ public: template<int precondBlockLevel = 1, class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { +#if DUNE_VERSION_NEWER(DUNE_ISTL,2,6) + using Preconditioner = Dune::SeqILU<Matrix, Vector, Vector, precondBlockLevel>; +#else using Preconditioner = Dune::SeqILUn<Matrix, Vector, Vector, precondBlockLevel>; +#endif using Solver = Dune::CGSolver<Vector>; return IterativePreconditionedSolverImpl::template solve<Preconditioner, Solver>(*this, A, x, b, this->paramGroup()); @@ -587,7 +596,11 @@ public: template<int precondBlockLevel = 1, class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { +#if DUNE_VERSION_NEWER(DUNE_ISTL,2,6) + using Preconditioner = Dune::SeqILU<Matrix, Vector, Vector, precondBlockLevel>; +#else using Preconditioner = Dune::SeqILU0<Matrix, Vector, Vector, precondBlockLevel>; +#endif using Solver = Dune::BiCGSTABSolver<Vector>; return IterativePreconditionedSolverImpl::template solveWithILU0Prec<Preconditioner, Solver>(*this, A, x, b, this->paramGroup()); @@ -623,7 +636,11 @@ public: template<int precondBlockLevel = 1, class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { +#if DUNE_VERSION_NEWER(DUNE_ISTL,2,6) + using Preconditioner = Dune::SeqILU<Matrix, Vector, Vector, precondBlockLevel>; +#else using Preconditioner = Dune::SeqILU0<Matrix, Vector, Vector, precondBlockLevel>; +#endif using Solver = Dune::CGSolver<Vector>; return IterativePreconditionedSolverImpl::template solveWithILU0Prec<Preconditioner, Solver>(*this, A, x, b, this->paramGroup()); @@ -660,7 +677,11 @@ public: template<int precondBlockLevel = 1, class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { +#if DUNE_VERSION_NEWER(DUNE_ISTL,2,6) + using Preconditioner = Dune::SeqILU<Matrix, Vector, Vector, precondBlockLevel>; +#else using Preconditioner = Dune::SeqILU0<Matrix, Vector, Vector, precondBlockLevel>; +#endif using Solver = Dune::RestartedGMResSolver<Vector>; return IterativePreconditionedSolverImpl::template solveWithILU0PrecGMRes<Preconditioner, Solver>(*this, A, x, b, this->paramGroup()); @@ -698,7 +719,11 @@ public: template<int precondBlockLevel = 1, class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { +#if DUNE_VERSION_NEWER(DUNE_ISTL,2,6) + using Preconditioner = Dune::SeqILU<Matrix, Vector, Vector, precondBlockLevel>; +#else using Preconditioner = Dune::SeqILUn<Matrix, Vector, Vector, precondBlockLevel>; +#endif using Solver = Dune::RestartedGMResSolver<Vector>; return IterativePreconditionedSolverImpl::template solveWithGMRes<Preconditioner, Solver>(*this, A, x, b, this->paramGroup());