1#ifdef REMORA_USE_PARTICLES
3#include <AMReX_ParticleInterpolators.H>
14void REMORAPC::massDensity ( MultiFab& a_mf,
16 const int& a_comp )
const
18 BL_PROFILE(
"REMORAPC::massDensity()");
21 AMREX_ASSERT(numParticlesOutOfRange(*
this, 0) == 0);
23 const auto& geom = Geom(a_lev);
24 const auto plo = geom.ProbLoArray();
25 const auto dxi = geom.InvCellSizeArray();
27 const Real inv_cell_volume = dxi[0]*dxi[1]*dxi[2];
30 ParticleToMesh( *
this, a_mf, a_lev,
31 [=] AMREX_GPU_DEVICE (
const REMORAPC::ParticleTileType::ConstParticleTileDataType& ptd,
32 int i, Array4<Real>
const& rho)
34 auto p = ptd.m_aos[i];
35 ParticleInterpolator::Linear interp(p, plo, dxi);
36 interp.ParticleToMesh ( p, rho, 0, a_comp, 1,
37 [=] AMREX_GPU_DEVICE (
const REMORAPC::ParticleType&,
int)
39 auto mass = ptd.m_rdata[REMORAParticlesRealIdxSoA::mass][i];
40 return mass*inv_cell_volume;