diff options
Diffstat (limited to 'Source/Particles/Gather/GetExternalFields.H')
-rw-r--r-- | Source/Particles/Gather/GetExternalFields.H | 49 |
1 files changed, 7 insertions, 42 deletions
diff --git a/Source/Particles/Gather/GetExternalFields.H b/Source/Particles/Gather/GetExternalFields.H index 8e08fc101..f762febd5 100644 --- a/Source/Particles/Gather/GetExternalFields.H +++ b/Source/Particles/Gather/GetExternalFields.H @@ -2,6 +2,7 @@ #define WARPX_PARTICLES_GATHER_GETEXTERNALFIELDS_H_ #include "Particles/WarpXParticleContainer.H" +#include "Particles/Pusher/GetAndSetPosition.H" #include <AMReX_REAL.H> @@ -60,27 +61,9 @@ struct GetExternalField */ struct GetExternalEField : GetExternalField { - GetExternalEField (const WarpXParIter& a_pti, int a_offset = 0) noexcept - { - auto& warpx = WarpX::GetInstance(); - auto& mypc = warpx.GetPartContainer(); - if (mypc.m_E_ext_particle_s=="constant" || mypc.m_E_ext_particle_s=="default") - { - m_type = Constant; - m_field_value[0] = mypc.m_E_external_particle[0]; - m_field_value[1] = mypc.m_E_external_particle[1]; - m_field_value[2] = mypc.m_E_external_particle[2]; - } - else if (mypc.m_E_ext_particle_s=="parse_e_ext_particle_function") - { - m_type = Parser; - m_time = warpx.gett_new(a_pti.GetLevel()); - m_get_position = GetParticlePosition(a_pti, a_offset); - m_xfield_partparser = mypc.m_Ex_particle_parser.get(); - m_yfield_partparser = mypc.m_Ey_particle_parser.get(); - m_zfield_partparser = mypc.m_Ez_particle_parser.get(); - } - } + GetExternalEField () = default; + + GetExternalEField (const WarpXParIter& a_pti, int a_offset = 0) noexcept; }; /** \brief Functor that can be used to assign the external @@ -88,27 +71,9 @@ struct GetExternalEField : GetExternalField */ struct GetExternalBField : GetExternalField { - GetExternalBField (const WarpXParIter& a_pti, int a_offset = 0) noexcept - { - auto& warpx = WarpX::GetInstance(); - auto& mypc = warpx.GetPartContainer(); - if (mypc.m_B_ext_particle_s=="constant" || mypc.m_B_ext_particle_s=="default") - { - m_type = Constant; - m_field_value[0] = mypc.m_B_external_particle[0]; - m_field_value[1] = mypc.m_B_external_particle[1]; - m_field_value[2] = mypc.m_B_external_particle[2]; - } - else if (mypc.m_B_ext_particle_s=="parse_e_ext_particle_function") - { - m_type = Parser; - m_time = warpx.gett_new(a_pti.GetLevel()); - m_get_position = GetParticlePosition(a_pti, a_offset); - m_xfield_partparser = mypc.m_Bx_particle_parser.get(); - m_yfield_partparser = mypc.m_By_particle_parser.get(); - m_zfield_partparser = mypc.m_Bz_particle_parser.get(); - } - } + GetExternalBField () = default; + + GetExternalBField (const WarpXParIter& a_pti, int a_offset = 0) noexcept; }; #endif |