10#ifndef IMPACTX_ELEMENTS_MIXIN_BEAMOPTIC_H
11#define IMPACTX_ELEMENTS_MIXIN_BEAMOPTIC_H
40 template <
typename T_Element>
110 template<
int SIMD_WIDTH>
117 int const i = idx.
index;
132 part_x.copy_from(&
m_part_x[i], stdx::element_aligned);
133 part_y.copy_from(&
m_part_y[i], stdx::element_aligned);
134 part_t.copy_from(&
m_part_t[i], stdx::element_aligned);
135 part_px.copy_from(&
m_part_px[i], stdx::element_aligned);
136 part_py.copy_from(&
m_part_py[i], stdx::element_aligned);
137 part_pt.copy_from(&
m_part_pt[i], stdx::element_aligned);
138 part_idcpu.copy_from(&
m_part_idcpu[i], stdx::element_aligned);
147 if constexpr (
is_nth_arg_non_const(&T_Element::template
operator()<
decltype(part_x),
decltype(part_idcpu)>, 0))
148 part_x.copy_to(&
m_part_x[i], stdx::element_aligned);
149 if constexpr (
is_nth_arg_non_const(&T_Element::template
operator()<
decltype(part_x),
decltype(part_idcpu)>, 1))
150 part_y.copy_to(&
m_part_y[i], stdx::element_aligned);
151 if constexpr (
is_nth_arg_non_const(&T_Element::template
operator()<
decltype(part_x),
decltype(part_idcpu)>, 2))
152 part_t.copy_to(&
m_part_t[i], stdx::element_aligned);
153 if constexpr (
is_nth_arg_non_const(&T_Element::template
operator()<
decltype(part_x),
decltype(part_idcpu)>, 3))
154 part_px.copy_to(&
m_part_px[i], stdx::element_aligned);
155 if constexpr (
is_nth_arg_non_const(&T_Element::template
operator()<
decltype(part_x),
decltype(part_idcpu)>, 4))
156 part_py.copy_to(&
m_part_py[i], stdx::element_aligned);
157 if constexpr (
is_nth_arg_non_const(&T_Element::template
operator()<
decltype(part_x),
decltype(part_idcpu)>, 5))
158 part_pt.copy_to(&
m_part_pt[i], stdx::element_aligned);
159 if constexpr (
is_nth_arg_non_const(&T_Element::template
operator()<
decltype(part_x),
decltype(part_idcpu)>, 6))
160 part_idcpu.copy_to(&
m_part_idcpu[i], stdx::element_aligned);
178 template<
typename T_Element >
198 element, part_x, part_y, part_t, part_px, part_py, part_pt, part_idcpu, ref_part);
217 template<
typename T_Element>
233 std::is_base_of_v<BeamOptic, T_Element>,
234 "BeamOptic can only be used as a mixin class!"
237 T_Element& element = *
static_cast<T_Element*
>(
this);
238 push_all(pc, element, step, period);
254 std::is_base_of_v<BeamOptic, T_Element>,
255 "BeamOptic can only be used as a mixin class!"
258 T_Element& element = *
static_cast<T_Element*
>(
this);
#define AMREX_FORCE_INLINE
SoARef GetStructOfArrays() const
T_ParticleType ParticleType
Definition ImpactXParticleContainer.H:133
impactx::ParIterSoA iterator
amrex iterator for particle boxes
Definition ImpactXParticleContainer.H:136
constexpr bool is_vectorized
constexpr bool is_nth_arg_non_const(R(*)(Args...), int n)
amrex::ParticleReal SIMDParticleReal
std::enable_if_t< std::is_integral_v< T > > ParallelFor(TypeList< CTOs... > ctos, std::array< int, sizeof...(CTOs)> const &runtime_options, T N, F &&f)
AMREX_ATTRIBUTE_FLATTEN_FOR void ParallelForSIMD(N n, L const &f) noexcept
void push_all_particles(ImpactXParticleContainer::iterator &pti, RefPart &AMREX_RESTRICT ref_part, T_Element &element)
Definition beamoptic.H:179
Definition alignment.H:23
@ t
fixed t as the independent variable
Definition ImpactXParticleContainer.H:38
void push_all(ImpactXParticleContainer &pc, T_Element &element, int step, int period, bool omp_parallel=true)
Definition PushAll.H:33
@ nattribs
the number of attributes above (always last)
Definition ImpactXParticleContainer.H:80
@ pt
energy deviation, scaled by speed of light * the magnitude of the reference momentum [unitless] (at f...
Definition ImpactXParticleContainer.H:53
@ y
position in y [m] (at fixed s or t)
Definition ImpactXParticleContainer.H:49
@ t
time-of-flight ct [m] (at fixed s)
Definition ImpactXParticleContainer.H:50
@ px
momentum in x, scaled by the magnitude of the reference momentum [unitless] (at fixed s or t)
Definition ImpactXParticleContainer.H:51
@ nattribs
the number of attributes above (always last)
Definition ImpactXParticleContainer.H:56
@ py
momentum in y, scaled by the magnitude of the reference momentum [unitless] (at fixed s or t)
Definition ImpactXParticleContainer.H:52
@ x
position in x [m] (at fixed s or t)
Definition ImpactXParticleContainer.H:48
Definition ReferenceParticle.H:31
Definition beamoptic.H:219
void operator()(ImpactXParticleContainer &pc, int step, int period)
Definition beamoptic.H:226
Definition beamoptic.H:42
amrex::ParticleReal *const AMREX_RESTRICT m_part_px
Definition beamoptic.H:169
amrex::ParticleReal *const AMREX_RESTRICT m_part_t
Definition beamoptic.H:168
T_Element m_element
Definition beamoptic.H:165
amrex::ParticleReal *const AMREX_RESTRICT m_part_pt
Definition beamoptic.H:171
PushSingleParticle(PushSingleParticle &&)=default
uint64_t *const AMREX_RESTRICT m_part_idcpu
Definition beamoptic.H:172
amrex::ParticleReal *const AMREX_RESTRICT m_part_x
Definition beamoptic.H:166
amrex::ParticleReal *const AMREX_RESTRICT m_part_y
Definition beamoptic.H:167
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:58
amrex::ParticleTile< amrex::SoAParticle< RealSoA::nattribs, IntSoA::nattribs >, RealSoA::nattribs, IntSoA::nattribs > ParticleTileType
Definition beamoptic.H:44
amrex::ParticleReal *const AMREX_RESTRICT m_part_py
Definition beamoptic.H:170
ImpactXParticleContainer::ParticleType PType
Definition beamoptic.H:43
PushSingleParticle()=delete
~PushSingleParticle()=default
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void operator()(int i) const
Definition beamoptic.H:89
RefPart m_ref_part
Definition beamoptic.H:173
PushSingleParticle(PushSingleParticle const &)=default