65 [[nodiscard]] HYPRE_IJMatrix
A() {
return m_mat; }
68 [[nodiscard]] HYPRE_IJVector
b() {
return m_rhs; }
71 [[nodiscard]] HYPRE_IJVector
x() {
return m_sln; }
82 void init_preconditioner(
const std::string& prefix,
const std::string& name);
83 void init_solver(
const std::string& prefix,
const std::string& name);
86 void run_hypre_setup();
87 void run_hypre_solve();
90 void boomeramg_precond_configure(
const std::string& prefix);
91 void euclid_precond_configure(
const std::string& prefix);
92 void ilu_precond_configure(
const std::string& prefix);
95 void boomeramg_solver_configure(
const std::string& prefix);
96 void gmres_solver_configure(
const std::string& prefix);
97 void cogmres_solver_configure(
const std::string& prefix);
98 void lgmres_solver_configure(
const std::string& prefix);
99 void flex_gmres_solver_configure(
const std::string& prefix);
100 void bicgstab_solver_configure(
const std::string& prefix);
101 void pcg_solver_configure(
const std::string& prefix);
102 void hybrid_solver_configure(
const std::string& prefix);
107 HYPRE_IJMatrix m_mat{
nullptr};
108 HYPRE_IJVector m_rhs{
nullptr};
109 HYPRE_IJVector m_sln{
nullptr};
111 HYPRE_ParCSRMatrix m_parA{
nullptr};
112 HYPRE_ParVector m_parRhs{
nullptr};
113 HYPRE_ParVector m_parSln{
nullptr};
115 HYPRE_Solver m_solver{
nullptr};
116 HYPRE_Solver m_precond{
nullptr};
118 HypreIntType (*m_solverDestroyPtr)(HYPRE_Solver){
nullptr};
120 HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector){
nullptr};
122 HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector){
nullptr};
125 HYPRE_PtrToParSolverFcn,
126 HYPRE_PtrToParSolverFcn,
127 HYPRE_Solver){
nullptr};
129 HypreIntType (*m_precondDestroyPtr)(HYPRE_Solver){
nullptr};
131 HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector){
nullptr};
133 HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector){
nullptr};
147 std::string m_solver_name{
"BoomerAMG"};
148 std::string m_preconditioner_name{
"none"};
149 std::string m_file_prefix{
"IJ"};
154 unsigned int m_write_counter{0};
157 bool m_has_preconditioner{
false};
160 bool m_need_setup{
true};
163 bool m_recompute_preconditioner{
true};
166 bool m_adjust_singular_matrix{
false};
169 bool m_write_files{
false};
172 bool m_overwrite_files{
true};
void parse_inputs(const std::string &prefix="hypre")
Parse runtime options (solver, preconditioner, tolerances).
Definition AMReX_HypreIJIface.cpp:162
HypreIntType getNumIters() const
Number of iterations taken by the solver to reach the desired tolerance.
Definition AMReX_HypreIJIface.H:74
void solve(HypreRealType rel_tol, HypreRealType abs_tol, HypreIntType max_iter)
Solve the linear system using the configured solver/preconditioner.
Definition AMReX_HypreIJIface.cpp:111