10 #ifndef IMPACTX_SHORTRF_H 11 #define IMPACTX_SHORTRF_H 29 static constexpr
auto name =
"ShortRF";
37 ShortRF( amrex::ParticleReal
const V, amrex::ParticleReal
const k )
43 using BeamOptic::operator();
56 PType& AMREX_RESTRICT p,
57 amrex::ParticleReal & AMREX_RESTRICT px,
58 amrex::ParticleReal & AMREX_RESTRICT py,
59 amrex::ParticleReal & AMREX_RESTRICT pt,
60 RefPart const & refpart)
const {
62 using namespace amrex::literals;
65 amrex::ParticleReal
const x = p.pos(0);
66 amrex::ParticleReal
const y = p.pos(1);
67 amrex::ParticleReal
const t = p.pos(2);
70 amrex::ParticleReal
const pt_ref = refpart.
pt;
71 amrex::ParticleReal
const betgam2 =
pow(pt_ref, 2) - 1.0_prt;
74 amrex::ParticleReal pxout = px;
75 amrex::ParticleReal pyout = py;
76 amrex::ParticleReal ptout = pt;
80 pxout = px +
m_k*
m_V/(2.0_prt*betgam2)*x;
83 pyout = py +
m_k*
m_V/(2.0_prt*betgam2)*y;
96 using Thin::operator();
99 amrex::ParticleReal
m_V;
105 #endif // IMPACTX_SHORTRF_H 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: ShortRF.H:55
Definition: ImpactX.cpp:31
Definition: beamoptic.H:131
ShortRF(amrex::ParticleReal const V, amrex::ParticleReal const k)
Definition: ShortRF.H:37
amrex::ParticleReal pt
energy deviation, normalized by rest energy
Definition: ReferenceParticle.H:39
amrex::ParticleReal m_k
normalized (max) RF voltage drop.
Definition: ShortRF.H:100
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
static constexpr auto name
Definition: ShortRF.H:29
Particle< NStructReal, NStructInt > ParticleType
Definition: ReferenceParticle.H:29
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > pow(const GpuComplex< T > &a_z, const T &a_y) noexcept
amrex::ParticleReal m_V
Definition: ShortRF.H:99