Solver module
Solution of linear and nonlinear discrete systems.
CG handles symmetric positive-definite systems, GMRES handles general iterative solves, and SparseLU provides direct sparse factorization. NewtonSolver drives nonlinear solves. These solvers operate on prepared systems or variational problems and provide convergence controls for PDE and optimization calculations.
Direct solvers (exact up to floating-point precision):
- SparseLU — General-purpose sparse LU factorization
UMFPack— SuiteSparse UMFPACK solverCHOLMOD— SuiteSparse Cholesky for SPD systems- SimplicialLLT — Simplicial
- SimplicialLDLT — Simplicial
- SparseQR — Sparse QR factorization
SPQR— SuiteSparse sparse QR- HouseholderQR — Dense Householder QR
- LDLT — Dense
Iterative solvers (for large systems):
- CG — Conjugate Gradient (SPD systems)
- BiCGSTAB — Bi-conjugate gradient stabilized
- GMRES — Generalized Minimum Residual
- DGMRES — Deflated GMRES
- MINRES — Minimum Residual (symmetric systems)
- IDRS — Induced Dimension Reduction
- IDRSTABL — IDR(s) with stabilization
- LeastSquaresCG — Least-squares CG
A solver can be constructed from an assembled form or problem.
// Inline iterative solver — most common pattern Solver::CG(problem).solve(); // Configured iterative solver Solver::CG solver(problem); solver.setMaxIterations(1000); solver.setTolerance(1e-10); solver.solve(); // Direct solver Solver::SparseLU(problem).solve();
Nonlinear solvers (for hyperelastic or other nonlinear problems):
Solver::NewtonSolver<LinearSolver>— Newton-Raphson iteration for nonlinear variational problems. At each iterate , assembles the tangent system and updates . Configurable viasetMaxIterations(),setAbsoluteTolerance(), andsetRelativeTolerance().
Classes
- class KSP
- PETSc KSP (Krylov subspace) linear solver wrapper.
- class SNES
- PETSc SNES (Scalable Nonlinear Equations Solvers) wrapper.
-
template<class LinearSystem>class LinearSolverBase
- Abstract base class for linear system solvers.
-
template<class LinearSolver>class NewtonSolverBase
- Abstract base class for Newton-type nonlinear solvers.
-
template<class EigenSolverType, class OperatorType, class VectorType>class EigenSolver
- Wrapper class for any Eigen sparse solver.
-
template<class LinearSystem>class CG
- Conjugate gradient solver for symmetric positive definite systems.
See specializations
Specialization Description PETSc::Math::LinearSystemFull specialization
template <> class CG< PETSc::Math::LinearSystem> final;
Conjugate gradient solver for PETSc linear systems. Math::LinearSystem<…>Full specialization
template < class Scalar> class CG< Math::LinearSystem< Math::SparseMatrix< Scalar >, Math::Vector< Scalar > >> final;
Conjugate gradient solver for symmetric positive definite sparse systems. Math::LinearSystem<…>Full specialization
template < class Scalar> class CG< Math::LinearSystem< Math::Matrix< Scalar >, Math::Vector< Scalar > >> final;
Conjugate gradient solver for symmetric positive definite dense systems. -
template<class LinearSystem>class SimplicialLLT
- Direct sparse LLT Cholesky factorization solver.
See specializations
Specialization Description Math::LinearSystem<…>Full specialization
template < class Scalar> class SimplicialLLT< Math::LinearSystem< Math::SparseMatrix< Scalar >, Math::Vector< Scalar > >> final;
Simplicial LLT Cholesky factorization for sparse SPD matrices. -
template<class LinearSystem>class SimplicialLDLT
- Direct sparse LDLT Cholesky factorization solver.
See specializations
Specialization Description Math::LinearSystem<…>Full specialization
template < class Scalar> class SimplicialLDLT< Math::LinearSystem< Math::SparseMatrix< Scalar >, Math::Vector< Scalar > >> final;
Simplicial LDLT Cholesky factorization without square root. -
template<class LinearSystem>class LDLT
- Robust LDLT Cholesky decomposition for dense matrices.
See specializations
Specialization Description Math::LinearSystem<…>Full specialization
template < class Scalar> class LDLT< Math::LinearSystem< Math::Matrix< Scalar >, Math::Vector< Scalar > >> final;
Robust LDLT Cholesky factorization with pivoting for dense matrices. -
template<class LinearSystem>class PartialPivLU
- Dense LU factorization with partial pivoting for general matrices.
See specializations
Specialization Description Math::LinearSystem<…>Full specialization
template < class Scalar> class PartialPivLU< Math::LinearSystem< Math::Matrix< Scalar >, Math::Vector< Scalar > >> final;
Dense LU factorization solver with partial pivoting for general matrices. -
template<class LinearSystem>class HouseholderQR
- Householder QR decomposition for dense matrices.
See specializations
Specialization Description Math::LinearSystem<…>Full specialization
template < class Scalar> class HouseholderQR< Math::LinearSystem< Math::Matrix< Scalar >, Math::Vector< Scalar > >> final;
A direct sparse HouseholderQR Cholesky factorizations without square root for use with Math::SparseMatrix and Math::Vector. -
template<class LinearSystem>class SparseLU
- Sparse supernodal LU factorization for general matrices.
See specializations
Specialization Description Math::LinearSystem<…>Full specialization
template < class Scalar> class SparseLU< Math::LinearSystem< Math::SparseMatrix< Scalar >, Math::Vector< Scalar > >> final;
Sparse supernodal LU factorization solver for general sparse matrices. -
template<class LinearSystem>class SparseQR
- Sparse QR factorization with column pivoting.
See specializations
Specialization Description Math::LinearSystem<…>Full specialization
template < class Scalar> class SparseQR< Math::LinearSystem< Math::SparseMatrix< Scalar >, Math::Vector< Scalar > >> final;
Sparse QR factorization with numerical column pivoting. -
template<class LinearSystem>class LeastSquaresCG
- Least-squares conjugate gradient solver.
See specializations
Specialization Description Math::LinearSystem<…>Full specialization
template < class Scalar> class LeastSquaresCG< Math::LinearSystem< Math::SparseMatrix< Scalar >, Math::Vector< Scalar > >> final;
Least-squares conjugate gradient solver for sparse systems. Math::LinearSystem<…>Full specialization
template < class Scalar> class LeastSquaresCG< Math::LinearSystem< Math::Matrix< Scalar >, Math::Vector< Scalar > >> final;
Least-squares conjugate gradient solver for dense systems. -
template<class LinearSystem>class BiCGSTAB
- Bi-conjugate gradient stabilized iterative solver.
See specializations
Specialization Description Math::LinearSystem<…>Full specialization
template < class Scalar> class BiCGSTAB< Math::LinearSystem< Math::SparseMatrix< Scalar >, Math::Vector< Scalar > >> final;
Bi-conjugate gradient stabilized solver for non-symmetric sparse systems. -
template<class LinearSystem>class GMRES
- Generalized minimal residual iterative solver.
See specializations
Specialization Description PETSc::Math::LinearSystemFull specialization
template <> class GMRES< PETSc::Math::LinearSystem> final;
Generalized minimal residual (GMRES) solver for PETSc linear systems. Math::LinearSystem<…>Full specialization
template < class Scalar> class GMRES< Math::LinearSystem< Math::SparseMatrix< Scalar >, Math::Vector< Scalar > >> final;
Native SparseMatrix GMRES with an owned, type-erased Eigen backend. Math::LinearSystem<…>Full specialization
template < class Scalar> class GMRES< Math::LinearSystem< Math::Matrix< Scalar >, Math::Vector< Scalar > >> final;
Native Matrix GMRES with an owned, type-erased Eigen backend. -
template<class LinearSystem>class DGMRES
- Deflated generalized minimal residual iterative solver.
See specializations
Specialization Description Math::LinearSystem<…>Full specialization
template < class Scalar> class DGMRES< Math::LinearSystem< Math::SparseMatrix< Scalar >, Math::Vector< Scalar > >> final;
DGMRES solver for sparse systems. Math::LinearSystem<…>Full specialization
template < class Scalar> class DGMRES< Math::LinearSystem< Math::Matrix< Scalar >, Math::Vector< Scalar > >> final;
DGMRES solver for dense systems. -
template<class LinearSystem>class IDRS
- Induced dimension reduction iterative solver.
See specializations
Specialization Description Math::LinearSystem<…>Full specialization
template < class Scalar> class IDRS< Math::LinearSystem< Math::SparseMatrix< Scalar >, Math::Vector< Scalar > >> final;
IDRS(s) solver for sparse systems. Math::LinearSystem<…>Full specialization
template < class Scalar> class IDRS< Math::LinearSystem< Math::Matrix< Scalar >, Math::Vector< Scalar > >> final;
IDRS(s) solver for dense systems. -
template<class LinearSystem>class MINRES
- Minimum residual iterative solver.
See specializations
Specialization Description Math::LinearSystem<…>Full specialization
template < class Scalar> class MINRES< Math::LinearSystem< Math::SparseMatrix< Scalar >, Math::Vector< Scalar > >> final;
MINRES solver for symmetric sparse systems. Math::LinearSystem<…>Full specialization
template < class Scalar> class MINRES< Math::LinearSystem< Math::Matrix< Scalar >, Math::Vector< Scalar > >> final;
MINRES solver for symmetric dense systems. -
template<class LinearSystem>class IDRSTABL
- IDR(s)STABL iterative solver.
See specializations
Specialization Description Math::LinearSystem<…>Full specialization
template < class Scalar> class IDRSTABL< Math::LinearSystem< Math::SparseMatrix< Scalar >, Math::Vector< Scalar > >> final;
IDRstab(l) solver for sparse systems. Math::LinearSystem<…>Full specialization
template < class Scalar> class IDRSTABL< Math::LinearSystem< Math::Matrix< Scalar >, Math::Vector< Scalar > >> final;
IDRstab(l) solver for dense systems. - struct Info
- Outcome of the most recent operation of a factorization-based solver.
-
template<class LinearSolver>class NewtonSolver
- Newton solver for state-dependent tangential problems.
Enums
- enum class Factorization { Symbolic, Numeric }
- Stage of a factorization.
Functions
-
template<class LinearSystem>BiCGSTAB(Variational::ProblemBase<LinearSystem>& pb) -> BiCGSTAB< LinearSystem >
- CTAD for BiCGSTAB.
-
template<class LinearSystem>CG(Variational::ProblemBase<LinearSystem>& pb) -> CG< LinearSystem >
- CTAD (Class Template Argument Deduction) guide for CG.
-
template<class LinearSystem>DGMRES(Variational::ProblemBase<LinearSystem>& pb) -> DGMRES< LinearSystem >
- CTAD (Class Template Argument Deduction) guide for DGMRES.
-
template<class LinearSystem>GMRES(Variational::ProblemBase<LinearSystem>& problem) -> GMRES< LinearSystem >
- Deduces the linear system when selecting the default backend.
-
template<class LinearSystem>HouseholderQR(Variational::ProblemBase<LinearSystem>& pb) -> HouseholderQR< LinearSystem >
- CTAD for HouseholderQR.
-
template<class LinearSystem>IDRS(Variational::ProblemBase<LinearSystem>& pb) -> IDRS< LinearSystem >
- CTAD (Class Template Argument Deduction) guide for IDRS.
-
template<class LinearSystem>IDRSTABL(Variational::ProblemBase<LinearSystem>& pb) -> IDRSTABL< LinearSystem >
- CTAD (Class Template Argument Deduction) guide for IDRSTABL.
-
template<class LinearSystem>LDLT(Variational::ProblemBase<LinearSystem>& pb) -> LDLT< LinearSystem >
- CTAD (Class Template Argument Deduction) guide for LDLT.
- LeastSquaresCG
- CTAD (Class Template Argument Deduction) guide for LeastSquaresCG.
See declaration
template<class LinearSystem>LeastSquaresCG(Variational::ProblemBase<LinearSystem>& pb) -> LeastSquaresCG< LinearSystem > -
template<class LinearSystem>MINRES(Variational::ProblemBase<LinearSystem>& pb) -> MINRES< LinearSystem >
- CTAD (Class Template Argument Deduction) guide for MINRES.
-
template<class LS>NewtonSolver(LS& solver) -> NewtonSolver< LS >
- CTAD (Class Template Argument Deduction) guide for NewtonSolver.
-
template<class LinearSystem>PartialPivLU(Variational::ProblemBase<LinearSystem>& pb) -> PartialPivLU< LinearSystem >
- CTAD guide for PartialPivLU.
- SimplicialLDLT
- CTAD (Class Template Argument Deduction) guide for SimplicialLDLT.
See declaration
template<class LinearSystemType>SimplicialLDLT(Variational::ProblemBase<LinearSystemType>& pb) -> SimplicialLDLT< LinearSystemType > -
template<class LinearSystem>SimplicialLLT(Variational::ProblemBase<LinearSystem>& pb) -> SimplicialLLT< LinearSystem >
- CTAD (Class Template Argument Deduction) guide for SimplicialLLT.
-
template<class LinearSystem>SparseLU(Variational::ProblemBase<LinearSystem>& pb) -> SparseLU< LinearSystem >
- CTAD (Class Template Argument Deduction) guide for SparseLU.
-
template<class LinearSystem>SparseQR(Variational::ProblemBase<LinearSystem>& pb) -> SparseQR< LinearSystem >
- CTAD (Class Template Argument Deduction) guide for SparseQR.
Variables
-
template<class LinearSystem, class Preconditioner>GMRES< LinearSystem >
- Deduces the linear system; the preconditioner type remains private.
Enum documentation
enum class Rodin:: Solver:: Factorization
Defined in Rodin/Solver/Info.h
Stage of a factorization.
Symbolic analysis depends only on the sparsity pattern, whereas the numeric factorization also depends on the values. A solver that retains Factorization::Numeric therefore retains Factorization::Symbolic too.