aboutsummaryrefslogtreecommitdiff
path: root/Source/Parallelization
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Parallelization')
-rw-r--r--Source/Parallelization/GuardCellManager.H4
-rw-r--r--Source/Parallelization/GuardCellManager.cpp11
2 files changed, 14 insertions, 1 deletions
diff --git a/Source/Parallelization/GuardCellManager.H b/Source/Parallelization/GuardCellManager.H
index 393fbe33d..5e9971544 100644
--- a/Source/Parallelization/GuardCellManager.H
+++ b/Source/Parallelization/GuardCellManager.H
@@ -76,6 +76,10 @@ public:
// An extra guard cell is needed on the fine grid to do the interpolation
// for E and B.
amrex::IntVect ng_Extra = amrex::IntVect::TheZeroVector();
+
+ // Number of guard cells for local deposition of J and rho
+ amrex::IntVect ng_depos_J = amrex::IntVect::TheZeroVector();
+ amrex::IntVect ng_depos_rho = amrex::IntVect::TheZeroVector();
};
#endif // GUARDCELLMANAGER_H_
diff --git a/Source/Parallelization/GuardCellManager.cpp b/Source/Parallelization/GuardCellManager.cpp
index 5635f5d83..1b8d38f0c 100644
--- a/Source/Parallelization/GuardCellManager.cpp
+++ b/Source/Parallelization/GuardCellManager.cpp
@@ -89,7 +89,16 @@ guardCellManager::Init(
ng_alloc_J = IntVect(ngJx,ngJz);
#endif
- ng_alloc_Rho = ng_alloc_J+1; //One extra ghost cell, so that it's safe to deposit charge density
+ // Rho is needed both at the beginning and at the end of the PIC iteration.
+ // Hence we add one extra guard cell for the allocation of the MultiFab that
+ // contains rho, in order to account for the change in the particle positions
+ // within a time step
+ ng_alloc_Rho = ng_alloc_J+1;
+
+ // Number of guard cells for local deposition of J and rho
+ ng_depos_J = ng_alloc_J;
+ ng_depos_rho = ng_alloc_Rho;
+
// after pushing particle.
int ng_alloc_F_int = (do_moving_window) ? 2 : 0;
// CKC solver requires one additional guard cell