diff options
Diffstat (limited to 'Source/Particles/WarpXParticleContainer.cpp')
-rw-r--r-- | Source/Particles/WarpXParticleContainer.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp index 29a7d95c7..9abeaf131 100644 --- a/Source/Particles/WarpXParticleContainer.cpp +++ b/Source/Particles/WarpXParticleContainer.cpp @@ -504,21 +504,16 @@ void WarpXParticleContainer::DepositCharge (Vector<std::unique_ptr<MultiFab> >& rho, bool local, bool reset) { + // Loop over the refinement levels + for (int lev = 0; lev < max_level; ++lev) { - int num_levels = rho.size(); - int finest_level = num_levels - 1; - - // each level deposits its own particles - const int ng = rho[0]->nGrow(); - for (int lev = 0; lev < num_levels; ++lev) { - - if (reset) rho[lev]->setVal(0.0, ng); + // Reset the `rho` array if `reset` is True + if (reset) rho[lev]->setVal(0.0, rho[lev]->nGrow()); + // Loop over particle tiles and deposit charge #ifdef _OPENMP -#pragma omp parallel + #pragma omp parallel { -#endif -#ifdef _OPENMP int thread_num = omp_get_thread_num(); #else int thread_num = 0; |