aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/picmi.py
diff options
context:
space:
mode:
authorGravatar L. Diana Amorim <LDianaAmorim@lbl.gov> 2019-12-18 16:16:47 -0800
committerGravatar L. Diana Amorim <LDianaAmorim@lbl.gov> 2019-12-18 16:16:47 -0800
commit680a3d958d9becaabeab940bc9d03f3db18a7889 (patch)
treea706e772b24856767250d94578d9577ce673efa1 /Python/pywarpx/picmi.py
parent6113267898fdf77ca4ca6c86db4ac48732bd45f4 (diff)
parente55df6ae9f55fdb9fcd6520e1a95144d3e3604f3 (diff)
downloadWarpX-680a3d958d9becaabeab940bc9d03f3db18a7889.tar.gz
WarpX-680a3d958d9becaabeab940bc9d03f3db18a7889.tar.zst
WarpX-680a3d958d9becaabeab940bc9d03f3db18a7889.zip
Merge branch 'picmi_mw' into picmi_ion
Diffstat (limited to '')
-rw-r--r--Python/pywarpx/picmi.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py
index b207ef0a5..13774bff2 100644
--- a/Python/pywarpx/picmi.py
+++ b/Python/pywarpx/picmi.py
@@ -335,14 +335,15 @@ 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.')
assert self.refined_regions[0][0] == 1, Exception('The one refined region can only be level 1')