diff --git a/dumux/linear/seqsolverbackend.hh b/dumux/linear/seqsolverbackend.hh index 27e80d17cfb2bc7feb4660e8589bb0a5cddca448..2b4edd80a3dfd24da4412ccdce57bbab17e7a705 100644 --- a/dumux/linear/seqsolverbackend.hh +++ b/dumux/linear/seqsolverbackend.hh @@ -1012,7 +1012,6 @@ class BlockDiagILU0BiCGSTABSolver : public LinearSolver public: using LinearSolver::LinearSolver; - // Solve saddle-point problem using a Schur complement based preconditioner template<class Matrix, class Vector> bool solve(const Matrix& M, Vector& x, const Vector& b) { @@ -1032,7 +1031,46 @@ public: } std::string name() const - { return "block-diagonal ILU0 preconditioned BiCGSTAB solver"; } + { return "block-diagonal ILU0-preconditioned BiCGSTAB solver"; } + +private: + Dune::InverseOperatorResult result_; +}; + +/*! + * \ingroup Linear + * \brief A simple ilu0 block diagonal preconditioned RestartedGMResSolver + * \note expects a system as a multi-type block-matrix + * | A B | + * | C D | + */ +class BlockDiagILU0RestartedGMResSolver : public LinearSolver +{ + +public: + using LinearSolver::LinearSolver; + + template<int precondBlockLevel = 2, class Matrix, class Vector> + bool solve(const Matrix& M, Vector& x, const Vector& b) + { + BlockDiagILU0Preconditioner<Matrix, Vector, Vector> preconditioner(M); + Dune::MatrixAdapter<Matrix, Vector, Vector> op(M); + static const int restartGMRes = getParamFromGroup<double>(this->paramGroup(), "LinearSolver.GMResRestart"); + Dune::RestartedGMResSolver<Vector> solver(op, preconditioner, this->residReduction(), restartGMRes, + this->maxIter(), this->verbosity()); + auto bTmp(b); + solver.apply(x, bTmp, result_); + + return result_.converged; + } + + const Dune::InverseOperatorResult& result() const + { + return result_; + } + + std::string name() const + { return "block-diagonal ILU0-preconditioned restarted GMRes solver"; } private: Dune::InverseOperatorResult result_; @@ -1237,7 +1275,7 @@ public: } std::string name() const - { return "block-diagonal AMG preconditioned BiCGSTAB solver"; } + { return "block-diagonal AMG-preconditioned BiCGSTAB solver"; } private: template<template<class M, std::size_t i> class Criterion, class Matrix, class Params, std::size_t... Is>