From baf77f24bc4327019824b0bb94961290d8ee5a3f Mon Sep 17 00:00:00 2001 From: Ben Wibking Date: Thu, 18 Jan 2024 15:47:56 -0500 Subject: [PATCH] add runtime check if particles are enabled --- src/simulation.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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) {