diff options
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r-- | Python/pywarpx/picmi.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index 6e9c9153b..224a53737 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -75,6 +75,13 @@ class Species(picmistandard.PICMI_Species): if self.initial_distribution is not None: self.initial_distribution.initialize_inputs(self.species_number, layout, self.species, self.density_scale) + for interaction in self.interactions: + assert interaction[0] == 'ionization' + assert interaction[1] == 'ADK', 'WarpX only has ADK ionization model implemented' + self.species.do_field_ionization=1 + self.species.physical_element=self.particle_type + self.species.ionization_product_species = interaction[2].name + self.species.ionization_initial_level = self.charge_state picmistandard.PICMI_MultiSpecies.Species_class = Species class MultiSpecies(picmistandard.PICMI_MultiSpecies): @@ -326,13 +333,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.') |