Commit b1160723 authored by Timo Koch's avatar Timo Koch
Browse files

[istl] Parallel solver factory only available from Dune 2.8 onwards

parent f89cee8e
......@@ -71,7 +71,7 @@ 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)
#if DUNE_VERSION_GTE(DUNE_ISTL,2,8)
auto& pfac = Dune::PreconditionerFactory<LinearOperator,X,Y>::instance();
#else
auto& pfac = Dune::PreconditionerFactory<M,X,Y>::instance();
......@@ -96,7 +96,7 @@ void initSolverFactories()
if constexpr (isMultiTypeBlockMatrix<Matrix>::value)
initSolverFactoriesForMultiTypeBlockMatrix<LinearOperator>();
else
#if DUNE_VERSION_GT(DUNE_ISTL,2,7)
#if DUNE_VERSION_GTE(DUNE_ISTL,2,8)
Dune::initSolverFactories<LinearOperator>();
#else
{
......@@ -112,7 +112,7 @@ void initSolverFactories()
* \brief A linear solver using the dune-istl solver factory
* to choose the solver and preconditioner at runtime.
* \note the solvers are configured via the input file
* \note requires Dune version 2.7.1 or newer
* \note requires Dune version 2.7.1 or newer and 2.8 for parallel solvers
*/
template <class LinearSolverTraits>
class IstlSolverFactoryBackend : public LinearSolver
......@@ -241,7 +241,7 @@ private:
template<class ParallelTraits, class Matrix, class Vector>
void solveParallel_(Matrix& A, Vector& x, Vector& b)
{
#if DUNE_VERSION_GT_REV(DUNE_ISTL,2,7,0)
#if DUNE_VERSION_GTE(DUNE_ISTL,2,8)
using Comm = typename ParallelTraits::Comm;
using LinearOperator = typename ParallelTraits::LinearOperator;
using ScalarProduct = typename ParallelTraits::ScalarProduct;
......
......@@ -107,7 +107,7 @@ public:
* \param mat The matrix to operate on.
* \param params Collection of paramters.
*/
#if DUNE_VERSION_GT(DUNE_ISTL,2,7)
#if DUNE_VERSION_GTE(DUNE_ISTL,2,8)
SeqUzawa(const std::shared_ptr<const Dune::AssembledLinearOperator<M,X,Y>>& op, const Dune::ParameterTree& params)
: matrix_(op->getmat())
#else
......
......@@ -161,7 +161,7 @@ public:
using MatrixAdapter = Dune::MatrixAdapter<Matrix, Vector, Vector>;
const auto linearOperator = std::make_shared<MatrixAdapter>(A);
#if DUNE_VERSION_GT(DUNE_ISTL,2,7)
#if DUNE_VERSION_GTE(DUNE_ISTL,2,8)
auto precond = std::make_shared<Preconditioner>(linearOperator, params.sub("preconditioner"));
#else
auto precond = std::make_shared<Preconditioner>(A, params.sub("preconditioner"));
......
......@@ -42,7 +42,7 @@
#include <dumux/linear/linearsolvertraits.hh>
#if DUNE_VERSION_GT_REV(DUNE_ISTL,2,7,0)
#if DUNE_VERSION_GTE(DUNE_ISTL,2,8)
#include <dumux/linear/istlsolverfactorybackend.hh>
#else
#include <dumux/linear/amgbackend.hh>
......@@ -130,7 +130,7 @@ int main(int argc, char** argv)
auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld);
// the linear solver
#if DUNE_VERSION_GT_REV(DUNE_ISTL,2,7,0)
#if DUNE_VERSION_GTE(DUNE_ISTL,2,8)
using LinearSolver = IstlSolverFactoryBackend<LinearSolverTraits<GridGeometry>>;
#else
using LinearSolver = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>;
......
......@@ -38,7 +38,7 @@
#include <dumux/common/dumuxmessage.hh>
#include <dumux/linear/linearsolvertraits.hh>
#if DUNE_VERSION_GT_REV(DUNE_ISTL,2,7,0)
#if DUNE_VERSION_GTE(DUNE_ISTL,2,8)
#include <dumux/linear/istlsolverfactorybackend.hh>
#include <dumux/linear/linearsolvertraits.hh>
#else
......@@ -148,7 +148,7 @@ int main(int argc, char** argv)
auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld);
// the linear solver
#if DUNE_VERSION_GT_REV(DUNE_ISTL,2,7,0)
#if DUNE_VERSION_GTE(DUNE_ISTL,2,8)
using LinearSolver = IstlSolverFactoryBackend<LinearSolverTraits<GridGeometry>>;
#else
using LinearSolver = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment