aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/MultiParticleContainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Source/Particles/MultiParticleContainer.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp
index 5e59d6eaa..b0a1d211f 100644
--- a/Source/Particles/MultiParticleContainer.cpp
+++ b/Source/Particles/MultiParticleContainer.cpp
@@ -223,6 +223,31 @@ MultiParticleContainer::ReadParameters ()
}
+ // if the input string for E_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") {
+ 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());
+ amrex::Gpu::synchronize();
+ }
+
// particle species
pp_particles.queryarr("species_names", species_names);