From 95bb2598047300aa1a62d47b0cb23de172df4b77 Mon Sep 17 00:00:00 2001 From: Andrew Myers Date: Mon, 4 Oct 2021 09:45:58 -0700 Subject: Implement Checkpoint / Restart for Laser Particles (#2360) * Initialize lasers when restarting + recalculate z position at each iteration * Fix restart for rigid-injected particles * Fix laser injection box at restart * Use correct positions for the moving window of the BTD * implement restart for laser particles * add CI test for laser acceleration restarting * writespace * Revert "Fix restart for rigid-injected particles" This reverts commit 33bf3a60126539b9566ead3115ff2bcdf4b80516. * don't add lasers to all full diags, only checkpoints * fix unused parameter warning * move the call to reset the m_laser_injection_box into PostRestart * bugfix for non-boosted frame simulations * Read the mean velocity of the injected species * Remove unused line * Revert "Initialize lasers when restarting + recalculate z position at each iteration" This reverts commit 322634c35aa996649d0e8fff9fb683d04f2ee121. * Add new ReadHeader / WriteHeader functions * Add WriteHeader/ReadHeader for laser particles * Revert "add CI test for laser acceleration restarting" This reverts commit 6ba0fb3c121027eecf8b5845f55080e5b187375d. * Fix merge commit * Correct reading of updated position * Add laser in restart test * Remove unused parameters * Update regression tests * Add benchmark files * Update boundary conditions for restart_psatd Co-authored-by: Remi Lehe --- Source/Particles/MultiParticleContainer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Source/Particles/MultiParticleContainer.cpp') diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index 3868442c5..3f916c92a 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -834,13 +834,14 @@ MultiParticleContainer::mapSpeciesProduct () int MultiParticleContainer::getSpeciesID (std::string product_str) const { + auto species_and_lasers_names = GetSpeciesAndLasersNames(); int i_product = 0; bool found = 0; // Loop over species - for (int i=0; i < static_cast(species_names.size()); i++){ + for (int i=0; i < static_cast(species_and_lasers_names.size()); i++){ // If species name matches, store its ID // into i_product - if (species_names[i] == product_str){ + if (species_and_lasers_names[i] == product_str){ found = 1; i_product = i; } -- cgit v1.2.3