43 static constexpr auto type =
"Quad";
49#ifndef AMREX_SINGLE_PRECISION_PARTICLES
91 using BeamOptic::operator();
105 Alignment::compute_constants(refpart);
138 m_R11 = cos_omega_ds;
139 m_R12 = sin_omega_ds / omega;
140 m_R21 = -omega * sin_omega_ds;
141 m_R22 = cos_omega_ds;
142 m_R33 = cosh_omega_ds;
143 m_R34 = sinh_omega_ds / omega;
144 m_R43 = omega * sinh_omega_ds;
145 m_R44 = cosh_omega_ds;
152 else if (
m_k < 0.0_prt)
155 m_R11 = cosh_omega_ds;
156 m_R12 = sinh_omega_ds / omega;
157 m_R21 = omega * sinh_omega_ds;
158 m_R22 = cosh_omega_ds;
159 m_R33 = cos_omega_ds;
160 m_R34 = sin_omega_ds / omega;
161 m_R43 = -omega * sin_omega_ds;
162 m_R44 = cos_omega_ds;
201 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
217 T_Real
const xin = x;
218 T_Real
const yin = y;
260 refpart.x = x + step*px;
261 refpart.y = y + step*py;
262 refpart.z = z + step*pz;
263 refpart.t =
t - step*pt;
266 refpart.s =
s + slice_ds;
294 R(1,1) = std::cos(omega*slice_ds);
295 R(1,2) = std::sin(omega*slice_ds)/omega;
296 R(2,1) = -omega*std::sin(omega*slice_ds);
297 R(2,2) = std::cos(omega*slice_ds);
298 R(3,3) = std::cosh(omega*slice_ds);
299 R(3,4) = std::sinh(omega*slice_ds)/omega;
300 R(4,3) = omega*std::sinh(omega*slice_ds);
301 R(4,4) = std::cosh(omega*slice_ds);
302 R(5,6) = slice_ds/betgam2;
303 }
else if (
m_k < 0.0) {
304 R(1,1) = std::cosh(omega*slice_ds);
305 R(1,2) = std::sinh(omega*slice_ds)/omega;
306 R(2,1) = omega*std::sinh(omega*slice_ds);
307 R(2,2) = std::cosh(omega*slice_ds);
308 R(3,3) = std::cos(omega*slice_ds);
309 R(3,4) = std::sin(omega*slice_ds)/omega;
310 R(4,3) = -omega*std::sin(omega*slice_ds);
311 R(4,4) = std::cos(omega*slice_ds);
312 R(5,6) = slice_ds/betgam2;
316 R(5,6) = slice_ds / betgam2;
337 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
360 T_Real
const lambdaz = 0_prt;
363 rotate_spin(lambdax, lambday, lambdaz, sx, sy, sz);
366 (*this)(x, y,
t, px, py, pt, idcpu, refpart);
370 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:139
amrex::ParticleReal m_k
Definition Quad.H:372
amrex::ParticleReal m_R43
Definition Quad.H:383
static constexpr auto type
Definition Quad.H:43
amrex::ParticleReal m_spin_y
lambdax += m_spin_py*py
Definition Quad.H:388
static constexpr bool simd_ps
Definition Quad.H:50
amrex::ParticleReal m_slice_ds
quadrupole strength in 1/m
Definition Quad.H:377
amrex::ParticleReal m_spin_x
lambday += m_spin_px*px
Definition Quad.H:386
amrex::ParticleReal m_R34
Definition Quad.H:383
amrex::ParticleReal m_gyro_const
R56 = m_slice_ds / m_betgam2.
Definition Quad.H:380
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition Quad.H:275
void compute_constants(RefPart const &refpart)
Definition Quad.H:100
amrex::ParticleReal m_slice_bg
beta*gamma^2
Definition Quad.H:379
ImpactXParticleContainer::ParticleType PType
Definition Quad.H:44
amrex::ParticleReal m_R21
Definition Quad.H:382
amrex::ParticleReal m_R33
x–px block
Definition Quad.H:383
amrex::ParticleReal m_spin_py
lambday += m_spin_x*x
Definition Quad.H:387
void reverse()
Definition Quad.H:88
amrex::ParticleReal m_R11
(1 + G*gamma) for spin calculation
Definition Quad.H:382
Quad(amrex::ParticleReal ds, amrex::ParticleReal k, amrex::ParticleReal dx=DEFAULT_dx, amrex::ParticleReal dy=DEFAULT_dy, amrex::ParticleReal rotation_degree=DEFAULT_rotation_degree, amrex::ParticleReal aperture_x=DEFAULT_aperture_x, amrex::ParticleReal aperture_y=DEFAULT_aperture_y, int nslice=DEFAULT_nslice, std::optional< std::string > name=DEFAULT_name)
Definition Quad.H:68
amrex::ParticleReal m_R44
Definition Quad.H:383
amrex::ParticleReal m_R12
Definition Quad.H:382
amrex::ParticleReal m_R22
Definition Quad.H:382
amrex::ParticleReal m_betgam2
m_ds / nslice();
Definition Quad.H:378
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 const &AMREX_RESTRICT pt, T_Real &AMREX_RESTRICT sx, T_Real &AMREX_RESTRICT sy, T_Real &AMREX_RESTRICT sz, T_IdCpu const &AMREX_RESTRICT idcpu, RefPart const &AMREX_RESTRICT refpart) const
Definition Quad.H:339
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 const &AMREX_RESTRICT pt, T_IdCpu const &AMREX_RESTRICT idcpu, RefPart const &AMREX_RESTRICT refpart) const
Definition Quad.H:203
amrex::ParticleReal m_spin_px
y–py block
Definition Quad.H:385
Definition alignment.H:29
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dy() const
Definition alignment.H:193
static constexpr amrex::ParticleReal DEFAULT_dy
Definition alignment.H:34
static constexpr amrex::ParticleReal DEFAULT_dx
Definition alignment.H:33
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dx() const
Definition alignment.H:183
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 rotate_aligned_map(Map6x6 const &R) const
Definition alignment.H:267
Alignment(amrex::ParticleReal dx, amrex::ParticleReal dy, amrex::ParticleReal rotation_degree)
Definition alignment.H:43
static constexpr amrex::ParticleReal DEFAULT_rotation_degree
Definition alignment.H:35
Definition beamoptic.H:567
Definition lineartransport.H:50
static constexpr std::nullopt_t DEFAULT_name
Definition named.H:30
AMREX_GPU_HOST Named(std::optional< std::string > name)
Definition named.H:59
AMREX_FORCE_INLINE std::string name() const
Definition named.H:124
Definition nofinalize.H:22
Definition pipeaperture.H:26
static constexpr amrex::ParticleReal DEFAULT_aperture_x
Definition pipeaperture.H:27
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal aperture_x() const
Definition pipeaperture.H:93
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal aperture_y() const
Definition pipeaperture.H:104
static constexpr amrex::ParticleReal DEFAULT_aperture_y
Definition pipeaperture.H:28
PipeAperture(amrex::ParticleReal aperture_x, amrex::ParticleReal aperture_y)
Definition pipeaperture.H:35
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
static constexpr int DEFAULT_nslice
Definition thick.H:25
Thick(amrex::ParticleReal ds, int nslice)
Definition thick.H:32
amrex::ParticleReal m_ds
Definition thick.H:70
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal ds() const
Definition thick.H:55
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int nslice() const
Definition thick.H:45