10#ifndef IMPACTX_TAPEREDPL_H
11#define IMPACTX_TAPEREDPL_H
46 static constexpr auto type =
"TaperedPL";
95 Alignment::compute_constants(refpart);
107 using BeamOptic::operator();
121 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
148 pxout = px -
m_g * ( x +
m_taper*0.5_prt * (powi<2>(x) + powi<2>(y)) );
166 using Thin::operator();
183 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
206 T_Real
const px_in = px;
207 T_Real
const py_in = py;
210 (*this)(x, y,
t, px, py, pt, idcpu, refpart);
213 T_Real
const px_mid = 0.5_prt * (px_in + px);
214 T_Real
const py_mid = 0.5_prt * (py_in + py);
217 T_Real lambdax = 0_prt;
218 T_Real lambday = 0_prt;
219 T_Real lambdaz = 0_prt;
224 T_Real
const By =
m_g * ( x +
m_taper*0.5_prt * (powi<2>(x) + powi<2>(y)) ) * gamma_ref *
m_beta;
225 T_Real
const Bz = 0_prt;
228 T_Real
const Ex = 0.0_prt;
229 T_Real
const Ey = 0.0_prt;
230 T_Real
const Ez = 0.0_prt;
234 T_Real
const Pnorm =
sqrt(1_prt - 2_prt * pt *
m_ibeta + pt*pt);
235 T_Real
const iPnorm = 1_prt/Pnorm;
236 T_Real
const Ps =
sqrt(Pnorm*Pnorm - px_mid*px_mid - py_mid*py_mid);
237 T_Real
const gamma = gamma_ref * (1_prt - pt*
m_beta);
238 T_Real
const ux = px_mid * iPnorm;
239 T_Real
const uy = py_mid * iPnorm;
240 T_Real
const uz = Ps * iPnorm;
247 tbmt_precession_vector(x, ux, uy, uz, gamma, h, gyro_anomaly, Bx, By, Bz, Ex, Ey, Ez, lambdax, lambday, lambdaz);
250 rotate_spin(lambdax, lambday, lambdaz, sx, sy, sz);
256 using LinearTransport::operator();
299 ?
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:45
amrex::ParticleReal m_k
Definition TaperedPL.H:312
amrex::ParticleReal m_ibeta
relativistic beta
Definition TaperedPL.H:319
static constexpr auto type
Definition TaperedPL.H:46
ImpactXParticleContainer::ParticleType PType
Definition TaperedPL.H:47
void compute_constants(RefPart const &refpart)
Definition TaperedPL.H:91
TaperedPL(amrex::ParticleReal k, amrex::ParticleReal taper, int unit=DEFAULT_unit, amrex::ParticleReal dx=DEFAULT_dx, amrex::ParticleReal dy=DEFAULT_dy, amrex::ParticleReal rotation_degree=DEFAULT_rotation_degree, std::optional< std::string > name=DEFAULT_name)
Definition TaperedPL.H:66
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:185
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition TaperedPL.H:293
static constexpr int DEFAULT_unit
Definition TaperedPL.H:49
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:123
amrex::ParticleReal m_g
inverse of beta
Definition TaperedPL.H:320
void reverse()
Definition TaperedPL.H:82
amrex::ParticleReal m_beta
units for linear focusing strength (field gradient)
Definition TaperedPL.H:318
amrex::ParticleReal m_taper
linear focusing strength (field gradient)
Definition TaperedPL.H:313
int m_unit
horizontal taper parameter
Definition TaperedPL.H:314
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 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