10#ifndef IMPACTX_TAPEREDPL_H
11#define IMPACTX_TAPEREDPL_H
47 static constexpr auto type =
"TaperedPL";
72 std::optional<std::string>
name = std::nullopt
94 Alignment::compute_constants(refpart);
106 using BeamOptic::operator();
120 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
147 pxout = px -
m_g * ( x +
m_taper*0.5_prt * (powi<2>(x) + powi<2>(y)) );
165 using Thin::operator();
182 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
205 T_Real
const px_in = px;
206 T_Real
const py_in = py;
209 (*this)(x, y,
t, px, py, pt, idcpu, refpart);
212 T_Real
const px_mid = 0.5_prt * (px_in + px);
213 T_Real
const py_mid = 0.5_prt * (py_in + py);
216 T_Real lambdax = 0_prt;
217 T_Real lambday = 0_prt;
218 T_Real lambdaz = 0_prt;
223 T_Real
const By =
m_g * ( x +
m_taper*0.5_prt * (powi<2>(x) + powi<2>(y)) ) * gamma_ref *
m_beta;
224 T_Real
const Bz = 0_prt;
227 T_Real
const Ex = 0.0_prt;
228 T_Real
const Ey = 0.0_prt;
229 T_Real
const Ez = 0.0_prt;
233 T_Real
const Pnorm =
sqrt(1_prt - 2_prt * pt *
m_ibeta + pt*pt);
234 T_Real
const iPnorm = 1_prt/Pnorm;
235 T_Real
const Ps =
sqrt(Pnorm*Pnorm - px_mid*px_mid - py_mid*py_mid);
236 T_Real
const gamma = gamma_ref * (1_prt - pt*
m_beta);
237 T_Real
const ux = px_mid * iPnorm;
238 T_Real
const uy = py_mid * iPnorm;
239 T_Real
const uz = Ps * iPnorm;
246 tbmt_precession_vector(x, ux, uy, uz, gamma, h, gyro_anomaly, Bx, By, Bz, Ex, Ey, Ez, lambdax, lambday, lambdaz);
249 rotate_spin(lambdax, lambday, lambdaz, sx, sy, sz);
255 using LinearTransport::operator();
298 ?
m_k / refpart.rigidity_Tm()
#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
__host__ __device__ GpuComplex< T > sqrt(const GpuComplex< T > &a_z) 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:33
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal rigidity_Tm() const
Definition ReferenceParticle.H:260
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal beta() const
Definition ReferenceParticle.H:151
Definition TaperedPL.H:46
amrex::ParticleReal m_k
Definition TaperedPL.H:311
amrex::ParticleReal m_ibeta
relativistic beta
Definition TaperedPL.H:318
static constexpr auto type
Definition TaperedPL.H:47
ImpactXParticleContainer::ParticleType PType
Definition TaperedPL.H:48
void compute_constants(RefPart const &refpart)
Definition TaperedPL.H:90
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void spin_and_phasespace_push(T_Real const &AMREX_RESTRICT x, T_Real const &AMREX_RESTRICT y, T_Real const &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 TaperedPL.H:184
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition TaperedPL.H:292
TaperedPL(amrex::ParticleReal k, amrex::ParticleReal taper, int unit, amrex::ParticleReal dx=0, amrex::ParticleReal dy=0, amrex::ParticleReal rotation_degree=0, std::optional< std::string > name=std::nullopt)
Definition TaperedPL.H:65
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator()(T_Real const &AMREX_RESTRICT x, T_Real const &AMREX_RESTRICT y, T_Real const &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 TaperedPL.H:122
amrex::ParticleReal m_g
inverse of beta
Definition TaperedPL.H:319
void reverse()
Definition TaperedPL.H:81
amrex::ParticleReal m_beta
units for linear focusing strength (field gradient)
Definition TaperedPL.H:317
amrex::ParticleReal m_taper
linear focusing strength (field gradient)
Definition TaperedPL.H:312
int m_unit
horizontal taper parameter
Definition TaperedPL.H:313
Definition alignment.H:29
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dy() const
Definition alignment.H:189
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dx() const
Definition alignment.H:179
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 rotate_aligned_map(Map6x6 const &R) const
Definition alignment.H:263
Alignment(amrex::ParticleReal dx, amrex::ParticleReal dy, amrex::ParticleReal rotation_degree)
Definition alignment.H:39
Definition beamoptic.H:529
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 spintransport.H:36
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void tbmt_precession_vector(T_Real const &AMREX_RESTRICT x, T_Real const &AMREX_RESTRICT ux, T_Real const &AMREX_RESTRICT uy, T_Real const &AMREX_RESTRICT uz, T_Real const &AMREX_RESTRICT gamma, amrex::ParticleReal const &AMREX_RESTRICT h, amrex::ParticleReal const &AMREX_RESTRICT gyro_anomaly, T_Real const &AMREX_RESTRICT Bx, T_Real const &AMREX_RESTRICT By, T_Real const &AMREX_RESTRICT Bz, T_Real const &AMREX_RESTRICT Ex, T_Real const &AMREX_RESTRICT Ey, T_Real const &AMREX_RESTRICT Ez, T_Real &AMREX_RESTRICT Omegax, T_Real &AMREX_RESTRICT Omegay, T_Real &AMREX_RESTRICT Omegaz) const
Definition spintransport.H:121
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