10#ifndef IMPACTX_BUNCHER_H
11#define IMPACTX_BUNCHER_H
43 static constexpr auto type =
"Buncher";
56 amrex::ParticleReal V,
57 amrex::ParticleReal k,
58 amrex::ParticleReal
dx = 0,
59 amrex::ParticleReal
dy = 0,
60 amrex::ParticleReal rotation_degree = 0,
61 std::optional<std::string>
name = std::nullopt
70 using BeamOptic::operator();
81 using namespace amrex::literals;
84 Alignment::compute_constants(refpart);
87 amrex::ParticleReal
const betgam2 = powi<2>(refpart.
pt) - 1.0_prt;
107 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
120 using namespace amrex::literals;
145 using Thin::operator();
148 using LinearTransport::operator();
159 using namespace amrex::literals;
163 amrex::ParticleReal
const betgam2 = powi<2>(refpart.pt) - 1.0_prt;
165 amrex::ParticleReal
const neg_kV = -
m_k *
m_V;
166 amrex::ParticleReal
const kV_r2bg2 = -neg_kV / (2.0_prt * betgam2);
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
T_ParticleType ParticleType
constexpr T powi(T x) noexcept
@ t
fixed t as the independent variable
Definition ImpactXParticleContainer.H:38
amrex::SmallMatrix< amrex::ParticleReal, 6, 6, amrex::Order::F, 1 > Map6x6
Definition CovarianceMatrix.H:20
static constexpr __host__ __device__ SmallMatrix< T, NRows, NCols, ORDER, StartIndex > Identity() noexcept
Definition ReferenceParticle.H:31
amrex::ParticleReal pt
energy, normalized by rest energy
Definition ReferenceParticle.H:40
ImpactXParticleContainer::ParticleType PType
Definition Buncher.H:44
amrex::ParticleReal m_kV_r2bg2
-m_k*m_V
Definition Buncher.H:186
amrex::ParticleReal m_k
normalized (max) RF voltage drop.
Definition Buncher.H:180
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator()(T_Real &AMREX_RESTRICT x, T_Real &AMREX_RESTRICT y, T_Real &AMREX_RESTRICT t, T_Real &AMREX_RESTRICT px, T_Real &AMREX_RESTRICT py, T_Real &AMREX_RESTRICT pt, T_IdCpu &AMREX_RESTRICT idcpu, RefPart const &AMREX_RESTRICT refpart) const
Definition Buncher.H:109
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition Buncher.H:157
static constexpr auto type
Definition Buncher.H:43
void compute_constants(RefPart const &refpart)
Definition Buncher.H:79
amrex::ParticleReal m_V
Definition Buncher.H:179
amrex::ParticleReal m_neg_kV
RF wavenumber in 1/m.
Definition Buncher.H:185
Buncher(amrex::ParticleReal V, amrex::ParticleReal k, amrex::ParticleReal dx=0, amrex::ParticleReal dy=0, amrex::ParticleReal rotation_degree=0, std::optional< std::string > name=std::nullopt)
Definition Buncher.H:55
Definition alignment.H:27
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void shift_out(T_Real &AMREX_RESTRICT x, T_Real &AMREX_RESTRICT y, T_Real &AMREX_RESTRICT px, T_Real &AMREX_RESTRICT py) const
Definition alignment.H:109
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dy() const
Definition alignment.H:146
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dx() const
Definition alignment.H:136
Alignment(amrex::ParticleReal dx, amrex::ParticleReal dy, amrex::ParticleReal rotation_degree)
Definition alignment.H:36
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void shift_in(T_Real &AMREX_RESTRICT x, T_Real &AMREX_RESTRICT y, T_Real &AMREX_RESTRICT px, T_Real &AMREX_RESTRICT py) const
Definition alignment.H:78
Definition beamoptic.H:219
Definition lineartransport.H:29
AMREX_GPU_HOST Named(std::optional< std::string > name)
Definition named.H:57
AMREX_FORCE_INLINE std::string name() const
Definition named.H:122
Definition nofinalize.H:22