diff options
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 |