aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2022-10-24 09:42:58 -0700
committerGravatar GitHub <noreply@github.com> 2022-10-24 09:42:58 -0700
commitb96e6a95f83e095e364c06e4416e81c0fbcf0ec0 (patch)
tree55df8e8191108098fae2ce69101fb054df0d8def /Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp
parentc27b85db2b606f4474e5b331e4f9aeebaaf2da30 (diff)
downloadWarpX-b96e6a95f83e095e364c06e4416e81c0fbcf0ec0.tar.gz
WarpX-b96e6a95f83e095e364c06e4416e81c0fbcf0ec0.tar.zst
WarpX-b96e6a95f83e095e364c06e4416e81c0fbcf0ec0.zip
Fix stair-case solver in 2D Cartesian (#2942)
* Fix stair-case solver in 2D Cartesian * Generalization for the macroscropic solver * Update automated test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update benchmark Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to '')
-rw-r--r--Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp b/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp
index 7f0f99556..d6bc9be9e 100644
--- a/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp
+++ b/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp
@@ -193,8 +193,13 @@ void FiniteDifferenceSolver::MacroscopicEvolveECartesian (
[=] AMREX_GPU_DEVICE (int i, int j, int k){
#ifdef AMREX_USE_EB
- // Skip field push if this cell is fully covered by embedded boundaries
+#ifdef WARPX_DIM_3D
if (ly(i,j,k) <= 0) return;
+#elif defined(WARPX_DIM_XZ)
+ //In XZ Ey is associated with a mesh node, so we need to check if the mesh node is covered
+ amrex::ignore_unused(ly);
+ if (lx(i, j, k)<=0 || lx(i-1, j, k)<=0 || lz(i, j, k)<=0 || lz(i, j-1, k)<=0) return;
+#endif
#endif
// Interpolate conductivity, sigma, to Ey position on the grid
amrex::Real const sigma_interp = CoarsenIO::Interp( sigma_arr, sigma_stag,