diff options
author | 2020-01-14 09:37:56 -0800 | |
---|---|---|
committer | 2020-01-14 09:37:56 -0800 | |
commit | 3bf2684c160ea821b94c8791ea01d53ec34f98b1 (patch) | |
tree | aa55f09cd99b4c35b8db073f00a925cf4958ffe7 /Python/pywarpx/WarpX.py | |
parent | ed93568fe37da1acaafc6c770607b152e58c2e9b (diff) | |
parent | 0c593f22cd3c5571ff89ddc32a6b7b205815ead2 (diff) | |
download | WarpX-3bf2684c160ea821b94c8791ea01d53ec34f98b1.tar.gz WarpX-3bf2684c160ea821b94c8791ea01d53ec34f98b1.tar.zst WarpX-3bf2684c160ea821b94c8791ea01d53ec34f98b1.zip |
Merge pull request #593 from dpgrote/fix_picmi_diagnostics
Updated handling of diagnostics in picmi interface
Diffstat (limited to 'Python/pywarpx/WarpX.py')
-rw-r--r-- | Python/pywarpx/WarpX.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Python/pywarpx/WarpX.py b/Python/pywarpx/WarpX.py index 5f7477e58..2ef3d99c1 100644 --- a/Python/pywarpx/WarpX.py +++ b/Python/pywarpx/WarpX.py @@ -29,7 +29,7 @@ class WarpX(Bucket): # --- Search through species_names and add any predefined particle objects in the list. particles_list_names = [p.instancename for p in particles_list] - for pstring in particles.species_names.split(' '): + for pstring in particles.species_names: if pstring in particles_list_names: # --- The species is already included in particles_list continue @@ -48,6 +48,14 @@ class WarpX(Bucket): return argv + def add_field_to_plot(self, field): + try: + # Check if the field was already added to the string + if field not in self.fields_to_plot: + self.fields_to_plot.append(field) + except AttributeError: + self.fields_to_plot = [field] + def init(self): from . import wx argv = ['warpx'] + self.create_argv_list() |