aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/picmi.py
diff options
context:
space:
mode:
authorGravatar Dave Grote <grote1@llnl.gov> 2019-06-24 16:52:31 -0700
committerGravatar Dave Grote <grote1@llnl.gov> 2019-06-24 16:52:31 -0700
commit67588147763a8dee4bb436a08c01b16b27b57c00 (patch)
tree5b6f55aa5f4018c4f524801c3a86e73bc4621d45 /Python/pywarpx/picmi.py
parentaf336d881e641b43df054d2701e6e0095fe48d8c (diff)
downloadWarpX-67588147763a8dee4bb436a08c01b16b27b57c00.tar.gz
WarpX-67588147763a8dee4bb436a08c01b16b27b57c00.tar.zst
WarpX-67588147763a8dee4bb436a08c01b16b27b57c00.zip
picmi updated to support write_dir for diagnostics
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r--Python/pywarpx/picmi.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py
index f6dc47fec..3cbefc920 100644
--- a/Python/pywarpx/picmi.py
+++ b/Python/pywarpx/picmi.py
@@ -567,12 +567,22 @@ class FieldDiagnostic(picmistandard.PICMI_FieldDiagnostic):
pywarpx.warpx.plot_finepatch = self.plot_finepatch
pywarpx.warpx.plot_crsepatch = self.plot_crsepatch
+ if self.write_dir is not None:
+ plot_file = self.write_dir + '/plotfiles/plt'
+ pywarpx.amr.check_consistency('plot_file', plot_file, 'The plot directory must be the same for all simulation frame diagnostics')
+ pywarpx.warpx.plot_file = plot_file
+
class ElectrostaticFieldDiagnostic(picmistandard.PICMI_ElectrostaticFieldDiagnostic):
def initialize_inputs(self):
# --- For now, the period must be the same as plot_int if set
pywarpx.amr.check_consistency('plot_int', self.period, 'The period must be the same for all simulation frame diagnostics')
pywarpx.amr.plot_int = self.period
+ if self.write_dir is not None:
+ plot_file = self.write_dir + '/plotfiles/plt'
+ pywarpx.amr.check_consistency('plot_file', plot_file, 'The plot directory must be the same for all simulation frame diagnostics')
+ pywarpx.warpx.plot_file = plot_file
+
class ParticleDiagnostic(picmistandard.PICMI_ParticleDiagnostic):
def initialize_inputs(self):
@@ -587,6 +597,11 @@ class ParticleDiagnostic(picmistandard.PICMI_ParticleDiagnostic):
if 'part_per_proc' in self.data_list:
pywarpx.warpx.plot_part_per_proc = 1
+ if self.write_dir is not None:
+ plot_file = self.write_dir + '/plotfiles/plt'
+ pywarpx.amr.check_consistency('plot_file', plot_file, 'The plot directory must be the same for all simulation frame diagnostics')
+ pywarpx.warpx.plot_file = plot_file
+
# ----------------------------
# Lab frame diagnostics
@@ -598,11 +613,13 @@ class LabFrameFieldDiagnostic(picmistandard.PICMI_LabFrameFieldDiagnostic):
pywarpx.warpx.check_consistency('num_snapshots_lab', self.num_snapshots, 'The number of snapshots must be the same in all lab frame diagnostics')
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.num_snapshots_lab = self.num_snapshots
pywarpx.warpx.dt_snapshots_lab = self.dt_snapshots
pywarpx.warpx.do_boosted_frame_fields = 1
+ pywarpx.warpx.lab_data_directory = self.write_dir
class LabFrameParticleDiagnostic(picmistandard.PICMI_LabFrameParticleDiagnostic):
@@ -610,8 +627,10 @@ class LabFrameParticleDiagnostic(picmistandard.PICMI_LabFrameParticleDiagnostic)
pywarpx.warpx.check_consistency('num_snapshots_lab', self.num_snapshots, 'The number of snapshots must be the same in all lab frame diagnostics')
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.num_snapshots_lab = self.num_snapshots
pywarpx.warpx.dt_snapshots_lab = self.dt_snapshots
pywarpx.warpx.do_boosted_frame_particles = 1
+ pywarpx.warpx.lab_data_directory = self.write_dir