Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::HypreIJIface Class Reference

Convenience interface for configuring and invoking HYPRE IJ solvers. More...

#include <AMReX_HypreIJIface.H>

Public Types

using HypreIntType = HYPRE_Int
using HypreRealType = HYPRE_Real

Public Member Functions

 HypreIJIface (MPI_Comm comm, HypreIntType ilower, HypreIntType iupper, int verbose)
 Construct an IJ interface spanning rows [ilower, iupper].
 ~HypreIJIface ()
 HypreIJIface (HypreIJIface const &)=delete
 HypreIJIface (HypreIJIface &&)=delete
HypreIJIface & operator= (HypreIJIface const &)=delete
HypreIJIface & operator= (HypreIJIface &&)=delete
void parse_inputs (const std::string &prefix="hypre")
 Parse runtime options (solver, preconditioner, tolerances).
void solve (HypreRealType rel_tol, HypreRealType abs_tol, HypreIntType max_iter)
 Solve the linear system using the configured solver/preconditioner.
void setNeedSetup () noexcept
 Call after changing the matrix so the next solve redoes the setup.
void setRecomputePreconditioner (bool b) noexcept
void setThrowException (bool t) noexcept
HYPRE_IJMatrix A ()
 IJ matrix instance.
HYPRE_IJVector b ()
 Right hand side IJ vector instance.
HYPRE_IJVector x ()
 Solution IJ vector instance.
HypreIntType getNumIters () const
 Number of iterations taken by the solver to reach the desired tolerance.
HypreRealType getFinalResidualNorm () const
 Final residual norm after a linear solve.
bool adjustSingularMatrix () const
HypreIntType ilower () const
 Lowest global row id owned by this rank.

Detailed Description

Convenience interface for configuring and invoking HYPRE IJ solvers.

Member Typedef Documentation

◆ HypreIntType

◆ HypreRealType

Constructor & Destructor Documentation

◆ HypreIJIface() [1/3]

amrex::HypreIJIface::HypreIJIface ( MPI_Comm comm,
HypreIntType ilower,
HypreIntType iupper,
int verbose )

Construct an IJ interface spanning rows [ilower, iupper].

Parameters
commMPI communicator.
ilowerGlobal row id lower bound (inclusive) owned by this rank.
iupperGlobal row id upper bound (inclusive) owned by this rank.
verboseVerbosity level forwarded to HYPRE.

◆ ~HypreIJIface()

amrex::HypreIJIface::~HypreIJIface ( )

◆ HypreIJIface() [2/3]

amrex::HypreIJIface::HypreIJIface ( HypreIJIface const & )
delete

◆ HypreIJIface() [3/3]

amrex::HypreIJIface::HypreIJIface ( HypreIJIface && )
delete

Member Function Documentation

◆ A()

HYPRE_IJMatrix amrex::HypreIJIface::A ( )
inlinenodiscard

IJ matrix instance.

◆ adjustSingularMatrix()

bool amrex::HypreIJIface::adjustSingularMatrix ( ) const
inlinenodiscard

◆ b()

HYPRE_IJVector amrex::HypreIJIface::b ( )
inlinenodiscard

Right hand side IJ vector instance.

◆ getFinalResidualNorm()

HypreRealType amrex::HypreIJIface::getFinalResidualNorm ( ) const
inlinenodiscard

Final residual norm after a linear solve.

◆ getNumIters()

HypreIntType amrex::HypreIJIface::getNumIters ( ) const
inlinenodiscard

Number of iterations taken by the solver to reach the desired tolerance.

◆ ilower()

HypreIntType amrex::HypreIJIface::ilower ( ) const
inlinenodiscard

Lowest global row id owned by this rank.

◆ operator=() [1/2]

HypreIJIface & amrex::HypreIJIface::operator= ( HypreIJIface && )
delete

◆ operator=() [2/2]

HypreIJIface & amrex::HypreIJIface::operator= ( HypreIJIface const & )
delete

◆ parse_inputs()

void amrex::HypreIJIface::parse_inputs ( const std::string & prefix = "hypre")

Parse runtime options (solver, preconditioner, tolerances).

Parameters
prefixParmParse prefix; defaults to the literal "hypre" namespace used for HYPRE options.

◆ setNeedSetup()

void amrex::HypreIJIface::setNeedSetup ( )
inlinenoexcept

Call after changing the matrix so the next solve redoes the setup.

◆ setRecomputePreconditioner()

void amrex::HypreIJIface::setRecomputePreconditioner ( bool b)
inlinenoexcept

Redo the setup on every solve (default true). Callers that call setNeedSetup when the matrix changes can turn it off.

◆ setThrowException()

void amrex::HypreIJIface::setThrowException ( bool t)
inlinenoexcept

Throw std::runtime_error instead of aborting on a hypre error or a non-finite residual (with abort_on_hypre_error, the default)

◆ solve()

void amrex::HypreIJIface::solve ( HypreRealType rel_tol,
HypreRealType abs_tol,
HypreIntType max_iter )

Solve the linear system using the configured solver/preconditioner.

Parameters
rel_tolRelative tolerance.
abs_tolAbsolute tolerance.
max_iterIteration limit.

◆ x()

HYPRE_IJVector amrex::HypreIJIface::x ( )
inlinenodiscard

Solution IJ vector instance.


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