10 #ifndef IMPACTX_ELEMENTS_MIXIN_BEAMOPTIC_H
11 #define IMPACTX_ELEMENTS_MIXIN_BEAMOPTIC_H
19 #include <type_traits>
39 template <
typename T_Element>
54 PType* AMREX_RESTRICT aos_ptr,
55 amrex::ParticleReal* AMREX_RESTRICT part_px,
56 amrex::ParticleReal* AMREX_RESTRICT part_py,
57 amrex::ParticleReal* AMREX_RESTRICT part_pt,
102 template<
typename T_Element >
105 RefPart & AMREX_RESTRICT ref_part,
122 element, aos_ptr, part_px, part_py, part_pt, ref_part);
133 template<
typename T_Element>
143 std::is_base_of_v<BeamOptic, T_Element>,
144 "BeamOptic can only be used as a mixin class!"
147 T_Element& element = *
static_cast<T_Element*
>(
this);
160 RefPart & AMREX_RESTRICT ref_part
164 std::is_base_of_v<BeamOptic, T_Element>,
165 "BeamOptic can only be used as a mixin class!"
168 T_Element& element = *
static_cast<T_Element*
>(
this);
169 detail::push_all_particles<T_Element>(pti, ref_part, element);
#define AMREX_FORCE_INLINE
SoARef GetStructOfArrays() const
AoSRef GetArrayOfStructs() const
T_ParticleType ParticleType
Definition: ImpactXParticleContainer.H:138
Definition: ImpactXParticleContainer.H:107
std::enable_if_t< std::is_integral< T >::value > ParallelFor(TypeList< CTOs... >, std::array< int, sizeof...(CTOs)> const &runtime_options, T N, F &&f)
void push_all_particles(ImpactXParticleContainer::iterator &pti, RefPart &AMREX_RESTRICT ref_part, T_Element &element)
Definition: beamoptic.H:103
Definition: beamoptic.H:23
void push_all(ImpactXParticleContainer &pc, T_Element &element, [[maybe_unused]] int step, [[maybe_unused]] bool omp_parallel=true)
Definition: PushAll.H:32
@ pt
energy deviation, scaled by speed of light * the magnitude of the reference momentum [unitless] (at f...
Definition: ImpactXParticleContainer.H:70
@ px
momentum in x, scaled by the magnitude of the reference momentum [unitless] (at fixed s or t)
Definition: ImpactXParticleContainer.H:68
@ py
momentum in y, scaled by the magnitude of the reference momentum [unitless] (at fixed s or t)
Definition: ImpactXParticleContainer.H:69
Definition: ReferenceParticle.H:30
Definition: beamoptic.H:135
void operator()(ImpactXParticleContainer &pc, int step)
Definition: beamoptic.H:137
Definition: beamoptic.H:41
amrex::ParticleReal *const AMREX_RESTRICT m_part_px
Definition: beamoptic.H:94
amrex::ParticleReal *const AMREX_RESTRICT m_part_py
Definition: beamoptic.H:95
T_Element const m_element
Definition: beamoptic.H:92
PType *const AMREX_RESTRICT m_aos_ptr
Definition: beamoptic.H:93
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void operator()(long i) const
Definition: beamoptic.H:76
PushSingleParticle(PushSingleParticle const &)=default
amrex::ParticleReal *const AMREX_RESTRICT m_part_pt
Definition: beamoptic.H:96
~PushSingleParticle()=default
ImpactXParticleContainer::ParticleType PType
Definition: beamoptic.H:42
PushSingleParticle()=delete
RefPart const m_ref_part
Definition: beamoptic.H:97
PushSingleParticle(PushSingleParticle &&)=default
PushSingleParticle(T_Element element, PType *AMREX_RESTRICT aos_ptr, amrex::ParticleReal *AMREX_RESTRICT part_px, amrex::ParticleReal *AMREX_RESTRICT part_py, amrex::ParticleReal *AMREX_RESTRICT part_pt, RefPart ref_part)
Definition: beamoptic.H:53