10#ifndef IMPACTX_THINDIPOLE_H
11#define IMPACTX_THINDIPOLE_H
41 static constexpr auto type =
"ThinDipole";
61 amrex::ParticleReal theta,
62 amrex::ParticleReal rc,
63 amrex::ParticleReal
dx = 0,
64 amrex::ParticleReal
dy = 0,
65 amrex::ParticleReal rotation_degree = 0,
66 std::optional<std::string>
name = std::nullopt
76 using BeamOptic::operator();
87 using namespace amrex::literals;
89 Alignment::compute_constants(refpart);
113 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
126 using namespace amrex::literals;
134 T_Real
const xout = x;
135 T_Real
const yout = y;
136 T_Real
const tout =
t;
144 T_Real
const f = -1.0_prt + sqrt(1.0_prt - 2.0_prt * pt /
m_beta + powi<2>(pt));
145 T_Real
const fprime = (1.0_prt -
m_beta*pt) / (
m_beta * (1.0_prt + f));
167 using Thin::operator();
177 amrex::ParticleReal
const px = refpart.px;
178 amrex::ParticleReal
const pz = refpart.pz;
184 refpart.px = px*cos_theta - pz*sin_theta;
185 refpart.pz = pz*cos_theta + px*sin_theta;
189 using LinearTransport::operator();
200 throw std::runtime_error(std::string(
type) +
": Envelope tracking is not yet implemented!");
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
T_ParticleType ParticleType
static constexpr amrex::Real pi
__host__ __device__ std::pair< double, double > sincos(double x)
constexpr T powi(T x) 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:31
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal beta() const
Definition ReferenceParticle.H:94
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition ThinDipole.H:198
amrex::ParticleReal m_kx
effective (equivalent) arc length
Definition ThinDipole.H:212
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:115
static constexpr auto type
Definition ThinDipole.H:41
amrex::ParticleReal m_ds
beta of the reference particle
Definition ThinDipole.H:211
amrex::ParticleReal m_theta
Definition ThinDipole.H:204
amrex::ParticleReal m_rc
dipole bending angle (rad)
Definition ThinDipole.H:205
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:85
amrex::ParticleReal m_beta
curvature radius (m)
Definition ThinDipole.H:210
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:219
Definition lineartransport.H:29
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