10 #ifndef IMPACTX_PROT_H
11 #define IMPACTX_PROT_H
33 static constexpr
auto name =
"PRot";
46 PRot( amrex::ParticleReal
const phi_in, amrex::ParticleReal
const phi_out )
52 using BeamOptic::operator();
65 PType& AMREX_RESTRICT p,
66 amrex::ParticleReal & AMREX_RESTRICT px,
67 amrex::ParticleReal & AMREX_RESTRICT py,
68 amrex::ParticleReal & AMREX_RESTRICT pt,
69 RefPart const & refpart)
const {
71 using namespace amrex::literals;
74 amrex::ParticleReal
const x = p.pos(
RealAoS::x);
75 amrex::ParticleReal
const y = p.pos(
RealAoS::y);
76 amrex::ParticleReal
const t = p.pos(
RealAoS::t);
79 amrex::ParticleReal
const beta = refpart.
beta();
82 amrex::ParticleReal pxout = px;
83 amrex::ParticleReal pyout = py;
84 amrex::ParticleReal ptout = pt;
88 amrex::ParticleReal pz =
sqrt(1.0_prt - 2.0_prt*pt/
beta
90 amrex::ParticleReal pzf = pz*cos(theta) - (px +
95 pxout = px*cos(theta) + (pz - cos(
m_phi_in))*sin(theta);
111 using Thin::operator();
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
T_ParticleType ParticleType
static constexpr amrex::Real pi
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > pow(const GpuComplex< T > &a_z, const T &a_y) noexcept
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > sqrt(const GpuComplex< T > &a_z) noexcept
Definition: ImpactX.cpp:32
ImpactXParticleContainer::ParticleType PType
Definition: PRot.H:34
static constexpr amrex::ParticleReal degree2rad
Definition: PRot.H:36
static constexpr auto name
Definition: PRot.H:33
PRot(amrex::ParticleReal const phi_in, amrex::ParticleReal const phi_out)
Definition: PRot.H:46
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator()(PType &AMREX_RESTRICT p, amrex::ParticleReal &AMREX_RESTRICT px, amrex::ParticleReal &AMREX_RESTRICT py, amrex::ParticleReal &AMREX_RESTRICT pt, RefPart const &refpart) const
Definition: PRot.H:64
amrex::ParticleReal m_phi_out
normalized (max) RF voltage drop.
Definition: PRot.H:115
amrex::ParticleReal m_phi_in
Definition: PRot.H:114
@ x
position in x [m] (at fixed s OR fixed t)
Definition: ImpactXParticleContainer.H:42
@ y
position in y [m] (at fixed s OR fixed t)
Definition: ImpactXParticleContainer.H:43
@ t
c * time-of-flight [m] (at fixed s)
Definition: ImpactXParticleContainer.H:44
Definition: ReferenceParticle.H:30
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal beta() const
Definition: ReferenceParticle.H:64
Definition: beamoptic.H:135
Definition: nofinalize.H:22