aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Edoardo Zoni <59625522+EZoni@users.noreply.github.com> 2022-11-10 11:00:32 -0800
committerGravatar GitHub <noreply@github.com> 2022-11-10 11:00:32 -0800
commit3dfe843bb74b64a6fb3a3ec893cf7c058f062b65 (patch)
tree5c6dbd38651a69d46daf56f2bf2b73ff1097358e
parentc69297d58a75735d7995c27c1ba95a708fe9bc07 (diff)
downloadWarpX-3dfe843bb74b64a6fb3a3ec893cf7c058f062b65.tar.gz
WarpX-3dfe843bb74b64a6fb3a3ec893cf7c058f062b65.tar.zst
WarpX-3dfe843bb74b64a6fb3a3ec893cf7c058f062b65.zip
Vay Deposition: Filter D, Exchange Guard Cells of J (#3388)
* Vay Deposition: Filter D, Exchange Guard Cells of J * Improve Inline Comment
-rw-r--r--Source/Evolve/WarpXEvolve.cpp7
-rw-r--r--Source/FieldSolver/WarpXPushFieldsEM.cpp9
2 files changed, 14 insertions, 2 deletions
diff --git a/Source/Evolve/WarpXEvolve.cpp b/Source/Evolve/WarpXEvolve.cpp
index 42042b7c7..5c3883007 100644
--- a/Source/Evolve/WarpXEvolve.cpp
+++ b/Source/Evolve/WarpXEvolve.cpp
@@ -501,6 +501,13 @@ void WarpX::SyncCurrentAndRho ()
SyncCurrent(current_fp, current_cp);
SyncRho();
}
+
+ if (current_deposition_algo == CurrentDepositionAlgo::Vay)
+ {
+ // TODO This works only without mesh refinement
+ const int lev = 0;
+ if (use_filter) ApplyFilterJ(current_fp_vay, lev);
+ }
}
}
else // FDTD
diff --git a/Source/FieldSolver/WarpXPushFieldsEM.cpp b/Source/FieldSolver/WarpXPushFieldsEM.cpp
index a3a882962..3d68e8e52 100644
--- a/Source/FieldSolver/WarpXPushFieldsEM.cpp
+++ b/Source/FieldSolver/WarpXPushFieldsEM.cpp
@@ -724,8 +724,13 @@ WarpX::PushPSATD ()
PSATDBackwardTransformJ(current_fp, current_cp);
PSATDSubtractCurrentPartialSumsAvg();
- // Synchronize J and rho (if used)
- SyncCurrent(current_fp, current_cp);
+ // Synchronize J and rho (if used).
+ // Here we call SumBoundaryJ instead of SyncCurrent, because
+ // filtering has been already applied to D in OneStep_nosub,
+ // by calling SyncCurrentAndRho (see Evolve/WarpXEvolve.cpp).
+ // TODO This works only without mesh refinement
+ const int lev = 0;
+ SumBoundaryJ(current_fp, lev, Geom(lev).periodicity());
SyncRho();
}