10 #ifndef IMPACTX_PROT_H
11 #define IMPACTX_PROT_H
34 static constexpr
auto name =
"PRot";
48 amrex::ParticleReal phi_in,
49 amrex::ParticleReal phi_out
56 using BeamOptic::operator();
72 amrex::ParticleReal & AMREX_RESTRICT x,
73 amrex::ParticleReal & AMREX_RESTRICT y,
74 amrex::ParticleReal & AMREX_RESTRICT t,
75 amrex::ParticleReal & AMREX_RESTRICT px,
76 amrex::ParticleReal & AMREX_RESTRICT py,
77 amrex::ParticleReal & AMREX_RESTRICT pt,
78 [[maybe_unused]] uint64_t & AMREX_RESTRICT idcpu,
82 using namespace amrex::literals;
85 amrex::ParticleReal
const beta = refpart.
beta();
88 amrex::ParticleReal xout =
x;
89 amrex::ParticleReal yout = y;
90 amrex::ParticleReal tout =
t;
91 amrex::ParticleReal pxout = px;
92 amrex::ParticleReal pyout = py;
93 amrex::ParticleReal ptout = pt;
100 amrex::ParticleReal
const pz =
sqrt(1.0_prt - 2.0_prt*pt/
beta
101 +
pow(pt,2) -
pow(py,2) -
pow(px + sin_phi_in,2));
102 amrex::ParticleReal
const pzf = pz*cos_theta - (px + sin_phi_in)*sin_theta;
106 pxout = px*cos_theta + (pz - cos_phi_in)*sin_theta;
108 yout = y + py*
x*sin_theta/pzf;
111 tout =
t - (pt - 1.0_prt/
beta)*
x*sin_theta/pzf;
124 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 std::pair< double, double > sincos(double x)
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:33
@ t
fixed t as the independent variable
PRot(amrex::ParticleReal phi_in, amrex::ParticleReal phi_out)
Definition: PRot.H:47
ImpactXParticleContainer::ParticleType PType
Definition: PRot.H:35
static constexpr amrex::ParticleReal degree2rad
Definition: PRot.H:37
static constexpr auto name
Definition: PRot.H:34
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator()(amrex::ParticleReal &AMREX_RESTRICT x, amrex::ParticleReal &AMREX_RESTRICT y, amrex::ParticleReal &AMREX_RESTRICT t, amrex::ParticleReal &AMREX_RESTRICT px, amrex::ParticleReal &AMREX_RESTRICT py, amrex::ParticleReal &AMREX_RESTRICT pt, [[maybe_unused]] uint64_t &AMREX_RESTRICT idcpu, RefPart const &refpart) const
Definition: PRot.H:71
amrex::ParticleReal m_phi_out
normalized (max) RF voltage drop.
Definition: PRot.H:127
amrex::ParticleReal m_phi_in
Definition: PRot.H:126
Definition: ReferenceParticle.H:30
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal beta() const
Definition: ReferenceParticle.H:64
Definition: beamoptic.H:149
Definition: nofinalize.H:22