12#ifndef DUMUX_LINEAR_ISTL_SOLVERS_HH
13#define DUMUX_LINEAR_ISTL_SOLVERS_HH
19#include <dune/common/exceptions.hh>
20#include <dune/common/math.hh>
21#include <dune/common/shared_ptr.hh>
22#include <dune/common/version.hh>
23#include <dune/common/parallel/indexset.hh>
24#include <dune/common/parallel/mpicommunication.hh>
25#include <dune/grid/common/capabilities.hh>
26#include <dune/istl/solvers.hh>
27#include <dune/istl/solverfactory.hh>
28#include <dune/istl/owneroverlapcopy.hh>
29#include <dune/istl/scalarproducts.hh>
30#include <dune/istl/paamg/amg.hh>
31#include <dune/istl/paamg/pinfo.hh>
44#include <dune/istl/foreach.hh>
60template<
template<
class,
class,
class,
int>
class Preconditioner,
int blockLevel = 1>
64 template<
class OI,
class M>
65 auto operator() (OI opInfo,
const M& matrix,
const Dune::ParameterTree& config)
67#if DUNE_VERSION_LT(DUNE_ISTL,2,11)
68 using Matrix =
typename Dune::TypeListElement<0,
decltype(opInfo)>::type;
69 using Domain =
typename Dune::TypeListElement<1,
decltype(opInfo)>::type;
70 using Range =
typename Dune::TypeListElement<2,
decltype(opInfo)>::type;
72 using OpInfo = std::decay_t<
decltype(opInfo)>;
73 using Matrix =
typename OpInfo::matrix_type;
74 using Domain =
typename OpInfo::domain_type;
75 using Range =
typename OpInfo::range_type;
77 std::shared_ptr<Dune::Preconditioner<Domain, Range>> preconditioner
78 = std::make_shared<Preconditioner<Matrix, Domain, Range, blockLevel>>(matrix, config);
79 return preconditioner;
83template<
template<
class,
class,
class>
class Preconditioner>
86 template<
class OI,
class M>
87 auto operator() (OI opInfo,
const M& matrix,
const Dune::ParameterTree& config)
89#if DUNE_VERSION_LT(DUNE_ISTL,2,11)
90 using Matrix =
typename Dune::TypeListElement<0,
decltype(opInfo)>::type;
91 using Domain =
typename Dune::TypeListElement<1,
decltype(opInfo)>::type;
92 using Range =
typename Dune::TypeListElement<2,
decltype(opInfo)>::type;
94 using OpInfo = std::decay_t<
decltype(opInfo)>;
95 using Matrix =
typename OpInfo::matrix_type;
96 using Domain =
typename OpInfo::domain_type;
97 using Range =
typename OpInfo::range_type;
99 std::shared_ptr<Dune::Preconditioner<Domain, Range>> preconditioner
100 = std::make_shared<Preconditioner<Matrix, Domain, Range>>(matrix, config);
101 return preconditioner;
107template<
class M,
bool convert = false>
114template<
class V,
bool convert = false>
121template<
class LSTraits,
class LATraits,
bool convert,
bool parallel = LSTraits::canCommunicate>
124template<
class LSTraits,
class LATraits,
bool convert>
131 std::shared_ptr<typename LSTraits::template Sequential<M, V>::LinearOperator>,
132 std::shared_ptr<typename LSTraits::template ParallelOverlapping<M, V>::LinearOperator>,
133 std::shared_ptr<typename LSTraits::template ParallelNonoverlapping<M, V>::LinearOperator>
136 using type = std::variant<
137 std::shared_ptr<typename LSTraits::template Sequential<M, V>::LinearOperator>
142template<
class LSTraits,
class LATraits,
bool convert>
148 std::shared_ptr<typename LSTraits::template Sequential<M, V>::LinearOperator>
165 operator bool()
const {
return this->converged; }
173 class InverseOperator,
class PreconditionerFactory,
174 bool convertMultiTypeLATypes =
false>
180 using Scalar =
typename InverseOperator::real_type;
182 using ScalarProduct = Dune::ScalarProduct<typename InverseOperator::domain_type>;
184 static constexpr bool convertMultiTypeVectorAndMatrix
195 using Comm = Dune::OwnerOverlapCopyCommunication<Dune::bigunsignedint<96>,
int>;
199 using ParameterInitializer = std::variant<std::string, Dune::ParameterTree>;
207 if (Dune::MPIHelper::getCommunication().size() > 1)
208 DUNE_THROW(Dune::InvalidStateException,
"Using sequential constructor for parallel run. Use signature with gridView and dofMapper!");
210 initializeParameters_(params);
211 solverCategory_ = Dune::SolverCategory::sequential;
212 scalarProduct_ = std::make_shared<ScalarProduct>();
218 template <
class Gr
idView,
class DofMapper>
220 const DofMapper& dofMapper,
221 const ParameterInitializer& params =
"")
223 initializeParameters_(params, gridView.comm());
224 configureCommunication_(gridView, dofMapper);
231 template <
class Gr
idView,
class DofMapper>
233 std::shared_ptr<ScalarProduct> scalarProduct,
234 const GridView& gridView,
235 const DofMapper& dofMapper,
236 const ParameterInitializer& params =
"")
238 initializeParameters_(params, gridView.comm());
240 scalarProduct_ = scalarProduct;
241 communication_ = communication;
242 if constexpr (LinearSolverTraits::canCommunicate)
244 if (solverCategory_ != Dune::SolverCategory::sequential)
245 buildParallelHelper_(gridView, dofMapper, *communication_);
258 template <
class Gr
idView,
class DofMapper>
260 { configureCommunication_(gridView, dofMapper); }
266 {
return solveSequentialOrParallel_(A, x, b); }
273 linearOperator_ = makeParallelOrSequentialLinearOperator_(std::move(A));
274 solver_ = constructPreconditionedSolver_(linearOperator_);
282 {
setMatrix(Dune::stackobject_to_shared_ptr(A)); }
290 DUNE_THROW(Dune::InvalidStateException,
"Called solve(x, b) but no linear operator has been set");
292 return solveSequentialOrParallel_(x, b, *solver_);
298 Scalar
norm(
const XVector& x)
const
301 if constexpr (LinearSolverTraits::canCommunicate)
303 if (solverCategory_ == Dune::SolverCategory::nonoverlapping)
306 using GV =
typename LinearSolverTraits::GridView;
307 using DM =
typename LinearSolverTraits::DofMapper;
308 if constexpr (
requires { LinearSolverTraits::dofCodims; })
318 return scalarProduct_->norm(y);
322 if constexpr (convertMultiTypeVectorAndMatrix)
325 return scalarProduct_->norm(y);
328 return scalarProduct_->norm(x);
334 const std::string&
name()
const
344 params_[
"reduction"] = Fmt::format(
"{}", residReduction);
348 solver_ = constructPreconditionedSolver_(linearOperator_);
356 params_[
"maxit"] = std::to_string(maxIter);
360 solver_ = constructPreconditionedSolver_(linearOperator_);
372 initializeParameters_(params, communication_->communicator());
374 initializeParameters_(params);
376 initializeParameters_(params);
381 solver_ = constructPreconditionedSolver_(linearOperator_);
386 void initializeParameters_(
const ParameterInitializer& params)
388 if (std::holds_alternative<std::string>(params))
391 params_ = std::get<Dune::ParameterTree>(params);
394 template <
class Comm>
395 void initializeParameters_(
const ParameterInitializer& params,
const Comm& comm)
397 initializeParameters_(params);
400 if (comm.rank() != 0)
410 template <
class Gr
idView,
class DofMapper>
411 void configureCommunication_(
const GridView& gridView,
const DofMapper& dofMapper)
415 if constexpr (LinearSolverTraits::canCommunicate)
417 if (solverCategory_ == Dune::SolverCategory::sequential)
418 scalarProduct_ = std::make_shared<ScalarProduct>();
421 communication_ = std::make_shared<Comm>(gridView.comm(), solverCategory_);
422 scalarProduct_ = Dune::createScalarProduct<XVector>(*communication_, solverCategory_);
423 buildParallelHelper_(gridView, dofMapper, *communication_);
427 scalarProduct_ = std::make_shared<ScalarProduct>();
429 solverCategory_ = Dune::SolverCategory::sequential;
430 scalarProduct_ = std::make_shared<ScalarProduct>();
432 linearOperator_ = MatrixOperatorHolder{};
438 template <
class Gr
idView,
class DofMapper>
439 void buildParallelHelper_(
const GridView& gridView,
const DofMapper& dofMapper, Comm& comm)
441 parallelHelper_ = std::make_shared<ParallelISTLHelper<LinearSolverTraits>>(gridView, dofMapper);
442 parallelHelper_->createParallelIndexSet(comm);
446 MatrixOperatorHolder makeSequentialLinearOperator_(std::shared_ptr<Matrix> A)
448 using SequentialTraits =
typename LinearSolverTraits::template Sequential<MatrixForSolver, XVectorForSolver>;
449 if constexpr (convertMultiTypeVectorAndMatrix)
453 return std::make_shared<typename SequentialTraits::LinearOperator>(M);
457 return std::make_shared<typename SequentialTraits::LinearOperator>(A);
461 template<
class ParallelTraits>
462 MatrixOperatorHolder makeParallelLinearOperator_(std::shared_ptr<Matrix> A, ParallelTraits = {})
467 return std::make_shared<typename ParallelTraits::LinearOperator>(std::move(A), *communication_);
469 DUNE_THROW(Dune::InvalidStateException,
"Calling makeParallelLinearOperator for sequential run");
473 MatrixOperatorHolder makeParallelOrSequentialLinearOperator_(std::shared_ptr<Matrix> A)
475 return executeSequentialOrParallel_(
476 [&]{
return makeSequentialLinearOperator_(std::move(A)); },
477 [&](
auto traits){
return makeParallelLinearOperator_(std::move(A), traits); }
481 MatrixOperatorHolder makeSequentialLinearOperator_(Matrix& A)
482 {
return makeSequentialLinearOperator_(Dune::stackobject_to_shared_ptr<Matrix>(A)); }
484 MatrixOperatorHolder makeParallelOrSequentialLinearOperator_(Matrix& A)
485 {
return makeParallelOrSequentialLinearOperator_(Dune::stackobject_to_shared_ptr<Matrix>(A)); }
487 template<
class ParallelTraits>
488 MatrixOperatorHolder makeParallelLinearOperator_(Matrix& A, ParallelTraits = {})
489 {
return makeParallelLinearOperator_<ParallelTraits>(Dune::stackobject_to_shared_ptr<Matrix>(A)); }
491 IstlSolverResult solveSequential_(Matrix& A, XVector& x, BVector& b)
494 auto linearOperatorHolder = makeSequentialLinearOperator_(A);
495 auto solver = constructPreconditionedSolver_(linearOperatorHolder);
497 return solveSequential_(x, b, *solver);
500 IstlSolverResult solveSequential_(XVector& x, BVector& b, InverseOperator& solver)
const
502 Dune::InverseOperatorResult result;
503 if constexpr (convertMultiTypeVectorAndMatrix)
509 XVectorForSolver y(bTmp.size());
512 solver.apply(y, bTmp, result);
515 if (result.converged)
521 solver.apply(x, b, result);
527 IstlSolverResult solveSequentialOrParallel_(Matrix& A, XVector& x, BVector& b)
529 return executeSequentialOrParallel_(
530 [&]{
return solveSequential_(A, x, b); },
531 [&](
auto traits){
return solveParallel_(A, x, b, traits); }
535 IstlSolverResult solveSequentialOrParallel_(XVector& x, BVector& b, InverseOperator& solver)
const
537 return executeSequentialOrParallel_(
538 [&]{
return solveSequential_(x, b, solver); },
539 [&](
auto traits){
return solveParallel_(x, b, solver, traits); }
543 template<
class ParallelTraits>
544 IstlSolverResult solveParallel_(Matrix& A, XVector& x, BVector& b, ParallelTraits = {})
547 auto linearOperatorHolder = makeParallelLinearOperator_<ParallelTraits>(A);
548 auto solver = constructPreconditionedSolver_(linearOperatorHolder);
549 return solveParallel_<ParallelTraits>(x, b, *solver);
552 template<
class ParallelTraits>
553 IstlSolverResult solveParallel_(XVector& x, BVector& b, InverseOperator& solver, ParallelTraits = {})
const
560 Dune::InverseOperatorResult result;
561 solver.apply(x, b, result);
564 DUNE_THROW(Dune::InvalidStateException,
"Calling makeParallelLinearOperator for sequential run");
569 std::shared_ptr<InverseOperator> constructPreconditionedSolver_(MatrixOperatorHolder& ops)
571 return std::visit([&](
auto&& op)
573 using LinearOperator =
typename std::decay_t<
decltype(op)>::element_type;
574 const auto& params = params_.sub(
"preconditioner");
575 using Prec = Dune::Preconditioner<typename LinearOperator::domain_type, typename LinearOperator::range_type>;
576#if DUNE_VERSION_GTE(DUNE_ISTL,2,11)
577 using OpTraits = Dune::OperatorTraits<LinearOperator>;
578 std::shared_ptr<Prec> prec = PreconditionerFactory{}(OpTraits{}, op, params);
580 using TL = Dune::TypeList<typename LinearOperator::matrix_type, typename LinearOperator::domain_type, typename LinearOperator::range_type>;
581 std::shared_ptr<Prec> prec = PreconditionerFactory{}(TL{}, op, params);
585#if DUNE_VERSION_LT(DUNE_ISTL,2,11)
586 if (prec->category() != op->category() && prec->category() == Dune::SolverCategory::sequential)
587 prec = Dune::wrapPreconditioner4Parallel(prec, op);
589 if constexpr (OpTraits::isParallel)
591 using Comm =
typename OpTraits::comm_type;
592 const Comm& comm = OpTraits::getCommOrThrow(op);
593 if (op->category() == Dune::SolverCategory::overlapping && prec->category() == Dune::SolverCategory::sequential)
594 prec = std::make_shared<Dune::BlockPreconditioner<typename OpTraits::domain_type, typename OpTraits::range_type,Comm> >(prec, comm);
595 else if (op->category() == Dune::SolverCategory::nonoverlapping && prec->category() == Dune::SolverCategory::sequential)
596 prec = std::make_shared<Dune::NonoverlappingBlockPreconditioner<Comm, Prec> >(prec, comm);
600 return std::make_shared<InverseOperator>(op, scalarProduct_, prec, params_);
604 template<
class Seq,
class Par>
605 decltype(
auto) executeSequentialOrParallel_(Seq&& sequentialAction, Par&& parallelAction)
const
610 if constexpr (isMultiTypeBlockMatrix<Matrix>::value || !LinearSolverTraits::canCommunicate)
611 return sequentialAction();
614 switch (solverCategory_)
616 case Dune::SolverCategory::sequential:
617 return sequentialAction();
618 case Dune::SolverCategory::nonoverlapping:
619 using NOTraits =
typename LinearSolverTraits::template ParallelNonoverlapping<Matrix, XVector>;
620 return parallelAction(NOTraits{});
621 case Dune::SolverCategory::overlapping:
622 using OTraits =
typename LinearSolverTraits::template ParallelOverlapping<Matrix, XVector>;
623 return parallelAction(OTraits{});
624 default: DUNE_THROW(Dune::InvalidStateException,
"Unknown solver category");
628 return sequentialAction();
633 std::shared_ptr<const ParallelHelper> parallelHelper_;
634 std::shared_ptr<Comm> communication_;
637 Dune::SolverCategory::Category solverCategory_;
638 std::shared_ptr<ScalarProduct> scalarProduct_;
641 MatrixOperatorHolder linearOperator_;
643 std::shared_ptr<InverseOperator> solver_;
645 Dune::ParameterTree params_;
669template<
class LSTraits,
class LATraits>
672 Dune::BiCGSTABSolver<typename LATraits::SingleTypeVector>,
694template<
class LSTraits,
class LATraits>
697 Dune::RestartedGMResSolver<typename LATraits::SingleTypeVector>,
720template<
class LSTraits,
class LATraits>
723 Dune::BiCGSTABSolver<typename LATraits::Vector>,
743template<
class LSTraits,
class LATraits>
746 Dune::CGSolver<typename LATraits::Vector>,
763template<
class LSTraits,
class LATraits>
766 Dune::BiCGSTABSolver<typename LATraits::SingleTypeVector>,
784template<
class LSTraits,
class LATraits>
787 Dune::CGSolver<typename LATraits::SingleTypeVector>,
808template<
class LSTraits,
class LATraits>
811 Dune::RestartedGMResSolver<typename LATraits::SingleTypeVector>,
831template<
class LSTraits,
class LATraits>
834 Dune::BiCGSTABSolver<typename LATraits::Vector>,
846template<
class LSTraits,
class LATraits,
template<
class M>
class Solver,
847 bool convertMultiTypeVectorAndMatrix = isMultiTypeBlockVector<typename LATraits::Vector>::value>
850 using Matrix =
typename LATraits::Matrix;
851 using XVector =
typename LATraits::Vector;
852 using BVector =
typename LATraits::Vector;
857 using InverseOperator = Dune::InverseOperator<XVectorForSolver, BVectorForSolver>;
866 return solve_(A, x, b);
875 DUNE_THROW(Dune::InvalidStateException,
"Called solve(x, b) but no linear operator has been set");
877 return solve_(x, b, *solver_);
885 if constexpr (convertMultiTypeVectorAndMatrix)
890 solver_ = std::make_shared<Solver<MatrixForSolver>>(*matrix_);
898 {
setMatrix(Dune::stackobject_to_shared_ptr(A)); }
905 return "Direct solver";
912 if constexpr (convertMultiTypeVectorAndMatrix)
915 Solver<MatrixForSolver> solver(AA, this->
verbosity() > 0);
916 return solve_(x, b, solver);
920 Solver<MatrixForSolver> solver(A, this->
verbosity() > 0);
921 return solve_(x, b, solver);
925 IstlSolverResult solve_(XVector& x,
const BVector& b, InverseOperator& solver)
const
927 Dune::InverseOperatorResult result;
929 if constexpr (convertMultiTypeVectorAndMatrix)
932 XVectorForSolver xx(bb.size());
933 solver.apply(xx, bb, result);
934 checkResult_(xx, result);
935 if (result.converged)
941 BVectorForSolver bTmp(b);
942 solver.apply(x, bTmp, result);
943 checkResult_(x, result);
949 void checkResult_(XVectorForSolver& x, Dune::InverseOperatorResult& result)
const
951 flatVectorForEach(x, [&](
auto&& entry, std::size_t){
952 if (Dune::isNaN(entry) || Dune::isInf(entry))
953 result.converged =
false;
958 std::shared_ptr<MatrixForSolver> matrix_;
960 std::shared_ptr<InverseOperator> solver_;
966#include <dune/istl/superlu.hh>
978template<
class LSTraits,
class LATraits>
986#include <dune/istl/umfpack.hh>
998template<
class LSTraits,
class LATraits>
Direct dune-istl linear solvers.
Definition istlsolvers.hh:849
void setMatrix(std::shared_ptr< Matrix > A)
Set the matrix A of the linear system Ax = b for reuse.
Definition istlsolvers.hh:883
IstlSolverResult solve(const Matrix &A, XVector &x, const BVector &b)
Solve the linear system Ax = b.
Definition istlsolvers.hh:864
std::string name() const
name of the linear solver
Definition istlsolvers.hh:903
void setMatrix(Matrix &A)
Set the matrix A of the linear system Ax = b for reuse.
Definition istlsolvers.hh:897
LinearSolver(const std::string ¶mGroup="")
Construct the solver.
Definition solver.hh:43
IstlSolverResult solve(XVector &x, const BVector &b)
Solve the linear system Ax = b using the matrix set with setMatrix.
Definition istlsolvers.hh:872
Standard dune-istl iterative linear solvers.
Definition istlsolvers.hh:176
IstlIterativeLinearSolver(const ParameterInitializer ¶ms="")
Constructor for sequential solvers.
Definition istlsolvers.hh:205
void setMatrix(Matrix &A)
Set the matrix A of the linear system Ax = b for reuse.
Definition istlsolvers.hh:281
void setResidualReduction(double residReduction)
Set the residual reduction tolerance.
Definition istlsolvers.hh:342
void setMaxIter(std::size_t maxIter)
Set the maximum number of linear solver iterations.
Definition istlsolvers.hh:354
IstlIterativeLinearSolver(const GridView &gridView, const DofMapper &dofMapper, const ParameterInitializer ¶ms="")
Constructor for parallel and sequential solvers.
Definition istlsolvers.hh:219
const std::string & name() const
The name of the linear solver.
Definition istlsolvers.hh:334
void setParams(const ParameterInitializer ¶ms)
Set the linear solver parameters.
Definition istlsolvers.hh:368
IstlSolverResult solve(Matrix &A, XVector &x, BVector &b)
Solve the linear system Ax = b.
Definition istlsolvers.hh:265
void updateAfterGridAdaption(const GridView &gridView, const DofMapper &dofMapper)
Update the solver after the grid and its dof distribution changed, e.g. after grid adaption or dynami...
Definition istlsolvers.hh:259
void setMatrix(std::shared_ptr< Matrix > A)
Set the matrix A of the linear system Ax = b for reuse.
Definition istlsolvers.hh:271
IstlSolverResult solve(XVector &x, BVector &b) const
Solve the linear system Ax = b where A has been set with setMatrix.
Definition istlsolvers.hh:287
IstlIterativeLinearSolver(std::shared_ptr< Comm > communication, std::shared_ptr< ScalarProduct > scalarProduct, const GridView &gridView, const DofMapper &dofMapper, const ParameterInitializer ¶ms="")
Constructor with custom scalar product and communication.
Definition istlsolvers.hh:232
Scalar norm(const XVector &x) const
Compute the 2-norm of vector x.
Definition istlsolvers.hh:298
Definition istlsolvers.hh:62
auto operator()(OI opInfo, const M &matrix, const Dune::ParameterTree &config)
Definition istlsolvers.hh:65
Definition istlsolvers.hh:85
LinearSolver(const std::string ¶mGroup="")
Construct the solver.
Definition solver.hh:43
int verbosity() const
the verbosity level
Definition solver.hh:82
static void disableVerbosity(Dune::ParameterTree ¶ms)
Definition linearsolverparameters.hh:97
static Dune::ParameterTree createParameterTree(const std::string ¶mGroup="")
Create a tree containing parameters required for the linear solvers and precondioners of the Dune IST...
Definition linearsolverparameters.hh:47
static auto multiTypeToBCRSMatrix(const MultiTypeBlockMatrix &A)
Converts the matrix to a type the IterativeSolverBackend can handle.
Definition matrixconverter.hh:47
Definition parallelhelpers.hh:579
void makeNonOverlappingConsistent(Dune::BlockVector< Block, Alloc > &v, const std::bitset< numCodims > &activeCodims) const
Make a vector consistent for non-overlapping domain decomposition methods.
Definition parallelhelpers.hh:587
Definition parallelhelpers.hh:521
void makeNonOverlappingConsistent(Dune::BlockVector< Block, Alloc > &v) const
Make a vector consistent for non-overlapping domain decomposition methods.
Definition parallelhelpers.hh:529
static void retrieveValues(MultiTypeBlockVector &x, const BlockVector &y)
Copies the entries of a Dune::BlockVector to a Dune::MultiTypeBlockVector.
Definition matrixconverter.hh:232
static auto multiTypeToBlockVector(const MultiTypeBlockVector &b)
Converts a Dune::MultiTypeBlockVector to a plain 1x1 Dune::BlockVector.
Definition matrixconverter.hh:206
Detail::IstlIterativeLinearSolver< LSTraits, LATraits, Dune::BiCGSTABSolver< typename LATraits::Vector >, Detail::IstlSolvers::IstlDefaultBlockLevelPreconditionerFactory< Dumux::SeqUzawa > > UzawaBiCGSTABIstlSolver
An Uzawa preconditioned BiCGSTAB solver using dune-istl.
Definition istlsolvers.hh:832
constexpr std::size_t preconditionerBlockLevel() noexcept
Returns the block level for the preconditioner for a given matrix.
Definition istlsolvers.hh:55
Detail::IstlIterativeLinearSolver< LSTraits, LATraits, Dune::RestartedGMResSolver< typename LATraits::SingleTypeVector >, Detail::IstlSolvers::IstlDefaultBlockLevelPreconditionerFactory< Dune::SeqILU >, true > ILURestartedGMResIstlSolver
An ILU preconditioned GMres solver using dune-istl.
Definition istlsolvers.hh:695
Detail::IstlIterativeLinearSolver< LSTraits, LATraits, Dune::BiCGSTABSolver< typename LATraits::Vector >, Detail::IstlSolvers::IstlDefaultBlockLevelPreconditionerFactory< Dune::SeqSSOR > > SSORBiCGSTABIstlSolver
An SSOR-preconditioned BiCGSTAB solver using dune-istl.
Definition istlsolvers.hh:721
Detail::IstlIterativeLinearSolver< LSTraits, LATraits, Dune::RestartedGMResSolver< typename LATraits::SingleTypeVector >, Detail::IstlSolvers::IstlAmgPreconditionerFactory, true > AMGRestartedGMResIstlSolver
An AMG preconditioned GMRes solver using dune-istl.
Definition istlsolvers.hh:809
Detail::IstlIterativeLinearSolver< LSTraits, LATraits, Dune::BiCGSTABSolver< typename LATraits::SingleTypeVector >, Detail::IstlSolvers::IstlDefaultBlockLevelPreconditionerFactory< Dune::SeqILU >, true > ILUBiCGSTABIstlSolver
An ILU preconditioned BiCGSTAB solver using dune-istl.
Definition istlsolvers.hh:670
Detail::IstlIterativeLinearSolver< LSTraits, LATraits, Dune::BiCGSTABSolver< typename LATraits::SingleTypeVector >, Detail::IstlSolvers::IstlAmgPreconditionerFactory, true > AMGBiCGSTABIstlSolver
An AMG preconditioned BiCGSTAB solver using dune-istl.
Definition istlsolvers.hh:764
Detail::ParallelISTLHelperImpl< LinearSolverTraits, LinearSolverTraits::canCommunicate > ParallelISTLHelper
A parallel helper class providing a parallel decomposition of all degrees of freedom.
Definition parallelhelpers.hh:514
Detail::IstlIterativeLinearSolver< LSTraits, LATraits, Dune::CGSolver< typename LATraits::SingleTypeVector >, Detail::IstlSolvers::IstlAmgPreconditionerFactory, true > AMGCGIstlSolver
An AMG preconditioned CG solver using dune-istl.
Definition istlsolvers.hh:785
Detail::IstlIterativeLinearSolver< LSTraits, LATraits, Dune::CGSolver< typename LATraits::Vector >, Detail::IstlSolvers::IstlDefaultBlockLevelPreconditionerFactory< Dune::SeqSSOR > > SSORCGIstlSolver
An SSOR-preconditioned CG solver using dune-istl.
Definition istlsolvers.hh:744
Define traits for linear algebra backends.
Generates a parameter tree required for the linear solvers and precondioners of the Dune ISTL.
Type traits to be used with matrix types.
A helper class that converts a Dune::MultiTypeBlockMatrix into a plain Dune::BCRSMatrix.
Definition istlsolvers.hh:46
Dune::AMGCreator IstlAmgPreconditionerFactory
Definition istlsolvers.hh:105
Definition linearalgebratraits.hh:21
Definition cvfelocalresidual.hh:25
Dune::SolverCategory::Category solverCategory(const GridView &gridView)
Definition solvercategory.hh:20
void prepareMatrixParallel(Matrix &A, ParallelHelper &pHelper)
Prepare a matrix for parallel solvers.
Definition parallelhelpers.hh:1410
LinearSolverTraitsImpl< GridGeometry, typename GridGeometry::DiscretizationMethod > LinearSolverTraits
The type traits required for using the IstlFactoryBackend.
Definition linearsolvertraits.hh:39
void prepareVectorParallel(Vector &b, ParallelHelper &pHelper)
Prepare a vector for parallel solvers.
Definition parallelhelpers.hh:1441
Provides a helper class for nonoverlapping decomposition.
Dumux preconditioners for iterative solvers.
Base class for linear solvers.
Definition istlsolvers.hh:157
IstlSolverResult(IstlSolverResult &&)=default
IstlSolverResult(const Dune::InverseOperatorResult &o)
Definition istlsolvers.hh:162
IstlSolverResult(Dune::InverseOperatorResult &&o)
Definition istlsolvers.hh:163
IstlSolverResult()=default
IstlSolverResult(const IstlSolverResult &)=default
std::decay_t< decltype(MatrixConverter< M >::multiTypeToBCRSMatrix(std::declval< M >()))> type
Definition istlsolvers.hh:112
Definition istlsolvers.hh:108
M type
Definition istlsolvers.hh:108
typename VectorForSolver< typename LATraits::Vector, convert >::type V
Definition istlsolvers.hh:146
std::variant< std::shared_ptr< typename LSTraits::template Sequential< M, V >::LinearOperator > > type
Definition istlsolvers.hh:147
typename MatrixForSolver< typename LATraits::Matrix, convert >::type M
Definition istlsolvers.hh:145
typename VectorForSolver< typename LATraits::Vector, convert >::type V
Definition istlsolvers.hh:128
std::variant< std::shared_ptr< typename LSTraits::template Sequential< M, V >::LinearOperator >, std::shared_ptr< typename LSTraits::template ParallelOverlapping< M, V >::LinearOperator >, std::shared_ptr< typename LSTraits::template ParallelNonoverlapping< M, V >::LinearOperator > > type
Definition istlsolvers.hh:130
typename MatrixForSolver< typename LATraits::Matrix, convert >::type M
Definition istlsolvers.hh:127
Definition istlsolvers.hh:122
std::decay_t< decltype(VectorConverter< V >::multiTypeToBlockVector(std::declval< V >()))> type
Definition istlsolvers.hh:119
Definition istlsolvers.hh:115
V type
Definition istlsolvers.hh:115
Definition linearalgebratraits.hh:51
V Vector
Definition linearalgebratraits.hh:53
M Matrix
Definition linearalgebratraits.hh:52
Helper type to determine whether a given type is a Dune::MultiTypeBlockMatrix.
Definition matrix.hh:37
Helper type to determine whether a given type is a Dune::MultiTypeBlockVector.
Definition vector.hh:22
Type traits to be used with vector types.