10 #ifndef IMPACTX_ELEMENTS_MIXIN_BEAMOPTIC_H
11 #define IMPACTX_ELEMENTS_MIXIN_BEAMOPTIC_H
19 #include <type_traits>
39 template <
typename T_Element>
58 amrex::ParticleReal* AMREX_RESTRICT part_x,
59 amrex::ParticleReal* AMREX_RESTRICT part_y,
60 amrex::ParticleReal* AMREX_RESTRICT part_t,
61 amrex::ParticleReal* AMREX_RESTRICT part_px,
62 amrex::ParticleReal* AMREX_RESTRICT part_py,
63 amrex::ParticleReal* AMREX_RESTRICT part_pt,
64 uint64_t* AMREX_RESTRICT part_idcpu,
116 template<
typename T_Element >
119 RefPart & AMREX_RESTRICT ref_part,
136 element, part_x, part_y, part_t, part_px, part_py, part_pt, part_idcpu, ref_part);
147 template<
typename T_Element>
157 std::is_base_of_v<BeamOptic, T_Element>,
158 "BeamOptic can only be used as a mixin class!"
161 T_Element& element = *
static_cast<T_Element*
>(
this);
174 RefPart & AMREX_RESTRICT ref_part
178 std::is_base_of_v<BeamOptic, T_Element>,
179 "BeamOptic can only be used as a mixin class!"
182 T_Element& element = *
static_cast<T_Element*
>(
this);
183 detail::push_all_particles<T_Element>(pti, ref_part, element);
#define AMREX_FORCE_INLINE
SoARef GetStructOfArrays() const
T_ParticleType ParticleType
Definition: ImpactXParticleContainer.H:127
Definition: ImpactXParticleContainer.H:96
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:117
Definition: alignment.H:23
@ t
fixed t as the independent variable
void push_all(ImpactXParticleContainer &pc, T_Element &element, [[maybe_unused]] int step, [[maybe_unused]] bool omp_parallel=true)
Definition: PushAll.H:32
@ nattribs
the number of attributes above (always last)
Definition: ImpactXParticleContainer.H:78
@ pt
energy deviation, scaled by speed of light * the magnitude of the reference momentum [unitless] (at f...
Definition: ImpactXParticleContainer.H:51
@ y
position in y [m] (at fixed s or t)
Definition: ImpactXParticleContainer.H:47
@ t
time-of-flight ct [m] (at fixed s)
Definition: ImpactXParticleContainer.H:48
@ px
momentum in x, scaled by the magnitude of the reference momentum [unitless] (at fixed s or t)
Definition: ImpactXParticleContainer.H:49
@ nattribs
the number of attributes above (always last)
Definition: ImpactXParticleContainer.H:54
@ py
momentum in y, scaled by the magnitude of the reference momentum [unitless] (at fixed s or t)
Definition: ImpactXParticleContainer.H:50
@ x
position in x [m] (at fixed s or t)
Definition: ImpactXParticleContainer.H:46
Definition: ReferenceParticle.H:30
Definition: beamoptic.H:149
void operator()(ImpactXParticleContainer &pc, int step)
Definition: beamoptic.H:151
Definition: beamoptic.H:41
amrex::ParticleReal *const AMREX_RESTRICT m_part_t
Definition: beamoptic.H:106
amrex::ParticleReal *const AMREX_RESTRICT m_part_px
Definition: beamoptic.H:107
amrex::ParticleReal *const AMREX_RESTRICT m_part_py
Definition: beamoptic.H:108
T_Element const m_element
Definition: beamoptic.H:103
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void operator()(long i) const
Definition: beamoptic.H:85
PushSingleParticle(PushSingleParticle const &)=default
PushSingleParticle(T_Element element, amrex::ParticleReal *AMREX_RESTRICT part_x, amrex::ParticleReal *AMREX_RESTRICT part_y, amrex::ParticleReal *AMREX_RESTRICT part_t, amrex::ParticleReal *AMREX_RESTRICT part_px, amrex::ParticleReal *AMREX_RESTRICT part_py, amrex::ParticleReal *AMREX_RESTRICT part_pt, uint64_t *AMREX_RESTRICT part_idcpu, RefPart ref_part)
Definition: beamoptic.H:57
amrex::ParticleReal *const AMREX_RESTRICT m_part_pt
Definition: beamoptic.H:109
~PushSingleParticle()=default
ImpactXParticleContainer::ParticleType PType
Definition: beamoptic.H:42
amrex::ParticleReal *const AMREX_RESTRICT m_part_x
Definition: beamoptic.H:104
PushSingleParticle()=delete
amrex::ParticleReal *const AMREX_RESTRICT m_part_y
Definition: beamoptic.H:105
RefPart const m_ref_part
Definition: beamoptic.H:111
PushSingleParticle(PushSingleParticle &&)=default
uint64_t *const AMREX_RESTRICT m_part_idcpu
Definition: beamoptic.H:110