Flexible GMRES (FGMRES) iterative solver for nonsymmetric linear systems. More...
#include <fgmres.hpp>
Public Types | |
| using | OperatorType = OperatorT |
| Operator type to be solved. | |
| using | SolutionVectorType = SrcOf< OperatorType > |
| Solution vector type. | |
| using | RHSVectorType = DstOf< OperatorType > |
| Right-hand side vector type. | |
| using | ScalarType = typename SolutionVectorType::ScalarType |
| Scalar type for computations. | |
Public Member Functions | |
| FGMRES (const std::vector< SolutionVectorType > &tmp, const FGMRESOptions< ScalarType > &options={}, const std::shared_ptr< util::Table > &statistics=nullptr, const PreconditionerT preconditioner=IdentitySolver< OperatorT >()) | |
| Construct an FGMRES solver with a custom preconditioner. | |
| void | set_tag (const std::string &tag) |
| Set a tag string for statistics output identification. | |
| void | set_restart (int m) |
| Set the number of inner iterations before restart (FGMRES(m)). | |
| void | solve_impl (OperatorType &A, SolutionVectorType &x, const RHSVectorType &b) |
| Solve the linear system \( Ax = b \) using flexible GMRES with restarts. | |
Flexible GMRES (FGMRES) iterative solver for nonsymmetric linear systems.
FGMRES allows for varying (flexible) preconditioning at each iteration, making it suitable for use with inexact or variable preconditioners.
Reference:
Satisfies the SolverLike concept (see solver.hpp). Supports optional right preconditioning via the flexible framework.
| OperatorT | Operator type (must satisfy OperatorLike). |
| PreconditionerT | Preconditioner type (must satisfy SolverLike, defaults to IdentitySolver). |
| using terra::linalg::solvers::FGMRES< OperatorT, PreconditionerT >::OperatorType = OperatorT |
Operator type to be solved.
| using terra::linalg::solvers::FGMRES< OperatorT, PreconditionerT >::RHSVectorType = DstOf< OperatorType > |
Right-hand side vector type.
| using terra::linalg::solvers::FGMRES< OperatorT, PreconditionerT >::ScalarType = typename SolutionVectorType::ScalarType |
Scalar type for computations.
| using terra::linalg::solvers::FGMRES< OperatorT, PreconditionerT >::SolutionVectorType = SrcOf< OperatorType > |
Solution vector type.
|
inline |
Construct an FGMRES solver with a custom preconditioner.
| tmp | Temporary vectors for workspace. Must contain at least 2*restart + 4 vectors:
|
| options | FGMRES solver parameters (restart, tolerances, max iterations). |
| statistics | Shared pointer to statistics table for logging iteration progress (optional). |
| preconditioner | Preconditioner solver (defaults to identity). |
|
inline |
Set the number of inner iterations before restart (FGMRES(m)).
| m | Restart parameter (must be at least 1). |
|
inline |
Set a tag string for statistics output identification.
| tag | Tag string to identify this solver instance in statistics. |
|
inline |
Solve the linear system \( Ax = b \) using flexible GMRES with restarts.
Uses right preconditioning: solves \( A M^{-1} y = b \) where \( x = M^{-1} y \). The preconditioner M can vary at each iteration (flexibility).
The method builds an Arnoldi basis via modified Gram-Schmidt orthogonalization, applies Givens rotations to minimize the least-squares residual in the Krylov subspace, and updates the solution. If convergence is not achieved within the restart window, the process restarts with the updated solution until max_iterations is reached or convergence criteria are satisfied.
| A | Operator (matrix) to solve with. |
| x | Solution vector (input: initial guess, output: final solution). |
| b | Right-hand side vector (input). |