1 #ifndef AMREX_MLNODEABECLAP_2D_K_H_
2 #define AMREX_MLNODEABECLAP_2D_K_H_
8 Array4<Real const>
const& rhs,
10 Array4<Real const>
const& acf,
11 Array4<Real const>
const& bcf,
12 Array4<int const>
const& msk,
13 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
15 Real facx = Real(1.0/6.0)*dxinv[0]*dxinv[0];
16 Real facy = Real(1.0/6.0)*dxinv[1]*dxinv[1];
17 Real fxy = facx + facy;
18 Real f2xmy = Real(2.0)*facx - facy;
19 Real fmx2y = Real(2.0)*facy - facx;
24 sol(i,j,k) = Real(0.0);
26 Real s0 = (-Real(2.0))*fxy*(bcf(i-1,j-1,k)+bcf(i,j-1,k)+bcf(i-1,j,k)+bcf(i,j,k));
27 Real lap = sol(i-1,j-1,k)*fxy*bcf(i-1,j-1,k)
28 + sol(i+1,j-1,k)*fxy*bcf(i ,j-1,k)
29 + sol(i-1,j+1,k)*fxy*bcf(i-1,j ,k)
30 + sol(i+1,j+1,k)*fxy*bcf(i ,j ,k)
31 + sol(i-1,j,k)*f2xmy*(bcf(i-1,j-1,k)+bcf(i-1,j,k))
32 + sol(i+1,j,k)*f2xmy*(bcf(i ,j-1,k)+bcf(i ,j,k))
33 + sol(i,j-1,k)*fmx2y*(bcf(i-1,j-1,k)+bcf(i,j-1,k))
34 + sol(i,j+1,k)*fmx2y*(bcf(i-1,j ,k)+bcf(i,j ,k))
36 Real Ax = alpha*acf(i,j,k)*sol(i,j,k) - beta*lap;
38 sol(i,j,k) += (rhs(i,j,k) - Ax) / (alpha*acf(i,j,k)-beta*s0);
45 Real lap, Array4<Real const>
const& rhs,
46 Real alpha, Real beta,
47 Array4<Real const>
const& acf,
48 Array4<Real const>
const& bcf,
49 Array4<int const>
const& msk,
50 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
53 sol(i,j,k) = Real(0.0);
55 Real fac = -Real(2.0/6.0)*(dxinv[0]*dxinv[0] + dxinv[1]*dxinv[1]);
56 Real s0 = fac*(bcf(i-1,j-1,k)+bcf(i,j-1,k)+bcf(i-1,j,k)+bcf(i,j,k));
57 Real Ax = alpha*acf(i,j,k)*sol(i,j,k) - beta*lap;
59 sol(i,j,k) += Real(2.0/3.0) * (rhs(i,j,k) - Ax)
60 / (alpha*acf(i,j,k)-beta*s0);
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_DEVICE
Definition: AMReX_GpuQualifiers.H:18
Definition: AMReX_Amr.cpp:49
BoxND< AMREX_SPACEDIM > Box
Definition: AMReX_BaseFwd.H:27
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void mlndabeclap_jacobi_aa(int, int, int, Array4< Real > const &, Real, Array4< Real const > const &, Real, Real, Array4< Real const > const &, Array4< Real const > const &, Array4< int const > const &, GpuArray< Real, AMREX_SPACEDIM > const &) noexcept
Definition: AMReX_MLNodeABecLap_1D_K.H:17
void mlndabeclap_gauss_seidel_aa(Box const &, Array4< Real > const &, Array4< Real const > const &, Real, Real, Array4< Real const > const &, Array4< Real const > const &, Array4< int const > const &, GpuArray< Real, AMREX_SPACEDIM > const &) noexcept
Definition: AMReX_MLNodeABecLap_1D_K.H:7
AMREX_GPU_HOST_DEVICE AMREX_ATTRIBUTE_FLATTEN_FOR void Loop(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition: AMReX_Loop.H:125