diff --git a/src/simulation.hpp b/src/simulation.hpp index d3ac0392d..2ea940265 100644 --- a/src/simulation.hpp +++ b/src/simulation.hpp @@ -1017,8 +1017,12 @@ template void AMRSimulation::calculateGpotAllLev rhs[lev].setVal(0); } - // deposit particles using amrex::ParticleToMesh - amrex::ParticleToMesh(*CICParticles, amrex::GetVecOfPtrs(rhs), 0, finest_level, quokka::CICDeposition{Gconst_, quokka::ParticleMassIdx, 0, 1}); +#ifdef AMREX_PARTICLES + if (do_cic_particles != 0) { + // deposit particles using amrex::ParticleToMesh + amrex::ParticleToMesh(*CICParticles, amrex::GetVecOfPtrs(rhs), 0, finest_level, quokka::CICDeposition{Gconst_, quokka::ParticleMassIdx, 0, 1}); + } +#endif // add fluid density for (int lev = 0; lev <= finest_level; ++lev) {