aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/picmi.py
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2020-09-15 22:18:46 -0700
committerGravatar GitHub <noreply@github.com> 2020-09-15 22:18:46 -0700
commit68c50843c6c011f95e698534018e68b3cf2e4e0c (patch)
tree4365b094a8688bcb40608721536ff4a500997bde /Python/pywarpx/picmi.py
parent335d1f6aa546e41de73999e49553558ffefdd2c2 (diff)
downloadWarpX-68c50843c6c011f95e698534018e68b3cf2e4e0c.tar.gz
WarpX-68c50843c6c011f95e698534018e68b3cf2e4e0c.tar.zst
WarpX-68c50843c6c011f95e698534018e68b3cf2e4e0c.zip
For PICMI, expect length 2 args for 2D solver (#1326)
* picmi - For 2D, changed arguments to expect length 2 lists * picmi - For 2D, guard_cells should be length 2
Diffstat (limited to '')
-rw-r--r--Python/pywarpx/picmi.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py
index 47813596b..6c43c2932 100644
--- a/Python/pywarpx/picmi.py
+++ b/Python/pywarpx/picmi.py
@@ -479,15 +479,19 @@ class ElectromagneticSolver(picmistandard.PICMI_ElectromagneticSolver):
pywarpx.psatd.do_time_averaging = self.psatd_do_time_averaging
if self.grid.guard_cells is not None:
pywarpx.psatd.nx_guard = self.grid.guard_cells[0]
- pywarpx.psatd.ny_guard = self.grid.guard_cells[1]
- pywarpx.psatd.nz_guard = self.grid.guard_cells[2]
+ if self.grid.number_of_dimensions == 3:
+ pywarpx.psatd.ny_guard = self.grid.guard_cells[1]
+ pywarpx.psatd.nz_guard = self.grid.guard_cells[-1]
if self.stencil_order is not None:
pywarpx.psatd.nox = self.stencil_order[0]
- pywarpx.psatd.noy = self.stencil_order[1]
- pywarpx.psatd.noz = self.stencil_order[2]
+ if self.grid.number_of_dimensions == 3:
+ pywarpx.psatd.noy = self.stencil_order[1]
+ pywarpx.psatd.noz = self.stencil_order[-1]
if self.galilean_velocity is not None:
+ if self.grid.number_of_dimensions == 2:
+ self.galilean_velocity = [self.galilean_velocity[0], 0., self.galilean_velocity[1]]
pywarpx.psatd.v_galilean = np.array(self.galilean_velocity)/constants.c
else: