1 #ifndef AMREX_MLEBABECLAP_K_H_
2 #define AMREX_MLEBABECLAP_K_H_
3 #include <AMReX_Config.H>
9 #if (AMREX_SPACEDIM == 2)
27 int maxorder, Real dxinv,
int inhomog,
int icomp) noexcept
32 const int s = 1-2*side;
36 for (
int k = lo.z; k <= hi.z; ++k) {
37 for (
int j = lo.y; j <= hi.y; ++j) {
38 if (
mask(i,j,k) == 0 &&
mask(i+s,j,k) == 1) {
39 phi(i,j,k,icomp) = phi(i+s,j,k,icomp);
47 for (
int k = lo.z; k <= hi.z; ++k) {
48 for (
int j = lo.y; j <= hi.y; ++j) {
49 if (
mask(i,j,k) == 0 &&
mask(i+s,j,k) == 1) {
50 phi(i,j,k,icomp) = -phi(i+s,j,k,icomp);
61 for (
int r = 0;
r <= maxorder-2; ++
r) {
64 for (
int k = lo.z; k <= hi.z; ++k) {
65 for (
int j = lo.y; j <= hi.y; ++j) {
66 if (
mask(i,j,k) == 0 &&
mask(i+s,j,k) == 1) {
68 bool has_cutfaces =
false;
69 for (
int r = 0;
r <= NX-2; ++
r) {
70 Real a = area(i+(1-side)+s*
r,j,k);
80 if (has_cutfaces) { order =
amrex::min(2,order); }
83 phi(i,j,k,icomp) = bcval(i,j,k,icomp);
85 phi(i,j,k,icomp) = Real(0.0);
89 for (
int m = 1; m < order; ++m) {
90 tmp += phi(i+m*s,j,k,icomp) * coef(m,order-2);
92 phi(i,j,k,icomp) = tmp;
94 phi(i,j,k,icomp) += bcval(i,j,k,icomp)*coef(0,order-2);
113 int maxorder, Real dyinv,
int inhomog,
int icomp) noexcept
118 const int s = 1-2*side;
122 for (
int k = lo.z; k <= hi.z; ++k) {
123 for (
int i = lo.x; i <= hi.x; ++i) {
124 if (
mask(i,j,k) == 0 &&
mask(i,j+s,k) == 1) {
125 phi(i,j,k,icomp) = phi(i,j+s,k,icomp);
133 for (
int k = lo.z; k <= hi.z; ++k) {
134 for (
int i = lo.x; i <= hi.x; ++i) {
135 if (
mask(i,j,k) == 0 &&
mask(i,j+s,k) == 1) {
136 phi(i,j,k,icomp) = -phi(i,j+s,k,icomp);
147 for (
int r = 0;
r <= maxorder-2; ++
r) {
150 for (
int k = lo.z; k <= hi.z; ++k) {
151 for (
int i = lo.x; i <= hi.x; ++i) {
152 if (
mask(i,j,k) == 0 &&
mask(i,j+s,k) == 1) {
154 bool has_cutfaces =
false;
155 for (
int r = 0;
r <= NX-2; ++
r) {
156 Real a = area(i,j+(1-side)+s*
r,k);
166 if (has_cutfaces) { order =
amrex::min(2,order); }
169 phi(i,j,k,icomp) = bcval(i,j,k,icomp);
171 phi(i,j,k,icomp) = Real(0.0);
174 Real tmp = Real(0.0);
175 for (
int m = 1; m < order; ++m) {
176 tmp += phi(i,j+m*s,k,icomp) * coef(m,order-2);
178 phi(i,j,k,icomp) = tmp;
180 phi(i,j,k,icomp) += bcval(i,j,k,icomp)*coef(0,order-2);
199 int maxorder, Real dzinv,
int inhomog,
int icomp) noexcept
204 const int s = 1-2*side;
208 for (
int j = lo.y; j <= hi.y; ++j) {
209 for (
int i = lo.x; i <= hi.x; ++i) {
210 if (
mask(i,j,k) == 0 &&
mask(i,j,k+s) == 1) {
211 phi(i,j,k,icomp) = phi(i,j,k+s,icomp);
219 for (
int j = lo.y; j <= hi.y; ++j) {
220 for (
int i = lo.x; i <= hi.x; ++i) {
221 if (
mask(i,j,k) == 0 &&
mask(i,j,k+s) == 1) {
222 phi(i,j,k,icomp) = -phi(i,j,k+s,icomp);
233 for (
int r = 0;
r <= maxorder-2; ++
r) {
236 for (
int j = lo.y; j <= hi.y; ++j) {
237 for (
int i = lo.x; i <= hi.x; ++i) {
238 if (
mask(i,j,k) == 0 &&
mask(i,j,k+s) == 1) {
240 bool has_cutfaces =
false;
241 for (
int r = 0;
r <= NX-2; ++
r) {
242 Real a = area(i,j,k+(1-side)+s*
r);
252 if (has_cutfaces) { order =
amrex::min(2,order); }
255 phi(i,j,k,icomp) = bcval(i,j,k,icomp);
257 phi(i,j,k,icomp) = Real(0.0);
260 Real tmp = Real(0.0);
261 for (
int m = 1; m < order; ++m) {
262 tmp += phi(i,j,k+m*s,icomp) * coef(m,order-2);
264 phi(i,j,k,icomp) = tmp;
266 phi(i,j,k,icomp) += bcval(i,j,k,icomp)*coef(0,order-2);
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
Array4< int const > mask
Definition: AMReX_InterpFaceRegister.cpp:93
#define AMREX_LO_NEUMANN
Definition: AMReX_LO_BCTYPES.H:6
#define AMREX_LO_DIRICHLET
Definition: AMReX_LO_BCTYPES.H:5
#define AMREX_LO_REFLECT_ODD
Definition: AMReX_LO_BCTYPES.H:7
Maintain an identifier for boundary condition types.
Definition: AMReX_BoundCond.H:20
Definition: AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebabeclap_apply_bc_z(int side, Box const &box, int blen, Array4< Real > const &phi, Array4< int const > const &mask, Array4< Real const > const &area, BoundCond bct, Real bcl, Array4< Real const > const &bcval, int maxorder, Real dzinv, int inhomog, int icomp) noexcept
Definition: AMReX_MLEBABecLap_K.H:193
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebabeclap_apply_bc_y(int side, Box const &box, int blen, Array4< Real > const &phi, Array4< int const > const &mask, Array4< Real const > const &area, BoundCond bct, Real bcl, Array4< Real const > const &bcval, int maxorder, Real dyinv, int inhomog, int icomp) noexcept
Definition: AMReX_MLEBABecLap_K.H:107
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & min(const T &a, const T &b) noexcept
Definition: AMReX_Algorithm.H:21
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void poly_interp_coeff(T xInt, T const *AMREX_RESTRICT x, int N, T *AMREX_RESTRICT c) noexcept
Definition: AMReX_LOUtil_K.H:24
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 ubound(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:315
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 lbound(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:308
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebabeclap_apply_bc_x(int side, Box const &box, int blen, Array4< Real > const &phi, Array4< int const > const &mask, Array4< Real const > const &area, BoundCond bct, Real bcl, Array4< Real const > const &bcval, int maxorder, Real dxinv, int inhomog, int icomp) noexcept
Definition: AMReX_MLEBABecLap_K.H:21
Definition: AMReX_Array.H:282
Definition: AMReX_Array4.H:61
Definition: AMReX_Array.H:34