diff options
author | 2020-01-03 14:54:19 -0800 | |
---|---|---|
committer | 2020-01-03 14:54:19 -0800 | |
commit | 4d4ec41f5637e9ee26014d4db9536bd740a1c666 (patch) | |
tree | 4afa7ad985da7de844495977c07144adb6fdcce2 /Python/pywarpx/WarpX.py | |
parent | c874e3fe2d0ef3ae2f8cc7e581022995f4fe2cc3 (diff) | |
download | WarpX-4d4ec41f5637e9ee26014d4db9536bd740a1c666.tar.gz WarpX-4d4ec41f5637e9ee26014d4db9536bd740a1c666.tar.zst WarpX-4d4ec41f5637e9ee26014d4db9536bd740a1c666.zip |
Updated handling of fields_to_plot in picmi interface
Diffstat (limited to 'Python/pywarpx/WarpX.py')
-rw-r--r-- | Python/pywarpx/WarpX.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/pywarpx/WarpX.py b/Python/pywarpx/WarpX.py index 5f7477e58..1b536a55c 100644 --- a/Python/pywarpx/WarpX.py +++ b/Python/pywarpx/WarpX.py @@ -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() |