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& strphi =
m_strphi(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);
36 bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k)
noexcept {
37 amrex::Real cp1, c, cm1, ux, uy, uz, vx, vy, vz, wx, wy, wz;
42 ux = (cp1 * phi(i + 1, j, k, 0) + c * phi(i, j, k, 0) +
43 cm1 * phi(i - 1, j, k, 0)) *
45 vx = (cp1 * phi(i + 1, j, k, 1) + c * phi(i, j, k, 1) +
46 cm1 * phi(i - 1, j, k, 1)) *
48 wx = (cp1 * phi(i + 1, j, k, 2) + c * phi(i, j, k, 2) +
49 cm1 * phi(i - 1, j, k, 2)) *
56 uy = (cp1 * phi(i, j + 1, k, 0) + c * phi(i, j, k, 0) +
57 cm1 * phi(i, j - 1, k, 0)) *
59 vy = (cp1 * phi(i, j + 1, k, 1) + c * phi(i, j, k, 1) +
60 cm1 * phi(i, j - 1, k, 1)) *
62 wy = (cp1 * phi(i, j + 1, k, 2) + c * phi(i, j, k, 2) +
63 cm1 * phi(i, j - 1, k, 2)) *
70 uz = (cp1 * phi(i, j, k + 1, 0) + c * phi(i, j, k, 0) +
71 cm1 * phi(i, j, k - 1, 0)) *
73 vz = (cp1 * phi(i, j, k + 1, 1) + c * phi(i, j, k, 1) +
74 cm1 * phi(i, j, k - 1, 1)) *
76 wz = (cp1 * phi(i, j, k + 1, 2) + c * phi(i, j, k, 2) +
77 cm1 * phi(i, j, k - 1, 2)) *
80 strphi(i, j, k) = sqrt(
81 2.0 * std::pow(ux, 2) + 2.0 * std::pow(vy, 2) +
82 2.0 * std::pow(wz, 2) + std::pow(uy + vx, 2) +
83 std::pow(vz + wy, 2) + std::pow(wx + uz, 2));