12#ifndef DUMUX_LINEAR_ISTL_SOLVERS_HH
13#define DUMUX_LINEAR_ISTL_SOLVERS_HH
19#include <dune/common/exceptions.hh>
20#include <dune/common/shared_ptr.hh>
21#include <dune/common/version.hh>
22#include <dune/common/parallel/indexset.hh>
23#include <dune/common/parallel/mpicommunication.hh>
24#include <dune/grid/common/capabilities.hh>
25#include <dune/istl/solvers.hh>
26#include <dune/istl/solverfactory.hh>
27#include <dune/istl/owneroverlapcopy.hh>
28#include <dune/istl/scalarproducts.hh>
29#include <dune/istl/paamg/amg.hh>
30#include <dune/istl/paamg/pinfo.hh>
43#include <dune/istl/foreach.hh>
59template<
template<
class,
class,
class,
int>
class Preconditioner,
int blockLevel = 1>
63 template<
class OI,
class M>
64 auto operator() (OI opInfo,
const M& matrix,
const Dune::ParameterTree& config)
66#if DUNE_VERSION_LT(DUNE_ISTL,2,11)
67 using Matrix =
typename Dune::TypeListElement<0,
decltype(opInfo)>::type;
68 using Domain =
typename Dune::TypeListElement<1,
decltype(opInfo)>::type;
69 using Range =
typename Dune::TypeListElement<2,
decltype(opInfo)>::type;
71 using OpInfo = std::decay_t<
decltype(opInfo)>;
72 using Matrix =
typename OpInfo::matrix_type;
73 using Domain =
typename OpInfo::domain_type;
74 using Range =
typename OpInfo::range_type;
76 std::shared_ptr<Dune::Preconditioner<Domain, Range>> preconditioner
77 = std::make_shared<Preconditioner<Matrix, Domain, Range, blockLevel>>(matrix, config);
78 return preconditioner;
82template<
template<
class,
class,
class>
class Preconditioner>
85 template<
class OI,
class M>
86 auto operator() (OI opInfo,
const M& matrix,
const Dune::ParameterTree& config)
88#if DUNE_VERSION_LT(DUNE_ISTL,2,11)
89 using Matrix =
typename Dune::TypeListElement<0,
decltype(opInfo)>::type;
90 using Domain =
typename Dune::TypeListElement<1,
decltype(opInfo)>::type;
91 using Range =
typename Dune::TypeListElement<2,
decltype(opInfo)>::type;
93 using OpInfo = std::decay_t<
decltype(opInfo)>;
94 using Matrix =
typename OpInfo::matrix_type;
95 using Domain =
typename OpInfo::domain_type;
96 using Range =
typename OpInfo::range_type;
98 std::shared_ptr<Dune::Preconditioner<Domain, Range>> preconditioner
99 = std::make_shared<Preconditioner<Matrix, Domain, Range>>(matrix, config);
100 return preconditioner;
106template<
class M,
bool convert = false>
113template<
class V,
bool convert = false>
120template<
class LSTraits,
class LATraits,
bool convert,
bool parallel = LSTraits::canCommunicate>
123template<
class LSTraits,
class LATraits,
bool convert>
130 std::shared_ptr<typename LSTraits::template Sequential<M, V>::LinearOperator>,
131 std::shared_ptr<typename LSTraits::template ParallelOverlapping<M, V>::LinearOperator>,
132 std::shared_ptr<typename LSTraits::template ParallelNonoverlapping<M, V>::LinearOperator>
135 using type = std::variant<
136 std::shared_ptr<typename LSTraits::template Sequential<M, V>::LinearOperator>
141template<
class LSTraits,
class LATraits,
bool convert>
147 std::shared_ptr<typename LSTraits::template Sequential<M, V>::LinearOperator>
164 operator bool()
const {
return this->converged; }
172 class InverseOperator,
class PreconditionerFactory,
173 bool convertMultiTypeLATypes =
false>
179 using Scalar =
typename InverseOperator::real_type;
181 using ScalarProduct = Dune::ScalarProduct<typename InverseOperator::domain_type>;
183 static constexpr bool convertMultiTypeVectorAndMatrix
194 using Comm = Dune::OwnerOverlapCopyCommunication<Dune::bigunsignedint<96>,
int>;
198 using ParameterInitializer = std::variant<std::string, Dune::ParameterTree>;
206 if (Dune::MPIHelper::getCommunication().size() > 1)
207 DUNE_THROW(Dune::InvalidStateException,
"Using sequential constructor for parallel run. Use signature with gridView and dofMapper!");
209 initializeParameters_(params);
210 solverCategory_ = Dune::SolverCategory::sequential;
211 scalarProduct_ = std::make_shared<ScalarProduct>();
217 template <
class Gr
idView,
class DofMapper>
219 const DofMapper& dofMapper,
220 const ParameterInitializer& params =
"")
222 initializeParameters_(params, gridView.comm());
223 configureCommunication_(gridView, dofMapper);
230 template <
class Gr
idView,
class DofMapper>
232 std::shared_ptr<ScalarProduct> scalarProduct,
233 const GridView& gridView,
234 const DofMapper& dofMapper,
235 const ParameterInitializer& params =
"")
237 initializeParameters_(params, gridView.comm());
239 scalarProduct_ = scalarProduct;
240 communication_ = communication;
241 if constexpr (LinearSolverTraits::canCommunicate)
243 if (solverCategory_ != Dune::SolverCategory::sequential)
244 buildParallelHelper_(gridView, dofMapper, *communication_);
257 template <
class Gr
idView,
class DofMapper>
259 { configureCommunication_(gridView, dofMapper); }
265 {
return solveSequentialOrParallel_(A, x, b); }
272 linearOperator_ = makeParallelOrSequentialLinearOperator_(std::move(A));
273 solver_ = constructPreconditionedSolver_(linearOperator_);
281 {
setMatrix(Dune::stackobject_to_shared_ptr(A)); }
289 DUNE_THROW(Dune::InvalidStateException,
"Called solve(x, b) but no linear operator has been set");
291 return solveSequentialOrParallel_(x, b, *solver_);
297 Scalar
norm(
const XVector& x)
const
300 if constexpr (LinearSolverTraits::canCommunicate)
302 if (solverCategory_ == Dune::SolverCategory::nonoverlapping)
305 using GV =
typename LinearSolverTraits::GridView;
306 using DM =
typename LinearSolverTraits::DofMapper;
307 if constexpr (
requires { LinearSolverTraits::dofCodims; })
317 return scalarProduct_->norm(y);
321 if constexpr (convertMultiTypeVectorAndMatrix)
324 return scalarProduct_->norm(y);
327 return scalarProduct_->norm(x);
333 const std::string&
name()
const
343 params_[
"reduction"] = Fmt::format(
"{}", residReduction);
347 solver_ = constructPreconditionedSolver_(linearOperator_);
355 params_[
"maxit"] = std::to_string(maxIter);
359 solver_ = constructPreconditionedSolver_(linearOperator_);
371 initializeParameters_(params, communication_->communicator());
373 initializeParameters_(params);
375 initializeParameters_(params);
380 solver_ = constructPreconditionedSolver_(linearOperator_);
385 void initializeParameters_(
const ParameterInitializer& params)
387 if (std::holds_alternative<std::string>(params))
390 params_ = std::get<Dune::ParameterTree>(params);
393 template <
class Comm>
394 void initializeParameters_(
const ParameterInitializer& params,
const Comm& comm)
396 initializeParameters_(params);
399 if (comm.rank() != 0)
409 template <
class Gr
idView,
class DofMapper>
410 void configureCommunication_(
const GridView& gridView,
const DofMapper& dofMapper)
414 if constexpr (LinearSolverTraits::canCommunicate)
416 if (solverCategory_ == Dune::SolverCategory::sequential)
417 scalarProduct_ = std::make_shared<ScalarProduct>();
420 communication_ = std::make_shared<Comm>(gridView.comm(), solverCategory_);
421 scalarProduct_ = Dune::createScalarProduct<XVector>(*communication_, solverCategory_);
422 buildParallelHelper_(gridView, dofMapper, *communication_);
426 scalarProduct_ = std::make_shared<ScalarProduct>();
428 solverCategory_ = Dune::SolverCategory::sequential;
429 scalarProduct_ = std::make_shared<ScalarProduct>();
431 linearOperator_ = MatrixOperatorHolder{};
437 template <
class Gr
idView,
class DofMapper>
438 void buildParallelHelper_(
const GridView& gridView,
const DofMapper& dofMapper, Comm& comm)
440 parallelHelper_ = std::make_shared<ParallelISTLHelper<LinearSolverTraits>>(gridView, dofMapper);
441 parallelHelper_->createParallelIndexSet(comm);
445 MatrixOperatorHolder makeSequentialLinearOperator_(std::shared_ptr<Matrix> A)
447 using SequentialTraits =
typename LinearSolverTraits::template Sequential<MatrixForSolver, XVectorForSolver>;
448 if constexpr (convertMultiTypeVectorAndMatrix)
452 return std::make_shared<typename SequentialTraits::LinearOperator>(M);
456 return std::make_shared<typename SequentialTraits::LinearOperator>(A);
460 template<
class ParallelTraits>
461 MatrixOperatorHolder makeParallelLinearOperator_(std::shared_ptr<Matrix> A, ParallelTraits = {})
466 return std::make_shared<typename ParallelTraits::LinearOperator>(std::move(A), *communication_);
468 DUNE_THROW(Dune::InvalidStateException,
"Calling makeParallelLinearOperator for sequential run");
472 MatrixOperatorHolder makeParallelOrSequentialLinearOperator_(std::shared_ptr<Matrix> A)
474 return executeSequentialOrParallel_(
475 [&]{
return makeSequentialLinearOperator_(std::move(A)); },
476 [&](
auto traits){
return makeParallelLinearOperator_(std::move(A), traits); }
480 MatrixOperatorHolder makeSequentialLinearOperator_(Matrix& A)
481 {
return makeSequentialLinearOperator_(Dune::stackobject_to_shared_ptr<Matrix>(A)); }
483 MatrixOperatorHolder makeParallelOrSequentialLinearOperator_(Matrix& A)
484 {
return makeParallelOrSequentialLinearOperator_(Dune::stackobject_to_shared_ptr<Matrix>(A)); }
486 template<
class ParallelTraits>
487 MatrixOperatorHolder makeParallelLinearOperator_(Matrix& A, ParallelTraits = {})
488 {
return makeParallelLinearOperator_<ParallelTraits>(Dune::stackobject_to_shared_ptr<Matrix>(A)); }
490 IstlSolverResult solveSequential_(Matrix& A, XVector& x, BVector& b)
493 auto linearOperatorHolder = makeSequentialLinearOperator_(A);
494 auto solver = constructPreconditionedSolver_(linearOperatorHolder);
496 return solveSequential_(x, b, *solver);
499 IstlSolverResult solveSequential_(XVector& x, BVector& b, InverseOperator& solver)
const
501 Dune::InverseOperatorResult result;
502 if constexpr (convertMultiTypeVectorAndMatrix)
508 XVectorForSolver y(bTmp.size());
511 solver.apply(y, bTmp, result);
514 if (result.converged)
520 solver.apply(x, b, result);
526 IstlSolverResult solveSequentialOrParallel_(Matrix& A, XVector& x, BVector& b)
528 return executeSequentialOrParallel_(
529 [&]{
return solveSequential_(A, x, b); },
530 [&](
auto traits){
return solveParallel_(A, x, b, traits); }
534 IstlSolverResult solveSequentialOrParallel_(XVector& x, BVector& b, InverseOperator& solver)
const
536 return executeSequentialOrParallel_(
537 [&]{
return solveSequential_(x, b, solver); },
538 [&](
auto traits){
return solveParallel_(x, b, solver, traits); }
542 template<
class ParallelTraits>
543 IstlSolverResult solveParallel_(Matrix& A, XVector& x, BVector& b, ParallelTraits = {})
546 auto linearOperatorHolder = makeParallelLinearOperator_<ParallelTraits>(A);
547 auto solver = constructPreconditionedSolver_(linearOperatorHolder);
548 return solveParallel_<ParallelTraits>(x, b, *solver);
551 template<
class ParallelTraits>
552 IstlSolverResult solveParallel_(XVector& x, BVector& b, InverseOperator& solver, ParallelTraits = {})
const
559 Dune::InverseOperatorResult result;
560 solver.apply(x, b, result);
563 DUNE_THROW(Dune::InvalidStateException,
"Calling makeParallelLinearOperator for sequential run");
568 std::shared_ptr<InverseOperator> constructPreconditionedSolver_(MatrixOperatorHolder& ops)
570 return std::visit([&](
auto&& op)
572 using LinearOperator =
typename std::decay_t<
decltype(op)>::element_type;
573 const auto& params = params_.sub(
"preconditioner");
574 using Prec = Dune::Preconditioner<typename LinearOperator::domain_type, typename LinearOperator::range_type>;
575#if DUNE_VERSION_GTE(DUNE_ISTL,2,11)
576 using OpTraits = Dune::OperatorTraits<LinearOperator>;
577 std::shared_ptr<Prec> prec = PreconditionerFactory{}(OpTraits{}, op, params);
579 using TL = Dune::TypeList<typename LinearOperator::matrix_type, typename LinearOperator::domain_type, typename LinearOperator::range_type>;
580 std::shared_ptr<Prec> prec = PreconditionerFactory{}(TL{}, op, params);
584#if DUNE_VERSION_LT(DUNE_ISTL,2,11)
585 if (prec->category() != op->category() && prec->category() == Dune::SolverCategory::sequential)
586 prec = Dune::wrapPreconditioner4Parallel(prec, op);
588 if constexpr (OpTraits::isParallel)
590 using Comm =
typename OpTraits::comm_type;
591 const Comm& comm = OpTraits::getCommOrThrow(op);
592 if (op->category() == Dune::SolverCategory::overlapping && prec->category() == Dune::SolverCategory::sequential)
593 prec = std::make_shared<Dune::BlockPreconditioner<typename OpTraits::domain_type, typename OpTraits::range_type,Comm> >(prec, comm);
594 else if (op->category() == Dune::SolverCategory::nonoverlapping && prec->category() == Dune::SolverCategory::sequential)
595 prec = std::make_shared<Dune::NonoverlappingBlockPreconditioner<Comm, Prec> >(prec, comm);
599 return std::make_shared<InverseOperator>(op, scalarProduct_, prec, params_);
603 template<
class Seq,
class Par>
604 decltype(
auto) executeSequentialOrParallel_(Seq&& sequentialAction, Par&& parallelAction)
const
609 if constexpr (isMultiTypeBlockMatrix<Matrix>::value || !LinearSolverTraits::canCommunicate)
610 return sequentialAction();
613 switch (solverCategory_)
615 case Dune::SolverCategory::sequential:
616 return sequentialAction();
617 case Dune::SolverCategory::nonoverlapping:
618 using NOTraits =
typename LinearSolverTraits::template ParallelNonoverlapping<Matrix, XVector>;
619 return parallelAction(NOTraits{});
620 case Dune::SolverCategory::overlapping:
621 using OTraits =
typename LinearSolverTraits::template ParallelOverlapping<Matrix, XVector>;
622 return parallelAction(OTraits{});
623 default: DUNE_THROW(Dune::InvalidStateException,
"Unknown solver category");
627 return sequentialAction();
632 std::shared_ptr<const ParallelHelper> parallelHelper_;
633 std::shared_ptr<Comm> communication_;
636 Dune::SolverCategory::Category solverCategory_;
637 std::shared_ptr<ScalarProduct> scalarProduct_;
640 MatrixOperatorHolder linearOperator_;
642 std::shared_ptr<InverseOperator> solver_;
644 Dune::ParameterTree params_;
668template<
class LSTraits,
class LATraits>
671 Dune::BiCGSTABSolver<typename LATraits::SingleTypeVector>,
693template<
class LSTraits,
class LATraits>
696 Dune::RestartedGMResSolver<typename LATraits::SingleTypeVector>,
719template<
class LSTraits,
class LATraits>
722 Dune::BiCGSTABSolver<typename LATraits::Vector>,
742template<
class LSTraits,
class LATraits>
745 Dune::CGSolver<typename LATraits::Vector>,
762template<
class LSTraits,
class LATraits>
765 Dune::BiCGSTABSolver<typename LATraits::SingleTypeVector>,
783template<
class LSTraits,
class LATraits>
786 Dune::CGSolver<typename LATraits::SingleTypeVector>,
807template<
class LSTraits,
class LATraits>
810 Dune::RestartedGMResSolver<typename LATraits::SingleTypeVector>,
830template<
class LSTraits,
class LATraits>
833 Dune::BiCGSTABSolver<typename LATraits::Vector>,
845template<
class LSTraits,
class LATraits,
template<
class M>
class Solver,
846 bool convertMultiTypeVectorAndMatrix = isMultiTypeBlockVector<typename LATraits::Vector>::value>
849 using Matrix =
typename LATraits::Matrix;
850 using XVector =
typename LATraits::Vector;
851 using BVector =
typename LATraits::Vector;
856 using InverseOperator = Dune::InverseOperator<XVectorForSolver, BVectorForSolver>;
865 return solve_(A, x, b);
874 DUNE_THROW(Dune::InvalidStateException,
"Called solve(x, b) but no linear operator has been set");
876 return solve_(x, b, *solver_);
884 if constexpr (convertMultiTypeVectorAndMatrix)
889 solver_ = std::make_shared<Solver<MatrixForSolver>>(*matrix_);
897 {
setMatrix(Dune::stackobject_to_shared_ptr(A)); }
904 return "Direct solver";
911 if constexpr (convertMultiTypeVectorAndMatrix)
914 Solver<MatrixForSolver> solver(AA, this->
verbosity() > 0);
915 return solve_(x, b, solver);
919 Solver<MatrixForSolver> solver(A, this->
verbosity() > 0);
920 return solve_(x, b, solver);
924 IstlSolverResult solve_(XVector& x,
const BVector& b, InverseOperator& solver)
const
926 Dune::InverseOperatorResult result;
928 if constexpr (convertMultiTypeVectorAndMatrix)
931 XVectorForSolver xx(bb.size());
932 solver.apply(xx, bb, result);
933 checkResult_(xx, result);
934 if (result.converged)
940 BVectorForSolver bTmp(b);
941 solver.apply(x, bTmp, result);
942 checkResult_(x, result);
948 void checkResult_(XVectorForSolver& x, Dune::InverseOperatorResult& result)
const
950 flatVectorForEach(x, [&](
auto&& entry, std::size_t){
951 using std::isnan, std::isinf;
952 if (isnan(entry) || 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:848
void setMatrix(std::shared_ptr< Matrix > A)
Set the matrix A of the linear system Ax = b for reuse.
Definition istlsolvers.hh:882
IstlSolverResult solve(const Matrix &A, XVector &x, const BVector &b)
Solve the linear system Ax = b.
Definition istlsolvers.hh:863
std::string name() const
name of the linear solver
Definition istlsolvers.hh:902
void setMatrix(Matrix &A)
Set the matrix A of the linear system Ax = b for reuse.
Definition istlsolvers.hh:896
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:871
Standard dune-istl iterative linear solvers.
Definition istlsolvers.hh:175
IstlIterativeLinearSolver(const ParameterInitializer ¶ms="")
Constructor for sequential solvers.
Definition istlsolvers.hh:204
void setMatrix(Matrix &A)
Set the matrix A of the linear system Ax = b for reuse.
Definition istlsolvers.hh:280
void setResidualReduction(double residReduction)
Set the residual reduction tolerance.
Definition istlsolvers.hh:341
void setMaxIter(std::size_t maxIter)
Set the maximum number of linear solver iterations.
Definition istlsolvers.hh:353
IstlIterativeLinearSolver(const GridView &gridView, const DofMapper &dofMapper, const ParameterInitializer ¶ms="")
Constructor for parallel and sequential solvers.
Definition istlsolvers.hh:218
const std::string & name() const
The name of the linear solver.
Definition istlsolvers.hh:333
void setParams(const ParameterInitializer ¶ms)
Set the linear solver parameters.
Definition istlsolvers.hh:367
IstlSolverResult solve(Matrix &A, XVector &x, BVector &b)
Solve the linear system Ax = b.
Definition istlsolvers.hh:264
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:258
void setMatrix(std::shared_ptr< Matrix > A)
Set the matrix A of the linear system Ax = b for reuse.
Definition istlsolvers.hh:270
IstlSolverResult solve(XVector &x, BVector &b) const
Solve the linear system Ax = b where A has been set with setMatrix.
Definition istlsolvers.hh:286
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:231
Scalar norm(const XVector &x) const
Compute the 2-norm of vector x.
Definition istlsolvers.hh:297
Definition istlsolvers.hh:61
auto operator()(OI opInfo, const M &matrix, const Dune::ParameterTree &config)
Definition istlsolvers.hh:64
Definition istlsolvers.hh:84
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:46
Definition parallelhelpers.hh:580
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:588
Definition parallelhelpers.hh:522
void makeNonOverlappingConsistent(Dune::BlockVector< Block, Alloc > &v) const
Make a vector consistent for non-overlapping domain decomposition methods.
Definition parallelhelpers.hh:530
static void retrieveValues(MultiTypeBlockVector &x, const BlockVector &y)
Copies the entries of a Dune::BlockVector to a Dune::MultiTypeBlockVector.
Definition matrixconverter.hh:229
static auto multiTypeToBlockVector(const MultiTypeBlockVector &b)
Converts a Dune::MultiTypeBlockVector to a plain 1x1 Dune::BlockVector.
Definition matrixconverter.hh:203
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:831
constexpr std::size_t preconditionerBlockLevel() noexcept
Returns the block level for the preconditioner for a given matrix.
Definition istlsolvers.hh:54
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:694
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:720
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:808
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:669
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:763
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:784
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:743
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:45
Dune::AMGCreator IstlAmgPreconditionerFactory
Definition istlsolvers.hh:104
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:1420
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:1451
Provides a helper class for nonoverlapping decomposition.
Dumux preconditioners for iterative solvers.
Base class for linear solvers.
Definition istlsolvers.hh:156
IstlSolverResult(IstlSolverResult &&)=default
IstlSolverResult(const Dune::InverseOperatorResult &o)
Definition istlsolvers.hh:161
IstlSolverResult(Dune::InverseOperatorResult &&o)
Definition istlsolvers.hh:162
IstlSolverResult()=default
IstlSolverResult(const IstlSolverResult &)=default
std::decay_t< decltype(MatrixConverter< M >::multiTypeToBCRSMatrix(std::declval< M >()))> type
Definition istlsolvers.hh:111
Definition istlsolvers.hh:107
M type
Definition istlsolvers.hh:107
typename VectorForSolver< typename LATraits::Vector, convert >::type V
Definition istlsolvers.hh:145
std::variant< std::shared_ptr< typename LSTraits::template Sequential< M, V >::LinearOperator > > type
Definition istlsolvers.hh:146
typename MatrixForSolver< typename LATraits::Matrix, convert >::type M
Definition istlsolvers.hh:144
typename VectorForSolver< typename LATraits::Vector, convert >::type V
Definition istlsolvers.hh:127
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:129
typename MatrixForSolver< typename LATraits::Matrix, convert >::type M
Definition istlsolvers.hh:126
Definition istlsolvers.hh:121
std::decay_t< decltype(VectorConverter< V >::multiTypeToBlockVector(std::declval< V >()))> type
Definition istlsolvers.hh:118
Definition istlsolvers.hh:114
V type
Definition istlsolvers.hh:114
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.