10 #ifndef IMPACTX_SHORTRF_H 11 #define IMPACTX_SHORTRF_H 25 static constexpr
auto name =
"ShortRF";
33 ShortRF( amrex::ParticleReal
const V, amrex::ParticleReal
const k )
49 PType& AMREX_RESTRICT p,
50 amrex::ParticleReal & AMREX_RESTRICT px,
51 amrex::ParticleReal & AMREX_RESTRICT py,
52 amrex::ParticleReal & AMREX_RESTRICT pt,
53 RefPart const & refpart)
const {
55 using namespace amrex::literals;
58 amrex::ParticleReal
const x = p.pos(0);
59 amrex::ParticleReal
const y = p.pos(1);
60 amrex::ParticleReal
const t = p.pos(2);
63 amrex::ParticleReal
const pt_ref = refpart.
pt;
64 amrex::ParticleReal
const betgam2 =
pow(pt_ref, 2) - 1.0_prt;
67 amrex::ParticleReal pxout = px;
68 amrex::ParticleReal pyout = py;
69 amrex::ParticleReal ptout = pt;
73 pxout = px +
m_k*
m_V/(2.0_prt*betgam2)*x;
76 pyout = py +
m_k*
m_V/(2.0_prt*betgam2)*y;
114 amrex::ParticleReal
ds ()
const 116 using namespace amrex::literals;
127 #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:48
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int nslice() const
Definition: ShortRF.H:104
Definition: ImpactX.cpp:31
ShortRF(amrex::ParticleReal const V, amrex::ParticleReal const k)
Definition: ShortRF.H:33
amrex::ParticleReal pt
energy deviation, normalized by rest energy
Definition: ReferenceParticle.H:39
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal ds() const
Definition: ShortRF.H:114
amrex::ParticleReal m_k
normalized (max) RF voltage drop.
Definition: ShortRF.H:122
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
static constexpr auto name
Definition: ShortRF.H:25
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:121