aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/MultiParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2021-07-20 20:59:28 -0700
committerGravatar GitHub <noreply@github.com> 2021-07-21 03:59:28 +0000
commit30a7f5ef5a561f59c70d127b54c17b5bcd82ede8 (patch)
tree05f6bfda983aa6b1b5f6084bfdbc453abef3d565 /Source/Particles/MultiParticleContainer.cpp
parent4a1d30e003ebe4d91565f2be09dad2362cd99f6b (diff)
downloadWarpX-30a7f5ef5a561f59c70d127b54c17b5bcd82ede8.tar.gz
WarpX-30a7f5ef5a561f59c70d127b54c17b5bcd82ede8.tar.zst
WarpX-30a7f5ef5a561f59c70d127b54c17b5bcd82ede8.zip
Implements a periodically repeating plasma lenses (#2080)
* Implements a periodically repeating plasma lens * Added documentation for plasma lenses * Added m_n_lenses to avoid use of size in device code * Change arrays to device arrays * Put DeviceVectors in the MultiParticleContainer * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update Source/Particles/Gather/GetExternalFields.cpp Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Added CI test * Updated CI test * LGTM clean up * Moved literal namespace inside the routine Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
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);