From b27c1f4511685300329cfffc34a4a6a1a20a6a94 Mon Sep 17 00:00:00 2001 From: David Grote Date: Fri, 20 Aug 2021 20:02:21 -0700 Subject: Added transform of fields from lab to boosted frame (#2201) --- Source/Particles/MultiParticleContainer.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'Source/Particles/MultiParticleContainer.cpp') 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(), -- cgit v1.2.3