diff options
author | 2020-07-27 21:44:25 -0700 | |
---|---|---|
committer | 2020-07-27 21:44:25 -0700 | |
commit | 26277c3d56745d04f64be116240609c3f1088877 (patch) | |
tree | 2cd823174e2d40a16d9685a73cbf8623e83708f0 /Python/pywarpx/picmi.py | |
parent | 289cb5b05e8865008fca9e0f0f63379fa80ce704 (diff) | |
download | WarpX-26277c3d56745d04f64be116240609c3f1088877.tar.gz WarpX-26277c3d56745d04f64be116240609c3f1088877.tar.zst WarpX-26277c3d56745d04f64be116240609c3f1088877.zip |
Input: Remove n<something> options (#1217)
* Input: Remove n<something> options
The information in
- lasers.nlasers
- particles.nspecies
- collisions.ncollisions
is redundant with their `<...>.names` counter-part and requires users
to change info at two locations. We just remove this now since we can
query the size of names automatically in the parser.
* Examples: remove n<something>
Removes:
- lasers.nlasers
- particles.nspecies
- collisions.ncollisions
from examples.
* QED: Update nspecies
* Removed nspecies and nlasers from the Python interface
Co-authored-by: Dave Grote <grote1@llnl.gov>
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r-- | Python/pywarpx/picmi.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index ccf35b414..0579b4337 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -65,8 +65,7 @@ class Species(picmistandard.PICMI_Species): self.mass = element.mass*periodictable.constants.atomic_mass_constant def initialize_inputs(self, layout, initialize_self_fields=False): - self.species_number = pywarpx.particles.nspecies - pywarpx.particles.nspecies += 1 + self.species_number = len(pywarpx.particles.species_names) if self.name is None: self.name = 'species{}'.format(self.species_number) @@ -502,7 +501,7 @@ class ElectrostaticSolver(picmistandard.PICMI_ElectrostaticSolver): class GaussianLaser(picmistandard.PICMI_GaussianLaser): def initialize_inputs(self): - self.laser_number = pywarpx.lasers.nlasers + 1 + self.laser_number = len(pywarpx.lasers.names) + 1 if self.name is None: self.name = 'laser{}'.format(self.laser_number) @@ -521,7 +520,7 @@ class GaussianLaser(picmistandard.PICMI_GaussianLaser): class AnalyticLaser(picmistandard.PICMI_AnalyticLaser): def initialize_inputs(self): - self.laser_number = pywarpx.lasers.nlasers + 1 + self.laser_number = len(pywarpx.lasers.names) + 1 if self.name is None: self.name = 'laser{}'.format(self.laser_number) |