diff options
author | 2019-07-12 13:34:25 -0700 | |
---|---|---|
committer | 2019-07-12 13:34:25 -0700 | |
commit | 2ad0aca22bc7343be94d7eb248344b797a37ef93 (patch) | |
tree | 8a1dbbc7c1f854c222a0b64a56bfc38ad4974bdd /Python/pywarpx/picmi.py | |
parent | 82f1b244dfa90f21a93738395ad78da7d6ccc7fd (diff) | |
parent | 549db2f2f57a1bf5a00ebcc3f9faf7da8908734c (diff) | |
download | WarpX-2ad0aca22bc7343be94d7eb248344b797a37ef93.tar.gz WarpX-2ad0aca22bc7343be94d7eb248344b797a37ef93.tar.zst WarpX-2ad0aca22bc7343be94d7eb248344b797a37ef93.zip |
Merge branch 'dev' into python_update
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r-- | Python/pywarpx/picmi.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index 80d8e01e7..3170fef04 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 |