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.H | |
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.H')
-rw-r--r-- | Source/Particles/Gather/GetExternalFields.H | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/Particles/Gather/GetExternalFields.H b/Source/Particles/Gather/GetExternalFields.H index 468b8d078..c09d13ab3 100644 --- a/Source/Particles/Gather/GetExternalFields.H +++ b/Source/Particles/Gather/GetExternalFields.H @@ -34,6 +34,7 @@ struct GetExternalField const amrex::Real* AMREX_RESTRICT m_repeated_plasma_lens_lengths = nullptr; const amrex::Real* AMREX_RESTRICT m_repeated_plasma_lens_strengths = nullptr; int m_n_lenses; + int m_lens_is_electric; amrex::Real m_dt; const amrex::ParticleReal* AMREX_RESTRICT m_ux = nullptr; const amrex::ParticleReal* AMREX_RESTRICT m_uy = nullptr; @@ -94,8 +95,13 @@ struct GetExternalField if (fl > fr) frac = (lens_end - zl)*dzi; if (fr > fl) frac = (zr - lens_start)*dzi; - field_x += x*frac*m_repeated_plasma_lens_strengths[i_lens]; - field_y += y*frac*m_repeated_plasma_lens_strengths[i_lens]; + if (m_lens_is_electric) { + field_x += x*frac*m_repeated_plasma_lens_strengths[i_lens]; + field_y += y*frac*m_repeated_plasma_lens_strengths[i_lens]; + } else { + field_x += y*frac*m_repeated_plasma_lens_strengths[i_lens]; + field_y -= x*frac*m_repeated_plasma_lens_strengths[i_lens]; + } } else |