From 9c47da85663719c1d69090d42beaba900cdb3edb Mon Sep 17 00:00:00 2001 From: Ben Chen <6263622+ben-c-2013@users.noreply.github.com> Date: Wed, 22 Apr 2026 17:39:56 +0200 Subject: [PATCH] Edited StageHipace.track() to copy the HiPACE++ into the shot folder instead of moving it into the run folder. --- src/abel/classes/stage/impl/stage_hipace.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/abel/classes/stage/impl/stage_hipace.py b/src/abel/classes/stage/impl/stage_hipace.py index 931fe804..47183d56 100644 --- a/src/abel/classes/stage/impl/stage_hipace.py +++ b/src/abel/classes/stage/impl/stage_hipace.py @@ -352,7 +352,12 @@ def track(self, beam_incoming, savedepth=0, runnable=None, verbose=False): path_input = tmpfolder + filename_input hipace_write_inputs(path_input, filename_beam, filename_driver, self.plasma_density, self.num_steps, time_step, box_range_z, box_size_xy, ion_motion=self.ion_motion, ion_species=self.ion_species, beam_ionization=self.beam_ionization, radiation_reaction=self.radiation_reaction, output_period=output_period, num_cell_xy=self.num_cell_xy, num_cell_z=num_cell_z, driver_only=self.driver_only, density_table_file=density_table_file, no_plasma=self.no_plasma, external_focusing_gradient=self._external_focusing_gradient, mesh_refinement=self.mesh_refinement, do_spin_tracking=self.do_spin_tracking) - + # move the HiPACE++ input file to be stored + if runnable is not None: + shutil.copy(path_input, runnable.shot_path()) + elif self.run_path is not None: + shutil.copy(path_input, self.run_path) + ## RUN SIMULATION # make job script @@ -398,10 +403,6 @@ def track(self, beam_incoming, savedepth=0, runnable=None, verbose=False): # extract insitu diagnostics and wakefield data self.__extract_evolution(tmpfolder, beam0, runnable) self.__extract_initial_and_final_step(tmpfolder, beam0, runnable) - - # move the HiPACE++ input file to be stored - if self.run_path is not None: - shutil.move(path_input, self.run_path) # delete temp folder shutil.rmtree(tmpfolder)