aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/picmi.py
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2023-09-11 18:04:47 -0700
committerGravatar GitHub <noreply@github.com> 2023-09-12 01:04:47 +0000
commit7b4cb7321d8379844597a0ddb560cebf079d23f2 (patch)
treefc6623d5d1488be846aff9491ce1c46ca6156b98 /Python/pywarpx/picmi.py
parentac52a762c297712411fec4877b9770e2bf4d4343 (diff)
downloadWarpX-7b4cb7321d8379844597a0ddb560cebf079d23f2.tar.gz
WarpX-7b4cb7321d8379844597a0ddb560cebf079d23f2.tar.zst
WarpX-7b4cb7321d8379844597a0ddb560cebf079d23f2.zip
PICMI: Add `warpx_intervals` option to BTD (#4288)
* Add warpx_intervals option to BTD * Add warpx_intervals to LabFrameParticleDiagnostics
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r--Python/pywarpx/picmi.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py
index dbdebf452..ce2072495 100644
--- a/Python/pywarpx/picmi.py
+++ b/Python/pywarpx/picmi.py
@@ -2249,6 +2249,10 @@ class LabFrameFieldDiagnostic(picmistandard.PICMI_LabFrameFieldDiagnostic,
warpx_file_prefix: string, optional
Passed to <diagnostic name>.file_prefix
+ warpx_intervals: integer or string
+ Selects the snapshots to be made, instead of using "num_snapshots" which
+ makes all snapshots. "num_snapshots" is ignored.
+
warpx_file_min_digits: integer, optional
Passed to <diagnostic name>.file_min_digits
@@ -2268,6 +2272,7 @@ class LabFrameFieldDiagnostic(picmistandard.PICMI_LabFrameFieldDiagnostic,
self.format = kw.pop('warpx_format', None)
self.openpmd_backend = kw.pop('warpx_openpmd_backend', None)
self.file_prefix = kw.pop('warpx_file_prefix', None)
+ self.intervals = kw.pop('warpx_intervals', None)
self.file_min_digits = kw.pop('warpx_file_min_digits', None)
self.buffer_size = kw.pop('warpx_buffer_size', None)
self.lower_bound = kw.pop('warpx_lower_bound', None)
@@ -2286,10 +2291,15 @@ class LabFrameFieldDiagnostic(picmistandard.PICMI_LabFrameFieldDiagnostic,
self.diagnostic.diag_hi = self.upper_bound
self.diagnostic.do_back_transformed_fields = 1
- self.diagnostic.num_snapshots_lab = self.num_snapshots
self.diagnostic.dt_snapshots_lab = self.dt_snapshots
self.diagnostic.buffer_size = self.buffer_size
+ # intervals and num_snapshots_lab cannot both be set
+ if self.intervals is not None:
+ self.diagnostic.intervals = self.intervals
+ else:
+ self.diagnostic.num_snapshots_lab = self.num_snapshots
+
self.diagnostic.do_back_transformed_particles = self.write_species
# --- Use a set to ensure that fields don't get repeated.
@@ -2352,6 +2362,10 @@ class LabFrameParticleDiagnostic(picmistandard.PICMI_LabFrameParticleDiagnostic,
warpx_file_prefix: string, optional
Passed to <diagnostic name>.file_prefix
+ warpx_intervals: integer or string
+ Selects the snapshots to be made, instead of using "num_snapshots" which
+ makes all snapshots. "num_snapshots" is ignored.
+
warpx_file_min_digits: integer, optional
Passed to <diagnostic name>.file_min_digits
@@ -2365,6 +2379,7 @@ class LabFrameParticleDiagnostic(picmistandard.PICMI_LabFrameParticleDiagnostic,
self.format = kw.pop('warpx_format', None)
self.openpmd_backend = kw.pop('warpx_openpmd_backend', None)
self.file_prefix = kw.pop('warpx_file_prefix', None)
+ self.intervals = kw.pop('warpx_intervals', None)
self.file_min_digits = kw.pop('warpx_file_min_digits', None)
self.buffer_size = kw.pop('warpx_buffer_size', None)
self.write_fields = kw.pop('warpx_write_fields', None)
@@ -2379,10 +2394,15 @@ class LabFrameParticleDiagnostic(picmistandard.PICMI_LabFrameParticleDiagnostic,
self.diagnostic.file_min_digits = self.file_min_digits
self.diagnostic.do_back_transformed_particles = 1
- self.diagnostic.num_snapshots_lab = self.num_snapshots
self.diagnostic.dt_snapshots_lab = self.dt_snapshots
self.diagnostic.buffer_size = self.buffer_size
+ # intervals and num_snapshots_lab cannot both be set
+ if self.intervals is not None:
+ self.diagnostic.intervals = self.intervals
+ else:
+ self.diagnostic.num_snapshots_lab = self.num_snapshots
+
self.diagnostic.do_back_transformed_fields = self.write_fields
self.set_write_dir()