aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/Gather/GetExternalFields.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/Gather/GetExternalFields.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 'Source/Particles/Gather/GetExternalFields.cpp')
-rw-r--r--Source/Particles/Gather/GetExternalFields.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/Particles/Gather/GetExternalFields.cpp b/Source/Particles/Gather/GetExternalFields.cpp
index 0808bd6c1..03c4dc2b8 100644
--- a/Source/Particles/Gather/GetExternalFields.cpp
+++ b/Source/Particles/Gather/GetExternalFields.cpp
@@ -29,6 +29,21 @@ GetExternalEField::GetExternalEField (const WarpXParIter& a_pti, int a_offset) n
m_yfield_partparser = mypc.m_Ey_particle_parser->compile<4>();
m_zfield_partparser = mypc.m_Ez_particle_parser->compile<4>();
}
+ else if (mypc.m_E_ext_particle_s=="repeated_plasma_lens")
+ {
+ m_type = RepeatedPlasmaLens;
+ m_dt = warpx.getdt(a_pti.GetLevel());
+ m_get_position = GetParticlePosition(a_pti, a_offset);
+ auto& attribs = a_pti.GetAttribs();
+ m_ux = attribs[PIdx::ux].dataPtr() + a_offset;
+ m_uy = attribs[PIdx::uy].dataPtr() + a_offset;
+ m_uz = attribs[PIdx::uz].dataPtr() + a_offset;
+ m_repeated_plasma_lens_period = mypc.m_repeated_plasma_lens_period;
+ m_n_lenses = static_cast<int>(mypc.h_repeated_plasma_lens_starts.size());
+ m_repeated_plasma_lens_starts = mypc.d_repeated_plasma_lens_starts.data();
+ m_repeated_plasma_lens_lengths = mypc.d_repeated_plasma_lens_lengths.data();
+ m_repeated_plasma_lens_strengths = mypc.d_repeated_plasma_lens_strengths.data();
+ }
}
GetExternalBField::GetExternalBField (const WarpXParIter& a_pti, int a_offset) noexcept