10#ifndef IMPACTX_CONSTF_H
11#define IMPACTX_CONSTF_H
45 static constexpr auto type =
"ConstF";
73 std::optional<std::string>
name = std::nullopt
87 using BeamOptic::operator();
101 Alignment::compute_constants(refpart);
119 else if (
m_kx < 0_prt)
121 auto const sinh_kxds = std::sinh(-
m_kx*slice_ds);
122 auto const cosh_kxds = std::cosh(-
m_kx*slice_ds);
141 else if (
m_ky < 0_prt)
143 auto const sinh_kyds = std::sinh(-
m_ky*slice_ds);
144 auto const cosh_kyds = std::cosh(-
m_ky*slice_ds);
158 throw std::runtime_error(std::string(
type) +
": must have kt >= 0!");
183 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
262 refpart.x = x + step*px;
263 refpart.y = y + step*py;
264 refpart.z = z + step*pz;
265 refpart.t =
t - step*pt;
268 refpart.s =
s + slice_ds;
288 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
307 (*this)(x, y,
t, px, py, pt, idcpu, refpart);
312 using LinearTransport::operator();
337 const_x = -
m_kx * sin_kxds;
338 sincx = sin_kxds /
m_kx;
340 else if (
m_kx < 0_prt) {
341 sin_kxds = std::sinh(-
m_kx*slice_ds);
342 cos_kxds = std::cosh(-
m_kx*slice_ds);
343 const_x = -
m_kx * sin_kxds;
344 sincx = -sin_kxds /
m_kx;
355 const_y = -
m_ky * sin_kyds;
356 sincy = sin_kyds /
m_ky;
358 else if (
m_ky < 0_prt) {
359 sin_kyds = std::sinh(-
m_ky*slice_ds);
360 cos_kyds = std::cosh(-
m_ky*slice_ds);
361 const_y = -
m_ky * sin_kyds;
362 sincy = -sin_kyds /
m_ky;
371 throw std::runtime_error(std::string(
type) +
": must have kt >= 0!");
#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
@ 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 m_const_pt
Definition ConstF.H:408
amrex::ParticleReal m_cos_kxds
Definition ConstF.H:409
amrex::ParticleReal m_kx
Definition ConstF.H:400
void compute_constants(RefPart const &refpart)
Definition ConstF.H:96
static constexpr auto type
Definition ConstF.H:45
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 &AMREX_RESTRICT pt, T_Real &AMREX_RESTRICT sx, T_Real &AMREX_RESTRICT sy, T_Real &AMREX_RESTRICT sz, T_IdCpu &AMREX_RESTRICT idcpu, RefPart const &AMREX_RESTRICT refpart) const
Definition ConstF.H:290
amrex::ParticleReal m_const_t
Definition ConstF.H:408
amrex::ParticleReal m_cos_kyds
Definition ConstF.H:409
amrex::ParticleReal m_kt
focusing y strength in 1/m
Definition ConstF.H:402
ConstF(amrex::ParticleReal ds, amrex::ParticleReal kx, amrex::ParticleReal ky, amrex::ParticleReal kt, amrex::ParticleReal dx=0, amrex::ParticleReal dy=0, amrex::ParticleReal rotation_degree=0, amrex::ParticleReal aperture_x=0, amrex::ParticleReal aperture_y=0, int nslice=1, std::optional< std::string > name=std::nullopt)
Definition ConstF.H:62
amrex::ParticleReal m_sincx
focusing t strength in 1/m
Definition ConstF.H:407
amrex::ParticleReal m_sincy
Definition ConstF.H:407
ImpactXParticleContainer::ParticleType PType
Definition ConstF.H:46
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 ConstF.H:185
void reverse()
Definition ConstF.H:84
amrex::ParticleReal m_const_x
Definition ConstF.H:408
amrex::ParticleReal m_const_y
Definition ConstF.H:408
amrex::ParticleReal m_ky
focusing x strength in 1/m
Definition ConstF.H:401
amrex::ParticleReal m_cos_ktds
Definition ConstF.H:409
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition ConstF.H:320
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
Definition pipeaperture.H:26
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void apply_aperture(T_Real &AMREX_RESTRICT x, T_Real &AMREX_RESTRICT y, T_IdCpu &AMREX_RESTRICT idcpu) const
Definition pipeaperture.H:59
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal aperture_x() const
Definition pipeaperture.H:90
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal aperture_y() const
Definition pipeaperture.H:101
PipeAperture(amrex::ParticleReal aperture_x, amrex::ParticleReal aperture_y)
Definition pipeaperture.H:32
Definition spintransport.H:36
Thick(amrex::ParticleReal ds, int nslice)
Definition thick.H:30
amrex::ParticleReal m_ds
Definition thick.H:68
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal ds() const
Definition thick.H:53
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int nslice() const
Definition thick.H:43