44#ifdef AMREX_SINGLE_PRECISION_PARTICLES
48 static constexpr auto type =
"Quad";
75 std::optional<std::string>
name = std::nullopt
89 using BeamOptic::operator();
103 Alignment::compute_constants(refpart);
138 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
162 T_Real
const ptout = pt;
175 }
else if (
m_k < 0.0_prt)
239 refpart.x = x + step*px;
240 refpart.y = y + step*py;
241 refpart.z = z + step*pz;
242 refpart.t =
t - step*pt;
245 refpart.s =
s + slice_ds;
273 R(1,1) = std::cos(omega*slice_ds);
274 R(1,2) = std::sin(omega*slice_ds)/omega;
275 R(2,1) = -omega*std::sin(omega*slice_ds);
276 R(2,2) = std::cos(omega*slice_ds);
277 R(3,3) = std::cosh(omega*slice_ds);
278 R(3,4) = std::sinh(omega*slice_ds)/omega;
279 R(4,3) = omega*std::sinh(omega*slice_ds);
280 R(4,4) = std::cosh(omega*slice_ds);
281 R(5,6) = slice_ds/betgam2;
282 }
else if (
m_k < 0.0) {
283 R(1,1) = std::cosh(omega*slice_ds);
284 R(1,2) = std::sinh(omega*slice_ds)/omega;
285 R(2,1) = omega*std::sinh(omega*slice_ds);
286 R(2,2) = std::cosh(omega*slice_ds);
287 R(3,3) = std::cos(omega*slice_ds);
288 R(3,4) = std::sin(omega*slice_ds)/omega;
289 R(4,3) = -omega*std::sin(omega*slice_ds);
290 R(4,4) = std::cos(omega*slice_ds);
291 R(5,6) = slice_ds/betgam2;
295 R(5,6) = slice_ds / betgam2;
315 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
334 T_Real lambdax = 0_prt;
335 T_Real lambday = 0_prt;
336 T_Real lambdaz = 0_prt;
345 }
else if (
m_k < 0.0_prt)
360 (*this)(x, y,
t, px, py, pt, idcpu, refpart);
365 using LinearTransport::operator();
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
#define IMPACTX_PUSH_EXTERN_TEMPLATE(ElementType)
Definition PushAll.H:78
T_ParticleType ParticleType
amrex_particle_real ParticleReal
constexpr T powi(T x) noexcept
@ s
fixed s as the independent variable
Definition ImpactXParticleContainer.H:37
@ 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:33
amrex::ParticleReal pt
energy, normalized by rest energy
Definition ReferenceParticle.H:42
amrex::ParticleReal gyromagnetic_anomaly
anomalous magnetic moment [unitless]
Definition ReferenceParticle.H:45
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal gamma() const
Definition ReferenceParticle.H:140
amrex::ParticleReal m_cosh_omega_ds
std::sinh(omega*slice_ds)
Definition Quad.H:379
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void spin_and_phasespace_push(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_Real &AMREX_RESTRICT sx, T_Real &AMREX_RESTRICT sy, T_Real &AMREX_RESTRICT sz, T_IdCpu &AMREX_RESTRICT idcpu, RefPart const &AMREX_RESTRICT refpart) const
Definition Quad.H:317
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 Quad.H:140
amrex::ParticleReal m_k
Definition Quad.H:367
static constexpr auto type
Definition Quad.H:48
amrex::ParticleReal m_slice_ds
quadrupole strength in 1/m
Definition Quad.H:372
amrex::ParticleReal m_cos_omega_ds
std::sin(omega*slice_ds)
Definition Quad.H:377
amrex::ParticleReal m_gyro_const
std::cosh(omega*slice_ds)
Definition Quad.H:380
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition Quad.H:254
void compute_constants(RefPart const &refpart)
Definition Quad.H:98
amrex::ParticleReal m_slice_bg
beta*gamma^2
Definition Quad.H:374
ImpactXParticleContainer::ParticleType PType
Definition Quad.H:49
amrex::ParticleReal m_sin_omega_ds
std::sqrt(std::abs(m_k)) compute phase advance per unit length in s (in rad/m)
Definition Quad.H:376
void reverse()
Definition Quad.H:86
Quad(amrex::ParticleReal ds, amrex::ParticleReal k, amrex::ParticleReal dx=0, amrex::ParticleReal dy=0, amrex::ParticleReal rotation_degree=0, amrex::ParticleReal aperture_x=0, amrex::ParticleReal aperture_y=0, int nslice=1, std::optional< std::string > name=std::nullopt)
Definition Quad.H:66
amrex::ParticleReal m_sinh_omega_ds
std::cos(omega*slice_ds)
Definition Quad.H:378
amrex::ParticleReal m_betgam2
m_ds / nslice();
Definition Quad.H:373
amrex::ParticleReal m_omega
m_slice_ds / m_betgam2
Definition Quad.H:375
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:436
Definition lineartransport.H:50
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
Definition pipeaperture.H:26
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void apply_aperture(T_Real &AMREX_RESTRICT x, T_Real &AMREX_RESTRICT y, T_IdCpu &AMREX_RESTRICT idcpu) const
Definition pipeaperture.H:59
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal aperture_x() const
Definition pipeaperture.H:90
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal aperture_y() const
Definition pipeaperture.H:101
PipeAperture(amrex::ParticleReal aperture_x, amrex::ParticleReal aperture_y)
Definition pipeaperture.H:32
Definition spintransport.H:36
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void rotate_spin(T_Real const &AMREX_RESTRICT lambdax, T_Real const &AMREX_RESTRICT lambday, T_Real const &AMREX_RESTRICT lambdaz, T_Real &AMREX_RESTRICT sx, T_Real &AMREX_RESTRICT sy, T_Real &AMREX_RESTRICT sz) const
Definition spintransport.H:48
Thick(amrex::ParticleReal ds, int nslice)
Definition thick.H:30
amrex::ParticleReal m_ds
Definition thick.H:68
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal ds() const
Definition thick.H:53
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int nslice() const
Definition thick.H:43