10#ifndef IMPACTX_CONSTF_H
11#define IMPACTX_CONSTF_H
44 static constexpr auto type =
"ConstF";
86 using BeamOptic::operator();
100 Alignment::compute_constants(refpart);
118 else if (
m_kx < 0_prt)
120 auto const sinh_kxds = std::sinh(-
m_kx*slice_ds);
121 auto const cosh_kxds = std::cosh(-
m_kx*slice_ds);
140 else if (
m_ky < 0_prt)
142 auto const sinh_kyds = std::sinh(-
m_ky*slice_ds);
143 auto const cosh_kyds = std::cosh(-
m_ky*slice_ds);
157 throw std::runtime_error(std::string(
type) +
": must have kt >= 0!");
182 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
252 refpart.x = x + step*px;
253 refpart.y = y + step*py;
254 refpart.z = z + step*pz;
255 refpart.t =
t - step*pt;
258 refpart.s =
s + slice_ds;
278 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
297 (*this)(x, y,
t, px, py, pt, idcpu, refpart);
301 using LinearTransport::operator();
326 const_x = -
m_kx * sin_kxds;
327 sincx = sin_kxds /
m_kx;
329 else if (
m_kx < 0_prt) {
330 sin_kxds = std::sinh(-
m_kx*slice_ds);
331 cos_kxds = std::cosh(-
m_kx*slice_ds);
332 const_x = -
m_kx * sin_kxds;
333 sincx = -sin_kxds /
m_kx;
344 const_y = -
m_ky * sin_kyds;
345 sincy = sin_kyds /
m_ky;
347 else if (
m_ky < 0_prt) {
348 sin_kyds = std::sinh(-
m_ky*slice_ds);
349 cos_kyds = std::cosh(-
m_ky*slice_ds);
350 const_y = -
m_ky * sin_kyds;
351 sincy = -sin_kyds /
m_ky;
360 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
constexpr T powi(T x) noexcept
__host__ __device__ std::pair< double, double > sincos(double x)
@ 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_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 const &AMREX_RESTRICT idcpu, RefPart const &AMREX_RESTRICT refpart) const
Definition ConstF.H:184
amrex::ParticleReal m_const_pt
Definition ConstF.H:398
amrex::ParticleReal m_cos_kxds
Definition ConstF.H:399
amrex::ParticleReal m_kx
Definition ConstF.H:390
void compute_constants(RefPart const &refpart)
Definition ConstF.H:95
static constexpr auto type
Definition ConstF.H:44
amrex::ParticleReal m_const_t
Definition ConstF.H:398
amrex::ParticleReal m_cos_kyds
Definition ConstF.H:399
amrex::ParticleReal m_kt
focusing y strength in 1/m
Definition ConstF.H:392
amrex::ParticleReal m_sincx
focusing t strength in 1/m
Definition ConstF.H:397
amrex::ParticleReal m_sincy
Definition ConstF.H:397
ImpactXParticleContainer::ParticleType PType
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 const &AMREX_RESTRICT sx, T_Real const &AMREX_RESTRICT sy, T_Real const &AMREX_RESTRICT sz, T_IdCpu const &AMREX_RESTRICT idcpu, RefPart const &AMREX_RESTRICT refpart) const
Definition ConstF.H:280
void reverse()
Definition ConstF.H:83
amrex::ParticleReal m_const_x
Definition ConstF.H:398
amrex::ParticleReal m_const_y
Definition ConstF.H:398
ConstF(amrex::ParticleReal ds, amrex::ParticleReal kx, amrex::ParticleReal ky, amrex::ParticleReal kt, amrex::ParticleReal dx=DEFAULT_dx, amrex::ParticleReal dy=DEFAULT_dy, amrex::ParticleReal rotation_degree=DEFAULT_rotation_degree, amrex::ParticleReal aperture_x=DEFAULT_aperture_x, amrex::ParticleReal aperture_y=DEFAULT_aperture_y, int nslice=DEFAULT_nslice, std::optional< std::string > name=DEFAULT_name)
Definition ConstF.H:61
amrex::ParticleReal m_ky
focusing x strength in 1/m
Definition ConstF.H:391
amrex::ParticleReal m_cos_ktds
Definition ConstF.H:399
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition ConstF.H:309
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 pipeaperture.H:26
static constexpr amrex::ParticleReal DEFAULT_aperture_x
Definition pipeaperture.H:27
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal aperture_x() const
Definition pipeaperture.H:93
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal aperture_y() const
Definition pipeaperture.H:104
static constexpr amrex::ParticleReal DEFAULT_aperture_y
Definition pipeaperture.H:28
PipeAperture(amrex::ParticleReal aperture_x, amrex::ParticleReal aperture_y)
Definition pipeaperture.H:35
Definition spintransport.H:36
static constexpr int DEFAULT_nslice
Definition thick.H:25
Thick(amrex::ParticleReal ds, int nslice)
Definition thick.H:32
amrex::ParticleReal m_ds
Definition thick.H:70
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal ds() const
Definition thick.H:55
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int nslice() const
Definition thick.H:45