diff options
author | 2021-08-05 17:22:45 -0700 | |
---|---|---|
committer | 2021-08-05 17:22:45 -0700 | |
commit | 48fa50a7d92a01061e6563fe2c52f55a0de76bb7 (patch) | |
tree | 2843da7183a4c1f0c14cd8e44d485897ab8b7ae6 /Source/Particles/Gather/GetExternalFields.cpp | |
parent | dc4a2026aae0cc282e09906bfbd621b5bcbfdf7e (diff) | |
download | WarpX-48fa50a7d92a01061e6563fe2c52f55a0de76bb7.tar.gz WarpX-48fa50a7d92a01061e6563fe2c52f55a0de76bb7.tar.zst WarpX-48fa50a7d92a01061e6563fe2c52f55a0de76bb7.zip |
Added B field to plasma lens (#2163)
* Added B field to plasma lens
* Fix B field and updated CI test to include the B field
* Updated benchmark
Diffstat (limited to 'Source/Particles/Gather/GetExternalFields.cpp')
-rw-r--r-- | Source/Particles/Gather/GetExternalFields.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/Particles/Gather/GetExternalFields.cpp b/Source/Particles/Gather/GetExternalFields.cpp index 03c4dc2b8..d97a69985 100644 --- a/Source/Particles/Gather/GetExternalFields.cpp +++ b/Source/Particles/Gather/GetExternalFields.cpp @@ -32,6 +32,7 @@ GetExternalEField::GetExternalEField (const WarpXParIter& a_pti, int a_offset) n else if (mypc.m_E_ext_particle_s=="repeated_plasma_lens") { m_type = RepeatedPlasmaLens; + m_lens_is_electric = 1; m_dt = warpx.getdt(a_pti.GetLevel()); m_get_position = GetParticlePosition(a_pti, a_offset); auto& attribs = a_pti.GetAttribs(); @@ -42,7 +43,7 @@ GetExternalEField::GetExternalEField (const WarpXParIter& a_pti, int a_offset) n 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(); + m_repeated_plasma_lens_strengths = mypc.d_repeated_plasma_lens_strengths_E.data(); } } @@ -66,4 +67,20 @@ GetExternalBField::GetExternalBField (const WarpXParIter& a_pti, int a_offset) n m_yfield_partparser = mypc.m_By_particle_parser->compile<4>(); m_zfield_partparser = mypc.m_Bz_particle_parser->compile<4>(); } + else if (mypc.m_B_ext_particle_s=="repeated_plasma_lens") + { + m_type = RepeatedPlasmaLens; + m_lens_is_electric = 0; + 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_B.data(); + } } |