29 void apply(
const int lev,
const amrex::MFIter& mfi)
const
31 const int ncomp =
m_phi.num_comp();
32 const auto& geom =
m_phi.repo().mesh().Geom(lev);
33 const auto& filterphi_arr =
m_filterphi(lev).array(mfi);
34 const auto& phi_arr =
m_phi(lev).const_array(mfi);
36 const auto& bx_in = mfi.tilebox();
37 const auto& bx = Stencil::box(bx_in, geom);
43 bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k)
noexcept {
44 for (
int icomp = 0; icomp < ncomp; icomp++) {
45 amrex::Real fp1 = Stencil::f00;
46 amrex::Real f = Stencil::f01;
47 amrex::Real fm1 = Stencil::f02;
48 const amrex::Real filx =
49 (fp1 * phi_arr(i + 1, j, k, icomp) +
50 f * phi_arr(i, j, k, icomp) +
51 fm1 * phi_arr(i - 1, j, k, icomp));
56 const amrex::Real fily =
57 (fp1 * phi_arr(i, j + 1, k, icomp) +
58 f * phi_arr(i, j, k, icomp) +
59 fm1 * phi_arr(i, j - 1, k, icomp));
64 const amrex::Real filz =
65 (fp1 * phi_arr(i, j, k + 1, icomp) +
66 f * phi_arr(i, j, k, icomp) +
67 fm1 * phi_arr(i, j, k - 1, icomp));
68 filterphi_arr(i, j, k, icomp) =
69 1. / 3. * (filx + fily + filz);