aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/MultiParticleContainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Particles/MultiParticleContainer.cpp')
-rw-r--r--Source/Particles/MultiParticleContainer.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp
index 4b9624ba8..5cf9bcb34 100644
--- a/Source/Particles/MultiParticleContainer.cpp
+++ b/Source/Particles/MultiParticleContainer.cpp
@@ -244,13 +244,36 @@ MultiParticleContainer::ReadParameters ()
if (m_E_ext_particle_s == "repeated_plasma_lens") {
getArrWithParser(pp_particles, "repeated_plasma_lens_strengths_E", h_repeated_plasma_lens_strengths_E);
+ }
+ if (m_B_ext_particle_s == "repeated_plasma_lens") {
+ getArrWithParser(pp_particles, "repeated_plasma_lens_strengths_B", h_repeated_plasma_lens_strengths_B);
+ }
+ if (WarpX::gamma_boost > 1._rt) {
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ m_E_ext_particle_s == "repeated_plasma_lens" || m_E_ext_particle_s == "default",
+ "With gamma_boost > 1, E_ext_particle_init_style and B_ext_particle_init_style"
+ "must be either repeated_plasma_lens or unspecified");
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ m_B_ext_particle_s == "repeated_plasma_lens" || m_B_ext_particle_s == "default",
+ "With gamma_boost > 1, E_ext_particle_init_style and B_ext_particle_init_style"
+ "must be either repeated_plasma_lens or unspecified");
+ if (m_E_ext_particle_s == "default") {
+ m_E_ext_particle_s = "repeated_plasma_lens";
+ h_repeated_plasma_lens_strengths_E.resize(n_lenses);
+ }
+ if (m_B_ext_particle_s == "default") {
+ m_B_ext_particle_s = "repeated_plasma_lens";
+ h_repeated_plasma_lens_strengths_B.resize(n_lenses);
+ }
+ }
+
+ if (m_E_ext_particle_s == "repeated_plasma_lens") {
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(),