22 void apply(
const int lev,
const amrex::MFIter& mfi)
const
24 const auto& geom =
m_phi.repo().mesh().Geom(lev);
25 const auto& idx = geom.InvCellSizeArray();
26 const auto& curphi =
m_curphi(lev).array(mfi);
27 const auto& phi =
m_phi(lev).const_array(mfi);
29 const auto& bx_in = mfi.tilebox();
30 const auto& bx = Stencil::box(bx_in, geom);
37 [=] AMREX_GPU_DEVICE(
int i,
int j,
int k,
int n)
noexcept {
38 amrex::Real cp1, c, cm1;
39 amrex::Real sp1, s, sm1;
44 const amrex::Real phixx =
45 (sp1 * phi(i + 1, j, k, n) + s * phi(i, j, k, n) +
46 sm1 * phi(i - 1, j, k, n)) *
52 const amrex::Real phiyy =
53 (sp1 * phi(i, j + 1, k, n) + s * phi(i, j, k, n) +
54 sm1 * phi(i, j - 1, k, n)) *
60 const amrex::Real phizz =
61 (sp1 * phi(i, j, k + 1, n) + s * phi(i, j, k, n) +
62 sm1 * phi(i, j, k - 1, n)) *
68 const amrex::Real phiz =
69 (cp1 * phi(i, j, k + 1, n) + c * phi(i, j, k, n) +
70 cm1 * phi(i, j, k - 1, n)) *
72 const amrex::Real phiz_ip1 =
73 (cp1 * phi(i + 1, j, k + 1, n) + c * phi(i + 1, j, k, n) +
74 cm1 * phi(i + 1, j, k - 1, n)) *
76 const amrex::Real phiz_im1 =
77 (cp1 * phi(i - 1, j, k + 1, n) + c * phi(i - 1, j, k, n) +
78 cm1 * phi(i - 1, j, k - 1, n)) *
80 const amrex::Real phiz_jp1 =
81 (cp1 * phi(i, j + 1, k + 1, n) + c * phi(i, j + 1, k, n) +
82 cm1 * phi(i, j + 1, k - 1, n)) *
84 const amrex::Real phiz_jm1 =
85 (cp1 * phi(i, j - 1, k + 1, n) + c * phi(i, j - 1, k, n) +
86 cm1 * phi(i, j - 1, k - 1, n)) *
92 const amrex::Real phiy =
93 (cp1 * phi(i, j + 1, k, n) + c * phi(i, j, k, n) +
94 cm1 * phi(i, j - 1, k, n)) *
96 const amrex::Real phiy_ip1 =
97 (cp1 * phi(i + 1, j + 1, k, n) + c * phi(i + 1, j, k, n) +
98 cm1 * phi(i + 1, j - 1, k, n)) *
100 const amrex::Real phiy_im1 =
101 (cp1 * phi(i - 1, j + 1, k, n) + c * phi(i - 1, j, k, n) +
102 cm1 * phi(i - 1, j - 1, k, n)) *
104 const amrex::Real phiyz =
105 (cp1 * phiz_jp1 + c * phiz + cm1 * phiz_jm1) * idx[1];
110 const amrex::Real phix =
111 (cp1 * phi(i + 1, j, k, n) + c * phi(i, j, k, n) +
112 cm1 * phi(i - 1, j, k, n)) *
114 const amrex::Real phixy =
115 (cp1 * phiy_ip1 + c * phiy + cm1 * phiy_im1) * idx[0];
116 const amrex::Real phixz =
117 (cp1 * phiz_ip1 + c * phiz + cm1 * phiz_im1) * idx[0];
120 -(phix * phix * phiyy - 2. * phix * phiy * phixy +
121 phiy * phiy * phixx + phix * phix * phizz -
122 2. * phix * phiz * phixz + phiz * phiz * phixx +
123 phiy * phiy * phizz - 2. * phiy * phiz * phiyz +
124 phiz * phiz * phiyy) /
125 std::pow(phix * phix + phiy * phiy + phiz * phiz, 1.5);