aboutsummaryrefslogtreecommitdiff
path: root/Source/Parallelization/GuardCellManager.cpp
diff options
context:
space:
mode:
authorGravatar Edoardo Zoni <59625522+EZoni@users.noreply.github.com> 2020-09-30 13:57:49 -0700
committerGravatar GitHub <noreply@github.com> 2020-09-30 13:57:49 -0700
commit82cfaf9ae48f2fc9c0c6c67bd37e98a0eff1c467 (patch)
tree9d20cf834b61f825ace8c62d42df4868d47be62f /Source/Parallelization/GuardCellManager.cpp
parent1c20a09ba6268b2e7d23041c09060bcf1df23628 (diff)
downloadWarpX-82cfaf9ae48f2fc9c0c6c67bd37e98a0eff1c467.tar.gz
WarpX-82cfaf9ae48f2fc9c0c6c67bd37e98a0eff1c467.tar.zst
WarpX-82cfaf9ae48f2fc9c0c6c67bd37e98a0eff1c467.zip
Use fewer guard cells for deposition (#1368)
* Use fewer guard cells for deposition * Update some CI benchmarks * Revert "Update some CI benchmarks" This reverts commit 2f40062557d75e3f6b2d3ba284332b8a92a0d404. * Check if shapes and guard cells are compatible only for rho * Do not allocate one extra guard cell for J * Add more relaxed check on shapes and guard cells for J
Diffstat (limited to 'Source/Parallelization/GuardCellManager.cpp')
-rw-r--r--Source/Parallelization/GuardCellManager.cpp11
1 files changed, 10 insertions, 1 deletions
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