3#include <AMReX_Config.H>
10#include "_hypre_utilities.h"
11#include "HYPRE_parcsr_ls.h"
32namespace HypreDefaults {
34 inline constexpr bool gpu =
true;
36 inline constexpr bool gpu =
false;
120 int max_iter,
const BndryData& bndry,
int max_bndry_order) = 0;
129 }
else if ((i <= 0) || (i & 1)) {
138 const auto& v = b.
loVect();
140 static_cast<HYPRE_Int
>(v[1]),
141 static_cast<HYPRE_Int
>(v[2]))};
146 const auto& v = b.
hiVect();
148 static_cast<HYPRE_Int
>(v[1]),
149 static_cast<HYPRE_Int
>(v[2]))};
208[[nodiscard]] std::unique_ptr<Hypre>
209makeHypre (
const BoxArray& grids,
const DistributionMapping& dmap,
211 const iMultiFab* overset_mask =
nullptr);
Boundary data container that owns masks, boundary values, and metadata.
Problem-domain geometry: maps between index space and physical space.
HYPRE_Solver solver
HYPRE solver/preconditioner whose options are being set.
Definition AMReX_HypreIJIface.cpp:21
GpuArray< Real, 3 > beta
Definition AMReX_MLEBNodeFDLaplacian.cpp:1834
#define AMREX_D_TERM(a, b, c)
Definition AMReX_SPACE.H:172
#define AMREX_D_DECL(a, b, c)
Definition AMReX_SPACE.H:171
#define BL_SPACEDIM
Definition AMReX_SPACE.H:15
Reference-counted collection of Boxes.
Definition AMReX_BoxArray.H:681
__host__ __device__ const int * hiVect() const &noexcept
Return a pointer to the high-end coordinates (useful for Fortran calls).
Definition AMReX_Box.H:210
__host__ __device__ const int * loVect() const &noexcept
Return a pointer to the low-end coordinates (useful for Fortran calls).
Definition AMReX_Box.H:205
Calculates the distribution of FABs to MPI processes.
Definition AMReX_DistributionMapping.H:51
Abstract factory interface for creating, aliasing, and destroying FAB objects.
Definition AMReX_FabFactory.H:73
Rectangular problem domain geometry.
Definition AMReX_Geometry.H:85
Lightweight base class shared by HYPRE-backed linear solvers, HypreABecLap, HypreABecLap2,...
Definition AMReX_Hypre.H:66
static Array< HYPRE_Int, 3 > hiV(const Box &b)
Convenience helper that casts a box's high corner to HYPRE_Int.
Definition AMReX_Hypre.H:145
bool is_matrix_singular
Definition AMReX_Hypre.H:194
void setBCoeffs(const Array< const MultiFab *, 3 > &beta)
Install per-face b coefficients for each spatial direction.
Definition AMReX_Hypre.cpp:76
Array< MultiFab, 3 > bcoefs
Definition AMReX_Hypre.H:187
void setHypreOldDefault(bool l) noexcept
Toggle HYPRE's "old default" AMG setup (Falgout + modified classical interpolation) via l.
Definition AMReX_Hypre.H:157
void setVerbose(int _verbose)
Set HYPRE verbosity level (_verbose).
Definition AMReX_Hypre.cpp:85
MultiFab acoefs
Definition AMReX_Hypre.H:186
int verbose
Definition AMReX_Hypre.H:177
void setHypreStrongThreshold(Real t) noexcept
Adjust HYPRE's AMG strong-connection threshold used during coarsening via t.
Definition AMReX_Hypre.H:165
Hypre(Hypre &&) noexcept=default
void setHypreRelaxType(int n) noexcept
Choose the relaxation type handed to HYPRE (see HYPRE docs for valid codes) via n.
Definition AMReX_Hypre.H:159
static HYPRE_Int ispow2(HYPRE_Int i)
Return 1 if i is a power of two, otherwise 0.
Definition AMReX_Hypre.H:125
static constexpr HYPRE_Int eb_stencil_size
Stencil size used on EB cells (3^D).
Definition AMReX_Hypre.H:170
MPI_Comm comm
Definition AMReX_Hypre.H:174
Real scalar_a
Definition AMReX_Hypre.H:188
BndryData const * m_bndry
Definition AMReX_Hypre.H:191
void setHypreOptionsNamespace(const std::string &ns) noexcept
Override the ParmParse namespace consulted for HYPRE runtime options (ns).
Definition AMReX_Hypre.H:154
int m_maxorder
Definition AMReX_Hypre.H:192
FabFactory< FArrayBox > const * m_factory
Definition AMReX_Hypre.H:190
Real scalar_b
Definition AMReX_Hypre.H:188
Geometry geom
Definition AMReX_Hypre.H:175
std::string options_namespace
Definition AMReX_Hypre.H:184
void setHypreNumSweeps(int n) noexcept
Set the number of pre/post smoothing sweeps HYPRE executes on each level via n.
Definition AMReX_Hypre.H:163
int relax_order
Definition AMReX_Hypre.H:180
static Array< HYPRE_Int, 3 > loV(const Box &b)
Convenience helper that casts a box's low corner to HYPRE_Int.
Definition AMReX_Hypre.H:137
int relax_type
Definition AMReX_Hypre.H:179
int num_sweeps
Definition AMReX_Hypre.H:181
static constexpr HYPRE_Int regular_stencil_size
Stencil size used on regular cells.
Definition AMReX_Hypre.H:168
void setScalars(Real sa, Real sb)
Store constant scalars applied to the a (diagonal) and b (Laplacian) terms.
Definition AMReX_Hypre.cpp:63
Real strong_threshold
Definition AMReX_Hypre.H:182
virtual void solve(MultiFab &soln, const MultiFab &rhs, Real rel_tol, Real abs_tol, int max_iter, const BndryData &bndry, int max_bndry_order)=0
Solve the linear system using the concrete interface implementation.
void setIsMatrixSingular(bool flag)
Flag a singular operator (enables null-space handling in derived classes).
Definition AMReX_Hypre.H:107
void setACoeffs(const MultiFab &alpha)
Install per-cell a coefficients.
Definition AMReX_Hypre.cpp:70
void setHypreRelaxOrder(int n) noexcept
Choose the relaxation ordering (C/F, lexicographic, etc.) via n.
Definition AMReX_Hypre.H:161
Interface
HYPRE interface modes supported.
Definition AMReX_Hypre.H:70
bool old_default
Definition AMReX_Hypre.H:178
A collection (stored as an array) of FArrayBox objects.
Definition AMReX_MultiFab.H:40
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:80
std::array< T, N > Array
Definition AMReX_Array.H:31
constexpr int interp_type
Definition AMReX_Hypre.H:41
constexpr int coarsen_type
Definition AMReX_Hypre.H:40
constexpr bool gpu
Definition AMReX_Hypre.H:36
constexpr int relax_order
Definition AMReX_Hypre.H:45
constexpr int relax_type
Definition AMReX_Hypre.H:44
constexpr bool old_default
Falgout coarsening with modified classical interpolation.
Definition AMReX_Hypre.H:39
constexpr int pmax_elmts
Definition AMReX_Hypre.H:42
void setGpuOptions(HYPRE_Solver solver)
Coarsening, interpolation and transpose options for GPU builds.
Definition AMReX_Hypre.H:48
constexpr int keep_transpose
Definition AMReX_Hypre.H:43
int MPI_Comm
Definition AMReX_ccse-mpi.H:51
static constexpr int MPI_COMM_NULL
Definition AMReX_ccse-mpi.H:59
Definition AMReX_Amr.cpp:50
std::unique_ptr< Hypre > makeHypre(const BoxArray &grids, const DistributionMapping &dmap, const Geometry &geom, MPI_Comm comm_, Hypre::Interface interface, const iMultiFab *overset_mask)
Factory that instantiates the requested HYPRE interface.
Definition AMReX_Hypre.cpp:12