1 #ifndef AMREX_HYPREIJIFACE_H
2 #define AMREX_HYPREIJIFACE_H
3 #include <AMReX_Config.H>
8 #include <HYPRE_parcsr_ls.h>
9 #include <HYPRE_parcsr_mv.h>
36 [[nodiscard]] HYPRE_IJMatrix
A() {
return m_mat; }
39 [[nodiscard]] HYPRE_IJVector
b() {
return m_rhs; }
42 [[nodiscard]] HYPRE_IJVector
x() {
return m_sln; }
54 void init_solver(
const std::string& prefix,
const std::string& name);
90 HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector){
nullptr};
92 HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector){
nullptr};
95 HYPRE_PtrToParSolverFcn,
96 HYPRE_PtrToParSolverFcn,
97 HYPRE_Solver){
nullptr};
101 HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector){
nullptr};
103 HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector){
nullptr};
int MPI_Comm
Definition: AMReX_ccse-mpi.H:47
static constexpr int MPI_COMM_NULL
Definition: AMReX_ccse-mpi.H:55
Definition: AMReX_HypreIJIface.H:16
bool m_write_files
Flag indicating whether to dump matrix files.
Definition: AMReX_HypreIJIface.H:139
MPI_Comm m_comm
Definition: AMReX_HypreIJIface.H:75
HypreIntType(* m_solverSetupPtr)(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
Definition: AMReX_HypreIJIface.H:89
HypreIJIface & operator=(HypreIJIface const &)=delete
std::string m_solver_name
Definition: AMReX_HypreIJIface.H:117
void pcg_solver_configure(const std::string &prefix)
Definition: AMReX_HypreIJIface.cpp:575
void gmres_solver_configure(const std::string &prefix)
Definition: AMReX_HypreIJIface.cpp:433
void bicgstab_solver_configure(const std::string &prefix)
Definition: AMReX_HypreIJIface.cpp:548
void boomeramg_solver_configure(const std::string &prefix)
Definition: AMReX_HypreIJIface.cpp:376
void parse_inputs(const std::string &prefix="hypre")
Definition: AMReX_HypreIJIface.cpp:172
void lgmres_solver_configure(const std::string &prefix)
Definition: AMReX_HypreIJIface.cpp:492
void flex_gmres_solver_configure(const std::string &prefix)
Definition: AMReX_HypreIJIface.cpp:520
~HypreIJIface()
Definition: AMReX_HypreIJIface.cpp:81
void hybrid_solver_configure(const std::string &prefix)
Definition: AMReX_HypreIJIface.cpp:601
HYPRE_ParVector m_parRhs
Definition: AMReX_HypreIJIface.H:82
HypreIntType(* m_precondSetupPtr)(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
Definition: AMReX_HypreIJIface.H:100
HYPRE_IJVector m_sln
Definition: AMReX_HypreIJIface.H:79
HYPRE_IJMatrix A()
IJ matrix instance.
Definition: AMReX_HypreIJIface.H:36
int m_verbose
Verbosity of the HYPRE solvers.
Definition: AMReX_HypreIJIface.H:122
HYPRE_IJVector b()
Right hand side IJ vector instance.
Definition: AMReX_HypreIJIface.H:39
HypreIntType(* m_solverFinalResidualNormPtr)(HYPRE_Solver, amrex::Real *)
Definition: AMReX_HypreIJIface.H:109
HypreIJIface(HypreIJIface const &)=delete
HypreRealType m_final_res_norm
Definition: AMReX_HypreIJIface.H:114
std::string m_file_prefix
Definition: AMReX_HypreIJIface.H:119
HypreIntType(* m_precondSolvePtr)(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
Definition: AMReX_HypreIJIface.H:102
HYPRE_Solver m_solver
Definition: AMReX_HypreIJIface.H:85
HypreIntType getNumIters() const
Number of iterations taken by the solver to reach the desired tolerance.
Definition: AMReX_HypreIJIface.H:45
void boomeramg_precond_configure(const std::string &prefix)
Definition: AMReX_HypreIJIface.cpp:235
HypreIntType(* m_solverSetMaxIterPtr)(HYPRE_Solver, HypreIntType)
Definition: AMReX_HypreIJIface.H:107
void cogmres_solver_configure(const std::string &prefix)
Definition: AMReX_HypreIJIface.cpp:464
HypreIntType(* m_solverSolvePtr)(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
Definition: AMReX_HypreIJIface.H:91
bool m_overwrite_files
Flag indicating whether the files are overwritten on subsequent writes.
Definition: AMReX_HypreIJIface.H:142
HYPRE_Int HypreIntType
Definition: AMReX_HypreIJIface.H:18
std::string m_preconditioner_name
Definition: AMReX_HypreIJIface.H:118
HypreIJIface(HypreIJIface &&)=delete
HYPRE_ParCSRMatrix m_parA
Definition: AMReX_HypreIJIface.H:81
HypreIntType m_ilower
Definition: AMReX_HypreIJIface.H:111
HypreIntType m_iupper
Definition: AMReX_HypreIJIface.H:112
bool adjustSingularMatrix() const
Definition: AMReX_HypreIJIface.H:50
HypreRealType getFinalResidualNorm() const
Final residual norm after a linear solve.
Definition: AMReX_HypreIJIface.H:48
void run_hypre_setup()
run_setup
Definition: AMReX_HypreIJIface.cpp:101
unsigned int m_write_counter
Definition: AMReX_HypreIJIface.H:124
HYPRE_Real HypreRealType
Definition: AMReX_HypreIJIface.H:19
HYPRE_IJVector m_rhs
Definition: AMReX_HypreIJIface.H:78
HypreIntType(* m_solverDestroyPtr)(HYPRE_Solver)
Definition: AMReX_HypreIJIface.H:88
HYPRE_ParVector m_parSln
Definition: AMReX_HypreIJIface.H:83
HYPRE_IJMatrix m_mat
Definition: AMReX_HypreIJIface.H:77
HypreIntType m_num_iterations
Definition: AMReX_HypreIJIface.H:115
HypreIntType(* m_solverSetAbsTolPtr)(HYPRE_Solver, amrex::Real)
Definition: AMReX_HypreIJIface.H:106
HYPRE_Solver m_precond
Definition: AMReX_HypreIJIface.H:86
bool m_recompute_preconditioner
Flag indicating whether user has requested recomputation of preconditioner.
Definition: AMReX_HypreIJIface.H:133
bool m_has_preconditioner
Flag indicating whether a preconditioner has been set.
Definition: AMReX_HypreIJIface.H:127
void init_solver(const std::string &prefix, const std::string &name)
Definition: AMReX_HypreIJIface.cpp:211
HypreIntType(* m_precondDestroyPtr)(HYPRE_Solver)
Definition: AMReX_HypreIJIface.H:99
HYPRE_IJVector x()
Solution IJ vector instance.
Definition: AMReX_HypreIJIface.H:42
void solve(HypreRealType rel_tol, HypreRealType abs_tol, HypreIntType max_iter)
Definition: AMReX_HypreIJIface.cpp:121
bool m_need_setup
Flag indicating whether the solver/preconditioner has been setup.
Definition: AMReX_HypreIJIface.H:130
void run_hypre_solve()
Definition: AMReX_HypreIJIface.cpp:115
bool m_adjust_singular_matrix
Should singular matrix be adjusted to fix solution on a node/cell?
Definition: AMReX_HypreIJIface.H:136
HypreIntType(* m_solverPrecondPtr)(HYPRE_Solver, HYPRE_PtrToParSolverFcn, HYPRE_PtrToParSolverFcn, HYPRE_Solver)
Definition: AMReX_HypreIJIface.H:93
void euclid_precond_configure(const std::string &prefix)
Definition: AMReX_HypreIJIface.cpp:356
HypreIntType(* m_solverSetTolPtr)(HYPRE_Solver, amrex::Real)
Definition: AMReX_HypreIJIface.H:105
HypreIJIface(MPI_Comm comm, HypreIntType ilower, HypreIntType iupper, int verbose)
Definition: AMReX_HypreIJIface.cpp:63
HypreIntType(* m_solverNumItersPtr)(HYPRE_Solver, HypreIntType *)
Definition: AMReX_HypreIJIface.H:108
void init_preconditioner(const std::string &prefix, const std::string &name)
Definition: AMReX_HypreIJIface.cpp:199
Definition: AMReX_Amr.cpp:49
int verbose
Definition: AMReX_DistributionMapping.cpp:36