aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/picmi.py
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r--Python/pywarpx/picmi.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py
index c33700278..6e9c9153b 100644
--- a/Python/pywarpx/picmi.py
+++ b/Python/pywarpx/picmi.py
@@ -56,7 +56,7 @@ class Species(picmistandard.PICMI_Species):
if self.mass is None:
self.mass = element.mass*periodictable.constants.atomic_mass_constant
- def initialize_inputs(self, layout):
+ def initialize_inputs(self, layout, initialize_self_fields=False):
self.species_number = pywarpx.particles.nspecies
pywarpx.particles.nspecies += 1
@@ -68,7 +68,8 @@ class Species(picmistandard.PICMI_Species):
else:
pywarpx.particles.species_names += ' ' + self.name
- self.species = pywarpx.Bucket.Bucket(self.name, mass=self.mass, charge=self.charge, injection_style = 'python')
+ self.species = pywarpx.Bucket.Bucket(self.name, mass=self.mass, charge=self.charge,
+ injection_style = 'python', initialize_self_fields=int(initialize_self_fields))
pywarpx.Particles.particles_list.append(self.species)
if self.initial_distribution is not None:
@@ -77,9 +78,9 @@ class Species(picmistandard.PICMI_Species):
picmistandard.PICMI_MultiSpecies.Species_class = Species
class MultiSpecies(picmistandard.PICMI_MultiSpecies):
- def initialize_inputs(self, layout):
+ def initialize_inputs(self, layout, initialize_self_fields=False):
for species in self.species_instances_list:
- species.initialize_inputs(layout)
+ species.initialize_inputs(layout, initialize_self_fields)
class GaussianBunchDistribution(picmistandard.PICMI_GaussianBunchDistribution):
@@ -544,8 +545,7 @@ class Simulation(picmistandard.PICMI_Simulation):
self.solver.initialize_inputs()
for i in range(len(self.species)):
- assert not self.initialize_self_fields[i], Exception('WarpX does not support initializing self fields')
- self.species[i].initialize_inputs(self.layouts[i])
+ self.species[i].initialize_inputs(self.layouts[i], self.initialize_self_fields[i])
for i in range(len(self.lasers)):
self.lasers[i].initialize_inputs()
@@ -671,10 +671,10 @@ class LabFrameFieldDiagnostic(picmistandard.PICMI_LabFrameFieldDiagnostic):
pywarpx.warpx.check_consistency('dt_snapshots_lab', self.dt_snapshots, 'The time between snapshots must be the same in all lab frame diagnostics')
pywarpx.warpx.check_consistency('lab_data_directory', self.write_dir, 'The write directory must be the same in all lab frame diagnostics')
- pywarpx.warpx.do_boosted_frame_diagnostic = 1
+ pywarpx.warpx.do_back_transformed_diagnostics = 1
pywarpx.warpx.num_snapshots_lab = self.num_snapshots
pywarpx.warpx.dt_snapshots_lab = self.dt_snapshots
- pywarpx.warpx.do_boosted_frame_fields = 1
+ pywarpx.warpx.do_back_transformed_fields = 1
pywarpx.warpx.lab_data_directory = self.write_dir
@@ -685,8 +685,8 @@ class LabFrameParticleDiagnostic(picmistandard.PICMI_LabFrameParticleDiagnostic)
pywarpx.warpx.check_consistency('dt_snapshots_lab', self.dt_snapshots, 'The time between snapshots must be the same in all lab frame diagnostics')
pywarpx.warpx.check_consistency('lab_data_directory', self.write_dir, 'The write directory must be the same in all lab frame diagnostics')
- pywarpx.warpx.do_boosted_frame_diagnostic = 1
+ pywarpx.warpx.do_back_transformed_diagnostics = 1
pywarpx.warpx.num_snapshots_lab = self.num_snapshots
pywarpx.warpx.dt_snapshots_lab = self.dt_snapshots
- pywarpx.warpx.do_boosted_frame_particles = 1
+ pywarpx.warpx.do_back_transformed_particles = 1
pywarpx.warpx.lab_data_directory = self.write_dir