Template Numerical Library: TNL::Solvers::Linear::HypreGMRES Class Reference

Template Numerical Library version\ main:0b2c40fb1

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
TNL::Solvers::Linear::HypreGMRES Class Reference
Wrappers for the Hypre library

Wrapper for the GMRES solver in Hypre. More...

`#include <TNL/Solvers/Linear/Hypre.h>`

Inheritance diagram for TNL::Solvers::Linear::HypreGMRES:
[legend]
Collaboration diagram for TNL::Solvers::Linear::HypreGMRES:
[legend]

## Public Member Functions
| HypreGMRES (const Matrices::HypreParCSRMatrix &A_)
| HypreGMRES (MPI_Comm comm)
HYPRE_Int | getNumIterations () const
void | setAbsTol (double tol)
void | setKDim (int k_dim)
void | setMatrix (const Matrices::HypreParCSRMatrix &op, bool reuse_setup=false) override
| Set the matrix of the linear system to be solved.
void | setMaxIter (int max_iter)
void | setPreconditioner (HypreSolver &precond)
| Set the Hypre solver to be used as a preconditioner.
void | setPrintLevel (int print_level)
void | setTol (double tol)
HYPRE_PtrToParSolverFcn | setupFcn () const override
| Hypre's internal setup function.
HYPRE_PtrToParSolverFcn | solveFcn () const override
| Hypre's internal solve function.
Public Member Functions inherited from TNL::Solvers::Linear::HypreSolver
| HypreSolver (const Matrices::HypreParCSRMatrix &A)
virtual | operator HYPRE_Solver () const
| Type-cast to HYPRE_Solver.
void | setErrorMode (ErrorMode err_mode) const
| Set the behavior for treating Hypre errors, see the ErrorMode enum. The default mode in the base class is ABORT_HYPRE_ERRORS.
virtual void | setup (const Containers::HypreParVector &b, Containers::HypreParVector &x) const
| Setup the solver for solving the linear system Ax=b.
virtual void | solve (const Containers::HypreParVector &b, Containers::HypreParVector &x) const
| Solve the linear system Ax=b.

## Protected Member Functions
void | postSolveHook () const override
| Hook function that is called at the end of solve.

## Additional Inherited Members
Public Types inherited from TNL::Solvers::Linear::HypreSolver
enum | ErrorMode : std::uint8_t { IGNORE_HYPRE_ERRORS , WARN_HYPRE_ERRORS , ABORT_HYPRE_ERRORS }
| How to treat errors returned by Hypre function calls. More...
Protected Attributes inherited from TNL::Solvers::Linear::HypreSolver
const Matrices::HypreParCSRMatrix * | A = nullptr
| The linear system matrix.
ErrorMode | error_mode = ABORT_HYPRE_ERRORS
| How to treat Hypre errors.
bool | setup_called = false
| Indicates if Hypre's setup function was already called.
HYPRE_Solver | solver = nullptr
| Handle for the Hypre solver.

## Detailed Description

Wrapper for the GMRES solver in Hypre.

Parameters can be set using native Hypre functions, e.g.

TNL::Solvers::Linear::HypreGMRES solver;
HYPRE_GMRESSetTol(solver, 1e-7);
TNL::Solvers::Linear::HypreGMRES
Wrapper for the GMRES solver in Hypre.
Definition Hypre.h:312
TNL::Solvers::Linear::HypreSolver::solver
HYPRE_Solver solver
Handle for the Hypre solver.
Definition Hypre.h:28

See the Hypre Reference Manual for the available parameters.

## Member Function Documentation

## ◆ postSolveHook()

void TNL::Solvers::Linear::HypreGMRES::postSolveHook | ( |  | ) | const
| overrideprotectedvirtual

Hook function that is called at the end of solve.

Reimplemented from TNL::Solvers::Linear::HypreSolver.

## ◆ setMatrix()

void TNL::Solvers::Linear::HypreGMRES::setMatrix | ( | const Matrices::HypreParCSRMatrix & | op,
|  | bool | reuse_setup = false )
| overridevirtual

Set the matrix of the linear system to be solved.

This function also resets the internal flag indicating whether the Hypre setup function was called for the current matrix.

Parameters

  op | The input matrix.
  reuse_setup | When true, the result of the previous setup phase will be preserved, i.e., the solver (and preconditioner) will not be updated for the new matrix when calling the solve method.

Reimplemented from TNL::Solvers::Linear::HypreSolver.

## ◆ setupFcn()

HYPRE_PtrToParSolverFcn TNL::Solvers::Linear::HypreGMRES::setupFcn | ( |  | ) | const
| inlinenodiscardoverridevirtual

Hypre's internal setup function.

Implements TNL::Solvers::Linear::HypreSolver.

## ◆ solveFcn()

HYPRE_PtrToParSolverFcn TNL::Solvers::Linear::HypreGMRES::solveFcn | ( |  | ) | const
| inlinenodiscardoverridevirtual

Hypre's internal solve function.

Implements TNL::Solvers::Linear::HypreSolver.

The documentation for this class was generated from the following file:

- src/TNL/Solvers/Linear/Hypre.h