10#ifndef IMPACTX_THINDIPOLE_H
11#define IMPACTX_THINDIPOLE_H
41 static constexpr auto type =
"ThinDipole";
66 std::optional<std::string>
name = std::nullopt
79 using BeamOptic::operator();
92 Alignment::compute_constants(refpart);
116 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
137 T_Real
const xout = x;
138 T_Real
const yout = y;
139 T_Real
const tout =
t;
147 T_Real
const f = -1.0_prt +
sqrt(1.0_prt - 2.0_prt * pt /
m_beta + powi<2>(pt));
148 T_Real
const fprime = (1.0_prt -
m_beta*pt) / (
m_beta * (1.0_prt + f));
170 using Thin::operator();
187 refpart.px = px*cos_theta - pz*sin_theta;
188 refpart.pz = pz*cos_theta + px*sin_theta;
192 using LinearTransport::operator();
203 throw std::runtime_error(std::string(
type) +
": Envelope tracking is not yet implemented!");
#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
__host__ __device__ std::pair< double, double > sincos(double x)
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 beta() const
Definition ReferenceParticle.H:152
Definition ThinDipole.H:40
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition ThinDipole.H:201
amrex::ParticleReal m_kx
effective (equivalent) arc length
Definition ThinDipole.H:215
ThinDipole(amrex::ParticleReal theta, amrex::ParticleReal rc, amrex::ParticleReal dx=0, amrex::ParticleReal dy=0, amrex::ParticleReal rotation_degree=0, std::optional< std::string > name=std::nullopt)
Definition ThinDipole.H:60
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 ThinDipole.H:118
static constexpr auto type
Definition ThinDipole.H:41
amrex::ParticleReal m_ds
beta of the reference particle
Definition ThinDipole.H:214
amrex::ParticleReal m_theta
Definition ThinDipole.H:207
amrex::ParticleReal m_rc
dipole bending angle (rad)
Definition ThinDipole.H:208
ImpactXParticleContainer::ParticleType PType
Definition ThinDipole.H:42
static constexpr amrex::ParticleReal degree2rad
Definition ThinDipole.H:44
void compute_constants(RefPart const &refpart)
Definition ThinDipole.H:88
amrex::ParticleReal m_beta
curvature radius (m)
Definition ThinDipole.H:213
void reverse()
Definition ThinDipole.H:76
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