1 #ifndef AMREX_MLEBNODEFDLAP_K_H_
2 #define AMREX_MLEBNODEFDLAP_K_H_
3 #include <AMReX_Config.H>
8 #if (AMREX_SPACEDIM == 1)
10 #elif (AMREX_SPACEDIM == 2)
24 if (dmsk(i,j,k) >= 0 && dmsk(i+1,j,k) >= 0) {
25 px(i,j,k) = dxi * (p(i+1,j,k) - p(i,j,k));
26 }
else if (dmsk(i,j,k) < 0 && dmsk(i+1,j,k) < 0) {
27 px(i,j,k) = Real(0.0);
28 }
else if (dmsk(i,j,k) < 0) {
29 px(i,j,k) = dxi * (p(i+1,j,k) - phieb(i,j,k)) / (Real(1.0) - Real(2.0) * ecx(i,j,k));
31 px(i,j,k) = dxi * (phieb(i+1,j,k) - p(i,j,k)) / (Real(1.0) + Real(2.0) * ecx(i,j,k));
41 if (dmsk(i,j,k) >= 0 && dmsk(i,j+1,k) >= 0) {
42 py(i,j,k) = dyi * (p(i,j+1,k) - p(i,j,k));
43 }
else if (dmsk(i,j,k) < 0 && dmsk(i,j+1,k) < 0) {
44 py(i,j,k) = Real(0.0);
45 }
else if (dmsk(i,j,k) < 0) {
46 py(i,j,k) = dyi * (p(i,j+1,k) - phieb(i,j,k)) / (Real(1.0) - Real(2.0) * ecy(i,j,k));
48 py(i,j,k) = dyi * (phieb(i,j+1,k) - p(i,j,k)) / (Real(1.0) + Real(2.0) * ecy(i,j,k));
52 #if (AMREX_SPACEDIM > 2)
55 void mlebndfdlap_grad_z_doit (
int i,
int j,
int k, Array4<Real>
const& pz,
56 Array4<Real const>
const& p, Array4<int const>
const& dmsk,
57 Array4<Real const>
const& ecz, F
const& phieb, Real dzi)
59 if (dmsk(i,j,k) >= 0 && dmsk(i,j,k+1) >= 0) {
60 pz(i,j,k) = dzi * (p(i,j,k+1) - p(i,j,k));
61 }
else if (dmsk(i,j,k) < 0 && dmsk(i,j,k+1) < 0) {
62 pz(i,j,k) = Real(0.0);
63 }
else if (dmsk(i,j,k) < 0) {
64 pz(i,j,k) = dzi * (p(i,j,k+1) - phieb(i,j,k)) / (Real(1.0) - Real(2.0) * ecz(i,j,k));
66 pz(i,j,k) = dzi * (phieb(i,j,k+1) - p(i,j,k)) / (Real(1.0) + Real(2.0) * ecz(i,j,k));
79 [=] (
int,
int,
int) -> Real {
return phieb; },
92 [=] (
int i1,
int i2,
int i3) -> Real {
return phieb(i1,i2,i3); },
100 Real phieb, Real dyi)
105 [=] (
int,
int,
int) -> Real {
return phieb; },
118 [=] (
int i1,
int i2,
int i3) -> Real {
return phieb(i1,i2,i3); },
123 #if (AMREX_SPACEDIM > 2)
126 void mlebndfdlap_grad_z (
Box const& b, Array4<Real>
const& pz, Array4<Real const>
const& p,
127 Array4<int const>
const& dmsk, Array4<Real const>
const& ecz,
128 Real phieb, Real dzi)
132 mlebndfdlap_grad_z_doit(i,j,k, pz, p, dmsk, ecz,
133 [=] (
int,
int,
int) -> Real {
return phieb; },
139 void mlebndfdlap_grad_z (
Box const& b, Array4<Real>
const& pz, Array4<Real const>
const& p,
140 Array4<int const>
const& dmsk, Array4<Real const>
const& ecz,
141 Array4<Real const>
const& phieb, Real dzi)
145 mlebndfdlap_grad_z_doit(i,j,k, pz, p, dmsk, ecz,
146 [=] (
int i1,
int i2,
int i3) -> Real {
return phieb(i1,i2,i3); },
159 px(i,j,k) = dxi * (p(i+1,j,k) - p(i,j,k));
163 #if (AMREX_SPACEDIM > 1)
170 py(i,j,k) = dyi * (p(i,j+1,k) - p(i,j,k));
175 #if (AMREX_SPACEDIM > 2)
177 void mlebndfdlap_grad_z (
Box const& b, Array4<Real>
const& pz, Array4<Real const>
const& p,
182 pz(i,j,k) = dzi * (p(i,j,k+1) - p(i,j,k));
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
#define AMREX_LOOP_3D(bx, i, j, k, block)
Definition: AMReX_Loop.nolint.H:4
Definition: AMReX_Amr.cpp:49
BoxND< AMREX_SPACEDIM > Box
Definition: AMReX_BaseFwd.H:27
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebndfdlap_grad_x(Box const &b, Array4< Real > const &px, Array4< Real const > const &p, Array4< int const > const &dmsk, Array4< Real const > const &ecx, Real phieb, Real dxi)
Definition: AMReX_MLEBNodeFDLap_K.H:72
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebndfdlap_grad_y_doit(int i, int j, int k, Array4< Real > const &py, Array4< Real const > const &p, Array4< int const > const &dmsk, Array4< Real const > const &ecy, F const &phieb, Real dyi)
Definition: AMReX_MLEBNodeFDLap_K.H:37
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebndfdlap_grad_x_doit(int i, int j, int k, Array4< Real > const &px, Array4< Real const > const &p, Array4< int const > const &dmsk, Array4< Real const > const &ecx, F const &phieb, Real dxi)
Definition: AMReX_MLEBNodeFDLap_K.H:20
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebndfdlap_grad_y(Box const &b, Array4< Real > const &py, Array4< Real const > const &p, Array4< int const > const &dmsk, Array4< Real const > const &ecy, Real phieb, Real dyi)
Definition: AMReX_MLEBNodeFDLap_K.H:98
Definition: AMReX_Array4.H:61