Template Numerical Library: TNL::Solvers::Linear::HypreBoomerAMG 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::HypreBoomerAMG Class Reference
Wrappers for the Hypre library

Wrapper for the BoomerAMG solver/preconditioner in Hypre. More...

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

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

## Public Member Functions
| HypreBoomerAMG (const Matrices::HypreParCSRMatrix &A)
HYPRE_Int | getNumIterations () const
void | setAdvectiveOptions (int restrict_type=0, int relax_order=1)
| Set parameters to use AIR AMG solver for advection-dominated problems.
void | setMaxIter (int max_iter)
void | setPrintLevel (int print_level)
| Set the print level: 0 = none, 1 = setup, 2 = solve, 3 = setup+solve.
void | setSystemsOptions (int dim, bool order_bynodes=false)
| More robust options for systems of PDEs.
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 | setMatrix (const Matrices::HypreParCSRMatrix &op, bool reuse_setup=false)
| Set the matrix of the linear system to be solved.
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 BoomerAMG solver/preconditioner in Hypre.

Note that the wrapper class sets its own default options that are different from Hypre. By default, the instance is set up for preconditioner use, i.e. with zero tolerance and one V cycle. At least these two parameters need to be changed when used as a solver.

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

TNL::Solvers::Linear::HypreBoomerAMG solver;
HYPRE_BoomerAMGSetTol(solver, 1e-7);
HYPRE_BoomerAMGSetMaxIter(solver, 20);
TNL::Solvers::Linear::HypreBoomerAMG
Wrapper for the BoomerAMG solver/preconditioner in Hypre.
Definition Hypre.h:683
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::HypreBoomerAMG::postSolveHook | ( |  | ) | const
| overrideprotectedvirtual

Hook function that is called at the end of solve.

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

## ◆ setAdvectiveOptions()

void TNL::Solvers::Linear::HypreBoomerAMG::setAdvectiveOptions | ( | int | restrict_type = 0,
|  | int | relax_order = 1 )

Set parameters to use AIR AMG solver for advection-dominated problems.

See "Nonsymmetric Algebraic Multigrid Based on Local Approximate Ideal Restriction (AIR)," Manteuffel, Ruge, Southworth, SISC (2018), DOI:/10.1137/17M1144350.

Parameters

  restrict_type | Defines which parallel restriction operator is used. There are the following options: 0: transpose of the interpolation operator 1: AIR-1 - Approximate Ideal Restriction (distance 1) 2: AIR-2 - Approximate Ideal Restriction (distance 2)
  relax_order | Defines in which order the points are relaxed. There are the following options: 0: the points are relaxed in natural or lexicographic order on each processor 1: CF-relaxation is used

## ◆ setupFcn()

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

Hypre's internal setup function.

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

## ◆ solveFcn()

HYPRE_PtrToParSolverFcn TNL::Solvers::Linear::HypreBoomerAMG::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