aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/picmi.py
diff options
context:
space:
mode:
authorGravatar L. Diana Amorim <LDianaAmorim@lbl.gov> 2019-12-18 09:55:00 -0800
committerGravatar L. Diana Amorim <LDianaAmorim@lbl.gov> 2019-12-18 10:00:33 -0800
commitcfe63efaaf3f8e6e624d1a680655fed42d0f8236 (patch)
treefb423521422910d8b2d1fb7d854ee68bfa1fd047 /Python/pywarpx/picmi.py
parentd76fa513ff75ee723de8b8a055f8106105fbe058 (diff)
downloadWarpX-cfe63efaaf3f8e6e624d1a680655fed42d0f8236.tar.gz
WarpX-cfe63efaaf3f8e6e624d1a680655fed42d0f8236.tar.zst
WarpX-cfe63efaaf3f8e6e624d1a680655fed42d0f8236.zip
Fix to RZ scalar moving window
Tried to make exception message clearer
Diffstat (limited to '')
-rw-r--r--Python/pywarpx/picmi.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py
index 6e9c9153b..2dc08bf37 100644
--- a/Python/pywarpx/picmi.py
+++ b/Python/pywarpx/picmi.py
@@ -326,13 +326,14 @@ class CylindricalGrid(picmistandard.PICMI_CylindricalGrid):
pywarpx.geometry.prob_hi = self.upper_bound
pywarpx.warpx.n_rz_azimuthal_modes = self.n_azimuthal_modes
- if self.moving_window_velocity is not None and np.any(np.not_equal(self.moving_window_velocity, 0.)):
- pywarpx.warpx.do_moving_window = 1
- if self.moving_window_velocity[0] != 0.:
- raise Exception('In cylindrical coordinates, a moving window in r can not be done')
- if self.moving_window_velocity[1] != 0.:
- pywarpx.warpx.moving_window_dir = 'z'
- pywarpx.warpx.moving_window_v = self.moving_window_velocity[1]/constants.c # in units of the speed of light
+ if self.moving_window_velocity is not None:
+ if np.isscalar(self.moving_window_velocity):
+ if self.moving_window_velocity !=0:
+ pywarpx.warpx.do_moving_window = 1
+ pywarpx.warpx.moving_window_dir = 'z'
+ pywarpx.warpx.moving_window_v = self.moving_window_velocity/constants.c # in units of the speed of light
+ else:
+ raise Exception('RZ PICMI moving_window_velocity (only available in z direction) should be a scalar')
if self.refined_regions:
assert len(self.refined_regions) == 1, Exception('WarpX only supports one refined region.')