Rodin/Solver/GMRES.h file

GMRES solver for (generally) non-symmetric linear systems.

This header provides the GMRES (Generalized Minimal Residual) solver class, an iterative method for solving linear systems:

\[ Ax = b \]

for general (possibly non-symmetric) matrices.

Algorithm

GMRES builds a Krylov subspace and computes the iterate that minimizes the residual norm over that subspace.

Applicability

  • Non-symmetric or indefinite matrices
  • Large sparse systems
  • Convection-diffusion, saddle-point systems (when used appropriately)

Notes

  • Restarted GMRES is typically used to bound memory; Eigen's GMRES supports restart.

Usage Example

Problem problem(u, v);
problem = Integral(Grad(u), Grad(v)) - Integral(f, v);

Solver::GMRES solver(problem);
solver.setTolerance(1e-10).setMaxIterations(1000).setRestart(50).solve();

if (solver.success())
  std::cout << "Converged!\n";

Namespaces

namespace Rodin
The Rodin library for Shape and Topology Optimization.
namespace Rodin::Solver
Module for linear algebra systems.

Classes

template<class Scalar>
class Rodin::Solver::GMRES<Math::LinearSystem<Math::SparseMatrix<Scalar>, Math::Vector<Scalar>>>
GMRES solver for sparse systems.
template<class Scalar>
class Rodin::Solver::GMRES<Math::LinearSystem<Math::Matrix<Scalar>, Math::Vector<Scalar>>>
GMRES solver for dense systems.