diff options
author | 2019-12-20 09:56:59 -0800 | |
---|---|---|
committer | 2019-12-20 09:56:59 -0800 | |
commit | 3753ac3c3b76e9dcb1e442ba4a5141217a995ce3 (patch) | |
tree | 739d2d434593a8641110b4d358eb4e26d2603a19 /Python/pywarpx/picmi.py | |
parent | f10220dd5913a011bd9d4cd8342c6e775f3f64cf (diff) | |
parent | 7c2887709b20103d63e4a7ff0c3cfc848f17e4e5 (diff) | |
download | WarpX-3753ac3c3b76e9dcb1e442ba4a5141217a995ce3.tar.gz WarpX-3753ac3c3b76e9dcb1e442ba4a5141217a995ce3.tar.zst WarpX-3753ac3c3b76e9dcb1e442ba4a5141217a995ce3.zip |
Merge pull request #574 from LDAmorim/picmi_mw
Fix to RZ scalar moving window
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r-- | Python/pywarpx/picmi.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index 6e9c9153b..19d68ca29 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_zvelocity is not None: + if np.isscalar(self.moving_window_zvelocity): + if self.moving_window_zvelocity !=0: + pywarpx.warpx.do_moving_window = 1 + pywarpx.warpx.moving_window_dir = 'z' + pywarpx.warpx.moving_window_v = self.moving_window_zvelocity/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.') |