Block-Structured AMR Software Framework
amrex::HypreIJIface Class Reference

#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)
 
 ~HypreIJIface ()
 
 HypreIJIface (HypreIJIface const &)=delete
 
 HypreIJIface (HypreIJIface &&)=delete
 
HypreIJIfaceoperator= (HypreIJIface const &)=delete
 
HypreIJIfaceoperator= (HypreIJIface &&)=delete
 
void parse_inputs (const std::string &prefix="hypre")
 
void solve (HypreRealType rel_tol, HypreRealType abs_tol, HypreIntType max_iter)
 
HYPRE_IJMatrix A ()
 IJ matrix instance. More...
 
HYPRE_IJVector b ()
 Right hand side IJ vector instance. More...
 
HYPRE_IJVector x ()
 Solution IJ vector instance. More...
 
HypreIntType getNumIters () const
 Number of iterations taken by the solver to reach the desired tolerance. More...
 
HypreRealType getFinalResidualNorm () const
 Final residual norm after a linear solve. More...
 
bool adjustSingularMatrix () const
 

Private Member Functions

void init_preconditioner (const std::string &prefix, const std::string &name)
 
void init_solver (const std::string &prefix, const std::string &name)
 
void run_hypre_setup ()
 run_setup More...
 
void run_hypre_solve ()
 
void boomeramg_precond_configure (const std::string &prefix)
 
void euclid_precond_configure (const std::string &prefix)
 
void boomeramg_solver_configure (const std::string &prefix)
 
void gmres_solver_configure (const std::string &prefix)
 
void cogmres_solver_configure (const std::string &prefix)
 
void lgmres_solver_configure (const std::string &prefix)
 
void flex_gmres_solver_configure (const std::string &prefix)
 
void bicgstab_solver_configure (const std::string &prefix)
 
void pcg_solver_configure (const std::string &prefix)
 
void hybrid_solver_configure (const std::string &prefix)
 

Private Attributes

MPI_Comm m_comm {MPI_COMM_NULL}
 
HYPRE_IJMatrix m_mat {nullptr}
 
HYPRE_IJVector m_rhs {nullptr}
 
HYPRE_IJVector m_sln {nullptr}
 
HYPRE_ParCSRMatrix m_parA {nullptr}
 
HYPRE_ParVector m_parRhs {nullptr}
 
HYPRE_ParVector m_parSln {nullptr}
 
HYPRE_Solver m_solver {nullptr}
 
HYPRE_Solver m_precond {nullptr}
 
HypreIntType(* m_solverDestroyPtr )(HYPRE_Solver)
 
HypreIntType(* m_solverSetupPtr )(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
 
HypreIntType(* m_solverSolvePtr )(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
 
HypreIntType(* m_solverPrecondPtr )(HYPRE_Solver, HYPRE_PtrToParSolverFcn, HYPRE_PtrToParSolverFcn, HYPRE_Solver)
 
HypreIntType(* m_precondDestroyPtr )(HYPRE_Solver)
 
HypreIntType(* m_precondSetupPtr )(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
 
HypreIntType(* m_precondSolvePtr )(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
 
HypreIntType(* m_solverSetTolPtr )(HYPRE_Solver, amrex::Real)
 
HypreIntType(* m_solverSetAbsTolPtr )(HYPRE_Solver, amrex::Real)
 
HypreIntType(* m_solverSetMaxIterPtr )(HYPRE_Solver, HypreIntType)
 
HypreIntType(* m_solverNumItersPtr )(HYPRE_Solver, HypreIntType *)
 
HypreIntType(* m_solverFinalResidualNormPtr )(HYPRE_Solver, amrex::Real *)
 
HypreIntType m_ilower {0}
 
HypreIntType m_iupper {0}
 
HypreRealType m_final_res_norm
 
HypreIntType m_num_iterations
 
std::string m_solver_name {"BoomerAMG"}
 
std::string m_preconditioner_name {"none"}
 
std::string m_file_prefix {"IJ"}
 
int m_verbose {0}
 Verbosity of the HYPRE solvers. More...
 
unsigned int m_write_counter {0}
 
bool m_has_preconditioner {false}
 Flag indicating whether a preconditioner has been set. More...
 
bool m_need_setup {true}
 Flag indicating whether the solver/preconditioner has been setup. More...
 
bool m_recompute_preconditioner {true}
 Flag indicating whether user has requested recomputation of preconditioner. More...
 
bool m_adjust_singular_matrix {false}
 Should singular matrix be adjusted to fix solution on a node/cell? More...
 
bool m_write_files {false}
 Flag indicating whether to dump matrix files. More...
 
bool m_overwrite_files {true}
 Flag indicating whether the files are overwritten on subsequent writes. More...
 

Member Typedef Documentation

◆ HypreIntType

◆ HypreRealType

Constructor & Destructor Documentation

◆ HypreIJIface() [1/3]

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

◆ ~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 ( )
inline

IJ matrix instance.

◆ adjustSingularMatrix()

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

◆ b()

HYPRE_IJVector amrex::HypreIJIface::b ( )
inline

Right hand side IJ vector instance.

◆ bicgstab_solver_configure()

void amrex::HypreIJIface::bicgstab_solver_configure ( const std::string &  prefix)
private

◆ boomeramg_precond_configure()

void amrex::HypreIJIface::boomeramg_precond_configure ( const std::string &  prefix)
private

◆ boomeramg_solver_configure()

void amrex::HypreIJIface::boomeramg_solver_configure ( const std::string &  prefix)
private

◆ cogmres_solver_configure()

void amrex::HypreIJIface::cogmres_solver_configure ( const std::string &  prefix)
private

◆ euclid_precond_configure()

void amrex::HypreIJIface::euclid_precond_configure ( const std::string &  prefix)
private

◆ flex_gmres_solver_configure()

void amrex::HypreIJIface::flex_gmres_solver_configure ( const std::string &  prefix)
private

◆ getFinalResidualNorm()

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

Final residual norm after a linear solve.

◆ getNumIters()

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

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

◆ gmres_solver_configure()

void amrex::HypreIJIface::gmres_solver_configure ( const std::string &  prefix)
private

◆ hybrid_solver_configure()

void amrex::HypreIJIface::hybrid_solver_configure ( const std::string &  prefix)
private

◆ init_preconditioner()

void amrex::HypreIJIface::init_preconditioner ( const std::string &  prefix,
const std::string &  name 
)
private

◆ init_solver()

void amrex::HypreIJIface::init_solver ( const std::string &  prefix,
const std::string &  name 
)
private

◆ lgmres_solver_configure()

void amrex::HypreIJIface::lgmres_solver_configure ( const std::string &  prefix)
private

◆ 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")

◆ pcg_solver_configure()

void amrex::HypreIJIface::pcg_solver_configure ( const std::string &  prefix)
private

◆ run_hypre_setup()

void amrex::HypreIJIface::run_hypre_setup ( )
private

run_setup

◆ run_hypre_solve()

void amrex::HypreIJIface::run_hypre_solve ( )
private

◆ solve()

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

◆ x()

HYPRE_IJVector amrex::HypreIJIface::x ( )
inline

Solution IJ vector instance.

Member Data Documentation

◆ m_adjust_singular_matrix

bool amrex::HypreIJIface::m_adjust_singular_matrix {false}
private

Should singular matrix be adjusted to fix solution on a node/cell?

◆ m_comm

MPI_Comm amrex::HypreIJIface::m_comm {MPI_COMM_NULL}
private

◆ m_file_prefix

std::string amrex::HypreIJIface::m_file_prefix {"IJ"}
private

◆ m_final_res_norm

HypreRealType amrex::HypreIJIface::m_final_res_norm
private

◆ m_has_preconditioner

bool amrex::HypreIJIface::m_has_preconditioner {false}
private

Flag indicating whether a preconditioner has been set.

◆ m_ilower

HypreIntType amrex::HypreIJIface::m_ilower {0}
private

◆ m_iupper

HypreIntType amrex::HypreIJIface::m_iupper {0}
private

◆ m_mat

HYPRE_IJMatrix amrex::HypreIJIface::m_mat {nullptr}
private

◆ m_need_setup

bool amrex::HypreIJIface::m_need_setup {true}
private

Flag indicating whether the solver/preconditioner has been setup.

◆ m_num_iterations

HypreIntType amrex::HypreIJIface::m_num_iterations
private

◆ m_overwrite_files

bool amrex::HypreIJIface::m_overwrite_files {true}
private

Flag indicating whether the files are overwritten on subsequent writes.

◆ m_parA

HYPRE_ParCSRMatrix amrex::HypreIJIface::m_parA {nullptr}
private

◆ m_parRhs

HYPRE_ParVector amrex::HypreIJIface::m_parRhs {nullptr}
private

◆ m_parSln

HYPRE_ParVector amrex::HypreIJIface::m_parSln {nullptr}
private

◆ m_precond

HYPRE_Solver amrex::HypreIJIface::m_precond {nullptr}
private

◆ m_precondDestroyPtr

HypreIntType(* amrex::HypreIJIface::m_precondDestroyPtr) (HYPRE_Solver)
inlineprivate

◆ m_preconditioner_name

std::string amrex::HypreIJIface::m_preconditioner_name {"none"}
private

◆ m_precondSetupPtr

HypreIntType(* amrex::HypreIJIface::m_precondSetupPtr) (HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
inlineprivate

◆ m_precondSolvePtr

HypreIntType(* amrex::HypreIJIface::m_precondSolvePtr) (HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
inlineprivate

◆ m_recompute_preconditioner

bool amrex::HypreIJIface::m_recompute_preconditioner {true}
private

Flag indicating whether user has requested recomputation of preconditioner.

◆ m_rhs

HYPRE_IJVector amrex::HypreIJIface::m_rhs {nullptr}
private

◆ m_sln

HYPRE_IJVector amrex::HypreIJIface::m_sln {nullptr}
private

◆ m_solver

HYPRE_Solver amrex::HypreIJIface::m_solver {nullptr}
private

◆ m_solver_name

std::string amrex::HypreIJIface::m_solver_name {"BoomerAMG"}
private

◆ m_solverDestroyPtr

HypreIntType(* amrex::HypreIJIface::m_solverDestroyPtr) (HYPRE_Solver)
inlineprivate

◆ m_solverFinalResidualNormPtr

HypreIntType(* amrex::HypreIJIface::m_solverFinalResidualNormPtr) (HYPRE_Solver, amrex::Real *)
inlineprivate

◆ m_solverNumItersPtr

HypreIntType(* amrex::HypreIJIface::m_solverNumItersPtr) (HYPRE_Solver, HypreIntType *)
inlineprivate

◆ m_solverPrecondPtr

HypreIntType(* amrex::HypreIJIface::m_solverPrecondPtr) (HYPRE_Solver, HYPRE_PtrToParSolverFcn, HYPRE_PtrToParSolverFcn, HYPRE_Solver)
inlineprivate

◆ m_solverSetAbsTolPtr

HypreIntType(* amrex::HypreIJIface::m_solverSetAbsTolPtr) (HYPRE_Solver, amrex::Real)
inlineprivate

◆ m_solverSetMaxIterPtr

HypreIntType(* amrex::HypreIJIface::m_solverSetMaxIterPtr) (HYPRE_Solver, HypreIntType)
inlineprivate

◆ m_solverSetTolPtr

HypreIntType(* amrex::HypreIJIface::m_solverSetTolPtr) (HYPRE_Solver, amrex::Real)
inlineprivate

◆ m_solverSetupPtr

HypreIntType(* amrex::HypreIJIface::m_solverSetupPtr) (HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
inlineprivate

◆ m_solverSolvePtr

HypreIntType(* amrex::HypreIJIface::m_solverSolvePtr) (HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
inlineprivate

◆ m_verbose

int amrex::HypreIJIface::m_verbose {0}
private

Verbosity of the HYPRE solvers.

◆ m_write_counter

unsigned int amrex::HypreIJIface::m_write_counter {0}
private

◆ m_write_files

bool amrex::HypreIJIface::m_write_files {false}
private

Flag indicating whether to dump matrix files.


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