aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r--Source/WarpX.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index fc226a1b4..a2590de84 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -520,14 +520,18 @@ WarpX::AllocLevelData (int lev, const BoxArray& ba, const DistributionMapping& d
#if (AMREX_SPACEDIM == 3)
IntVect ngE(ngx,ngy,ngz);
IntVect ngJ(ngx,ngy,ngz_nonci);
- IntVect ngRho = ngJ + 1; // One extra ghost cell, so that it's safe to deposit charge density
- // after pushing particle.
#elif (AMREX_SPACEDIM == 2)
IntVect ngE(ngx,ngz);
IntVect ngJ(ngx,ngz_nonci);
- IntVect ngRho = ngJ + 1;
#endif
+ IntVect ngRho = ngJ+1; //One extra ghost cell, so that it's safe to deposit charge density
+ // after pushing particle.
+
+ if (mypc->nSpeciesDepositOnMainGrid() && n_current_deposition_buffer == 0) {
+ n_current_deposition_buffer = 1;
+ }
+
if (n_current_deposition_buffer < 0) {
n_current_deposition_buffer = ngJ.max();
}