aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/WarpXParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-11-08 08:54:48 -0800
committerGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-11-08 08:54:48 -0800
commit0bf5b667a13e2e4a8cf58516ead3665a224209b9 (patch)
tree8479399ea9c009e05c54d925750462fc9faf9d6c /Source/Particles/WarpXParticleContainer.cpp
parent9895526f533f2a9e437d106fd8a68eb1c2d2b463 (diff)
downloadWarpX-0bf5b667a13e2e4a8cf58516ead3665a224209b9.tar.gz
WarpX-0bf5b667a13e2e4a8cf58516ead3665a224209b9.tar.zst
WarpX-0bf5b667a13e2e4a8cf58516ead3665a224209b9.zip
Minor fixes
Diffstat (limited to 'Source/Particles/WarpXParticleContainer.cpp')
-rw-r--r--Source/Particles/WarpXParticleContainer.cpp17
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;