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);
175 #endif // IMPACTX_ELEMENTS_MIXIN_BEAMOPTIC_H momentum in z, scaled by the magnitude of the reference momentum [unitless] (at fixed t) OR energy de...
Definition: ImpactXParticleContainer.H:65
amrex::ParticleReal *const AMREX_RESTRICT m_part_py
Definition: beamoptic.H:95
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void operator()(long i) const
Definition: beamoptic.H:76
Definition: ImpactXParticleContainer.H:95
Definition: beamoptic.H:40
SoARef GetStructOfArrays() const
momentum in y, scaled by the magnitude of the reference momentum [unitless] (at fixed t or s) ...
Definition: ImpactXParticleContainer.H:64
AoSRef GetArrayOfStructs() const
momentum in x, scaled by the magnitude of the reference momentum [unitless] (at fixed t or s) ...
Definition: ImpactXParticleContainer.H:63
RefPart const m_ref_part
Definition: beamoptic.H:97
~PushSingleParticle()=default
amrex::ParticleReal *const AMREX_RESTRICT m_part_pt
Definition: beamoptic.H:96
Definition: beamoptic.H:134
PushSingleParticle()=delete
#define AMREX_FORCE_INLINE
std::enable_if_t< std::is_integral< T >::value > ParallelFor(TypeList< CTOs... >, std::array< int, sizeof...(CTOs)> const &runtime_options, T N, F &&f)
T_Element const m_element
Definition: beamoptic.H:92
PType *const AMREX_RESTRICT m_aos_ptr
Definition: beamoptic.H:93
Particle< NStructReal, NStructInt > ParticleType
void push_all(ImpactXParticleContainer &pc, T_Element &element, [[maybe_unused]] int step, [[maybe_unused]] bool omp_parallel=true)
Definition: PushAll.H:30
Definition: ReferenceParticle.H:29
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
ImpactXParticleContainer::ParticleType PType
Definition: beamoptic.H:42
Definition: ImpactXParticleContainer.H:126
Definition: beamoptic.H:22
amrex::ParticleReal *const AMREX_RESTRICT m_part_px
Definition: beamoptic.H:94
void push_all_particles(ImpactXParticleContainer::iterator &pti, RefPart &AMREX_RESTRICT ref_part, T_Element &element)
Definition: beamoptic.H:103