diff options
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r-- | Python/pywarpx/picmi.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index 21b84cc34..0709cb0de 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -295,18 +295,20 @@ class AnalyticDistribution(picmistandard.PICMI_AnalyticDistribution): class ParticleListDistribution(picmistandard.PICMI_ParticleListDistribution): def init(self, kw): - - if len(self.x) > 1: - raise Exception('Only a single particle can be loaded') + pass def initialize_inputs(self, species_number, layout, species, density_scale): - species.injection_style = "singleparticle" - species.single_particle_pos = [self.x[0], self.y[0], self.z[0]] - species.single_particle_vel = [self.ux[0]/constants.c, self.uy[0]/constants.c, self.uz[0]/constants.c] - species.single_particle_weight = self.weight + species.injection_style = "multipleparticles" + species.multiple_particles_pos_x = self.x + species.multiple_particles_pos_y = self.y + species.multiple_particles_pos_z = self.z + species.multiple_particles_vel_x = self.ux/constants.c + species.multiple_particles_vel_y = self.uy/constants.c + species.multiple_particles_vel_z = self.uz/constants.c + species.multiple_particles_weight = self.weight if density_scale is not None: - species.single_particle_weight *= density_scale + species.multiple_particles_weight = self.weight*density_scale class ParticleDistributionPlanarInjector(picmistandard.PICMI_ParticleDistributionPlanarInjector): |