23 void apply(
const int lev,
const amrex::MFIter& mfi)
const
25 const auto& geom =
m_phi.repo().mesh().Geom(lev);
26 const auto& idx = geom.InvCellSizeArray();
27 const auto& strphi =
m_strphi(lev).array(mfi);
28 const auto& phi =
m_phi(lev).const_array(mfi);
30 const auto& bx_in = mfi.tilebox();
31 const auto& bx = Stencil::box(bx_in, geom);
37 bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k)
noexcept {
38 amrex::Real cp1, c, cm1, ux, uy, uz, vx, vy, vz, wx, wy, wz;
43 ux = (cp1 * phi(i + 1, j, k, 0) + c * phi(i, j, k, 0) +
44 cm1 * phi(i - 1, j, k, 0)) *
46 vx = (cp1 * phi(i + 1, j, k, 1) + c * phi(i, j, k, 1) +
47 cm1 * phi(i - 1, j, k, 1)) *
49 wx = (cp1 * phi(i + 1, j, k, 2) + c * phi(i, j, k, 2) +
50 cm1 * phi(i - 1, j, k, 2)) *
57 uy = (cp1 * phi(i, j + 1, k, 0) + c * phi(i, j, k, 0) +
58 cm1 * phi(i, j - 1, k, 0)) *
60 vy = (cp1 * phi(i, j + 1, k, 1) + c * phi(i, j, k, 1) +
61 cm1 * phi(i, j - 1, k, 1)) *
63 wy = (cp1 * phi(i, j + 1, k, 2) + c * phi(i, j, k, 2) +
64 cm1 * phi(i, j - 1, k, 2)) *
71 uz = (cp1 * phi(i, j, k + 1, 0) + c * phi(i, j, k, 0) +
72 cm1 * phi(i, j, k - 1, 0)) *
74 vz = (cp1 * phi(i, j, k + 1, 1) + c * phi(i, j, k, 1) +
75 cm1 * phi(i, j, k - 1, 1)) *
77 wz = (cp1 * phi(i, j, k + 1, 2) + c * phi(i, j, k, 2) +
78 cm1 * phi(i, j, k - 1, 2)) *
82 strphi(i, j, k, 0) = (ux * ux + uy * vx + uz * wx) -
83 (ux * ux + uy * uy + uz * uz) +
84 3 * (ux * ux + vx * vx + wx * wx) +
85 (ux * ux + vx * uy + wx * uz);
87 strphi(i, j, k, 1) = (ux * uy + uy * vy + uz * wy) -
88 (ux * vx + uy * vy + uz * vz) +
89 3 * (ux * uy + vx * vy + wx * wy) +
90 (ux * vx + vx * vy + wx * vz);
92 strphi(i, j, k, 2) = (ux * uz + uy * vz + uz * wz) -
93 (ux * wx + uy * wy + uz * wz) +
94 3 * (ux * uz + vx * vz + wx * wz) +
95 (ux * wx + vx * wy + wx * wz);
97 strphi(i, j, k, 3) = (vx * ux + vy * vx + vz * wx) -
98 (vx * ux + vy * uy + vz * uz) +
99 3 * (uy * ux + vy * vx + wy * wx) +
100 (uy * ux + vy * uy + wy * uz);
102 strphi(i, j, k, 4) = (vx * uy + vy * vy + vz * wy) -
103 (vx * vx + vy * vy + vz * vz) +
104 3 * (uy * vx + vy * vy + wy * wy) +
105 (uy * vx + vy * vy + wy * vz);
107 strphi(i, j, k, 5) = (vx * uz + vy * vz + vz * wz) -
108 (vx * wx + vy * wy + vz * wz) +
109 3 * (uy * wx + vy * vz + wy * wz) +
110 (uy * wx + vy * wy + wy * wz);
112 strphi(i, j, k, 6) = (wx * ux + wy * vx + wz * wx) -
113 (wx * ux + wy * uy + wz * uz) +
114 3 * (uz * ux + vz * vx + wz * wx) +
115 (uz * ux + vz * uy + wz * uz);
117 strphi(i, j, k, 7) = (wx * uy + wy * vy + wz * wy) -
118 (wx * vx + wy * vy + wz * vz) +
119 3 * (uz * uy + vz * vy + wz * wy) +
120 (uz * vx + vz * vy + wz * vz);
122 strphi(i, j, k, 8) = (wx * uz + wy * vz + wz * wz) -
123 (wx * wx + wy * wy + wz * wz) +
124 3 * (uz * uz + vz * vz + wz * wz) +
125 (uz * wx + vz * wy + wz * wz);