amrex_first_order_extrap_cpu(amrex::Box const& bx,
int nComp,
amrex::Array4<const int> const& mask,
amrex::Array4<amrex::Real> const& data) noexcept
{
constexpr int crsecell = 0;
const auto lo = amrex::lbound(bx);
const auto hi = amrex::ubound(bx);
if (mask(lo.x-1,lo.y,lo.z) == crsecell) {
for (int n = 0; n < nComp; n++) {
data(lo.x-1,lo.y,lo.z,n) = data(lo.x,lo.y,lo.z,n);
}
}
if (mask(hi.x+1,hi.y,hi.z) == crsecell) {
for (int n = 0; n < nComp; n++) {
data(hi.x+1,hi.y,hi.z,n) = data(hi.x,hi.y,hi.z,n);
}
}
}
(mask(hi.x+1,hi.y,hi.z) == crsecell means the cell at hi.x+1,hi.y,hi.z is a coarse cell (i.e., it does not exist as a valid cell on the current level).