3#include <AMReX_Config.H>
22 static constexpr int M = 7;
23 static constexpr int P = 3;
27 using array_type = GpuArray<
Real,(M+2)*(M+1)/2>;
35 Array4<Real const> gp;
43 std::ostream&
operator<< (std::ostream& os, Moments
const& mom);
46#if defined(AMREX_USE_CUDA) || defined(AMREX_USE_HIP)
51 AMREX_HIP_OR_CUDA(HIP_DYNAMIC_SHARED(openbc::Moments::array_type,amrex_openbc_momarray);,
52 extern __shared__ openbc::Moments::array_type amrex_openbc_momarray[];)
53 return amrex_openbc_momarray;
123 void useHypre (
bool use_hypre)
noexcept;
166 int m_bottom_verbose = 0;
171 std::unique_ptr<MLPoisson> m_poisson_1;
172 std::unique_ptr<MLPoisson> m_poisson_2;
173 std::unique_ptr<MLMG> m_mlmg_1;
174 std::unique_ptr<MLMG> m_mlmg_2;
177 int m_coarsen_ratio = 0;
184 int m_nthreads_momtag;
187 int m_nblocks_local = 0;
#define AMREX_HIP_OR_CUDA(a, b)
Definition AMReX_GpuControl.H:21
#define AMREX_GPU_DEVICE
Definition AMReX_GpuQualifiers.H:18
Array4< int const > offset
Definition AMReX_HypreMLABecLap.cpp:1139
A collection of Boxes stored in an Array.
Definition AMReX_BoxArray.H:568
A collection (stored as an array) of FArrayBox objects.
Definition AMReX_MultiFab.H:40
Open Boundary Poisson Solver.
Definition AMReX_OpenBC.H:70
OpenBCSolver()=default
Construct an empty solver; call define() before solving.
OpenBCSolver & operator=(const OpenBCSolver &)=delete
void interpolate_potential(MultiFab &solg)
Interpolate coarse potential values back onto the grown solution domain.
Definition AMReX_OpenBC.cpp:803
void setVerbose(int v) noexcept
Control verbosity (0 = silent) via v.
Definition AMReX_OpenBC.cpp:197
Real solve(const Vector< MultiFab * > &a_sol, const Vector< MultiFab const * > &a_rhs, Real a_tol_rel, Real a_tol_abs)
Solve the isolated Poisson problem.
Definition AMReX_OpenBC.cpp:218
void useHypre(bool use_hypre) noexcept
Toggle the Hypre bottom solver (requires Hypre-enabled build).
Definition AMReX_OpenBC.cpp:207
OpenBCSolver(const OpenBCSolver &)=delete
void compute_potential(Gpu::DeviceVector< openbc::Moments > const &moments)
Evaluate the coarse potential contribution from precomputed moments.
Definition AMReX_OpenBC.cpp:738
OpenBCSolver(OpenBCSolver &&)=delete
void compute_moments(Gpu::DeviceVector< openbc::Moments > &moments)
Build per-face multipole moments that summarize solution derivatives.
Definition AMReX_OpenBC.cpp:396
void setBottomVerbose(int v) noexcept
Control bottom solver verbosity via v.
Definition AMReX_OpenBC.cpp:202
void define(const Vector< Geometry > &a_geom, const Vector< BoxArray > &a_grids, const Vector< DistributionMapping > &a_dmap, const LPInfo &a_info=LPInfo())
Initialize/refresh the solver.
Definition AMReX_OpenBC.cpp:16
Dynamically allocated vector for trivially copyable data.
Definition AMReX_PODVector.H:308
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition AMReX_Vector.H:28
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:79
std::array< T, N > Array
Definition AMReX_Array.H:26
std::ostream & operator<<(std::ostream &os, Moments const &mom)
Definition AMReX_OpenBC.cpp:880
Definition AMReX_Amr.cpp:49
BoxND< 3 > Box
Box is an alias for amrex::BoxND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:30
BottomSolver
Definition AMReX_MLLinOp.H:31
__device__ openbc::Moments::array_type * dataPtr() noexcept
Definition AMReX_OpenBC.H:50
Definition AMReX_GpuMemory.H:125
Definition AMReX_MLLinOp.H:36