diff options
Diffstat (limited to '')
-rw-r--r-- | Source/Particles/MultiParticleContainer.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index ba8825522..ec4ffe8e1 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -223,28 +223,39 @@ MultiParticleContainer::ReadParameters () } - // if the input string for E_ext_particle_s is + // if the input string for E_ext_particle_s or B_ext_particle_s is // "repeated_plasma_lens" then the plasma lens properties // must be provided in the input file. - if (m_E_ext_particle_s == "repeated_plasma_lens") { + if (m_E_ext_particle_s == "repeated_plasma_lens" || + m_B_ext_particle_s == "repeated_plasma_lens") { queryWithParser(pp_particles, "repeated_plasma_lens_period", m_repeated_plasma_lens_period); getArrWithParser(pp_particles, "repeated_plasma_lens_starts", h_repeated_plasma_lens_starts); getArrWithParser(pp_particles, "repeated_plasma_lens_lengths", h_repeated_plasma_lens_lengths); - getArrWithParser(pp_particles, "repeated_plasma_lens_strengths", h_repeated_plasma_lens_strengths); int n_lenses = static_cast<int>(h_repeated_plasma_lens_starts.size()); d_repeated_plasma_lens_starts.resize(n_lenses); d_repeated_plasma_lens_lengths.resize(n_lenses); - d_repeated_plasma_lens_strengths.resize(n_lenses); amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, h_repeated_plasma_lens_starts.begin(), h_repeated_plasma_lens_starts.end(), d_repeated_plasma_lens_starts.begin()); amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, h_repeated_plasma_lens_lengths.begin(), h_repeated_plasma_lens_lengths.end(), d_repeated_plasma_lens_lengths.begin()); - amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, - h_repeated_plasma_lens_strengths.begin(), h_repeated_plasma_lens_strengths.end(), - d_repeated_plasma_lens_strengths.begin()); + + if (m_E_ext_particle_s == "repeated_plasma_lens") { + getArrWithParser(pp_particles, "repeated_plasma_lens_strengths_E", h_repeated_plasma_lens_strengths_E); + d_repeated_plasma_lens_strengths_E.resize(n_lenses); + amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, + h_repeated_plasma_lens_strengths_E.begin(), h_repeated_plasma_lens_strengths_E.end(), + d_repeated_plasma_lens_strengths_E.begin()); + } + if (m_B_ext_particle_s == "repeated_plasma_lens") { + getArrWithParser(pp_particles, "repeated_plasma_lens_strengths_B", h_repeated_plasma_lens_strengths_B); + d_repeated_plasma_lens_strengths_B.resize(n_lenses); + amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, + h_repeated_plasma_lens_strengths_B.begin(), h_repeated_plasma_lens_strengths_B.end(), + d_repeated_plasma_lens_strengths_B.begin()); + } amrex::Gpu::synchronize(); } |