aboutsummaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorGravatar Prabhat Kumar <89051199+prkkumar@users.noreply.github.com> 2022-01-12 14:22:25 -0800
committerGravatar GitHub <noreply@github.com> 2022-01-12 14:22:25 -0800
commit652202d488e6550b7aa92c0bc94e010835f8f12f (patch)
treed0ff780accd271557f3642bb7fc01b7742cb64b4 /Python
parent915d57445e11cbae330297fd8e89c4f8ded8545f (diff)
downloadWarpX-652202d488e6550b7aa92c0bc94e010835f8f12f.tar.gz
WarpX-652202d488e6550b7aa92c0bc94e010835f8f12f.tar.zst
WarpX-652202d488e6550b7aa92c0bc94e010835f8f12f.zip
Make moving window dimensionality consistent in PICMI (#2721)
* Make moving window dimensionality consistent in PICMI * update PICMI_inputs_plasma_acceleration_1d.py * two elements for moving window velocity in RZ * update RZ laser_acceration test * update PICMI version * update PICMI Langmuir RZ test
Diffstat (limited to 'Python')
-rw-r--r--Python/pywarpx/picmi.py20
-rw-r--r--Python/setup.py2
2 files changed, 11 insertions, 11 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py
index 695c6c207..441e04922 100644
--- a/Python/pywarpx/picmi.py
+++ b/Python/pywarpx/picmi.py
@@ -444,14 +444,14 @@ class CylindricalGrid(picmistandard.PICMI_CylindricalGrid):
pywarpx.boundary.particle_lo = [self.bc_rmin_particles, self.bc_zmin_particles]
pywarpx.boundary.particle_hi = [self.bc_rmax_particles, self.bc_zmax_particles]
- 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.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.:
+ pywarpx.warpx.moving_window_dir = 'r'
+ pywarpx.warpx.moving_window_v = self.moving_window_velocity[0]/constants.c # in units of the speed of light
+ 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.refined_regions:
assert len(self.refined_regions) == 1, Exception('WarpX only supports one refined region.')
@@ -501,9 +501,9 @@ class Cartesian1DGrid(picmistandard.PICMI_Cartesian1DGrid):
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[2] != 0.:
+ if self.moving_window_velocity[0] != 0.:
pywarpx.warpx.moving_window_dir = 'z'
- pywarpx.warpx.moving_window_v = self.moving_window_velocity[2]/constants.c # in units of the speed of light
+ pywarpx.warpx.moving_window_v = self.moving_window_velocity[0]/constants.c # in units of the speed of light
if self.refined_regions:
assert len(self.refined_regions) == 1, Exception('WarpX only supports one refined region.')
diff --git a/Python/setup.py b/Python/setup.py
index ee3e4906a..f4b38ebc2 100644
--- a/Python/setup.py
+++ b/Python/setup.py
@@ -59,7 +59,7 @@ setup(name = 'pywarpx',
package_dir = {'pywarpx': 'pywarpx'},
description = """Wrapper of WarpX""",
package_data = package_data,
- install_requires = ['numpy', 'picmistandard==0.0.18', 'periodictable'],
+ install_requires = ['numpy', 'picmistandard==0.0.19', 'periodictable'],
python_requires = '>=3.6',
zip_safe=False
)