aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/MultiParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2021-08-20 20:02:21 -0700
committerGravatar GitHub <noreply@github.com> 2021-08-20 20:02:21 -0700
commitb27c1f4511685300329cfffc34a4a6a1a20a6a94 (patch)
tree7f8012d0d148e72ea4295d0eb5fb19adab369569 /Source/Particles/MultiParticleContainer.cpp
parent9f1e291bf86221e41c8495658c140d249d35da65 (diff)
downloadWarpX-b27c1f4511685300329cfffc34a4a6a1a20a6a94.tar.gz
WarpX-b27c1f4511685300329cfffc34a4a6a1a20a6a94.tar.zst
WarpX-b27c1f4511685300329cfffc34a4a6a1a20a6a94.zip
Added transform of fields from lab to boosted frame (#2201)
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(),