10#ifndef IMPACTX_CONSTF_H
11#define IMPACTX_CONSTF_H
43 static constexpr auto type =
"ConstF";
71 std::optional<std::string>
name = std::nullopt
85 using BeamOptic::operator();
99 Alignment::compute_constants(refpart);
117 else if (
m_kx < 0_prt)
119 auto const sinh_kxds = std::sinh(-
m_kx*slice_ds);
120 auto const cosh_kxds = std::cosh(-
m_kx*slice_ds);
139 else if (
m_ky < 0_prt)
141 auto const sinh_kyds = std::sinh(-
m_ky*slice_ds);
142 auto const cosh_kyds = std::cosh(-
m_ky*slice_ds);
156 throw std::runtime_error(std::string(
type) +
": must have kt >= 0!");
181 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
260 refpart.x = x + step*px;
261 refpart.y = y + step*py;
262 refpart.z = z + step*pz;
263 refpart.t =
t - step*pt;
266 refpart.s =
s + slice_ds;
271 using LinearTransport::operator();
296 const_x = -
m_kx * sin_kxds;
297 sincx = sin_kxds /
m_kx;
299 else if (
m_kx < 0_prt) {
300 sin_kxds = std::sinh(-
m_kx*slice_ds);
301 cos_kxds = std::cosh(-
m_kx*slice_ds);
302 const_x = -
m_kx * sin_kxds;
303 sincx = -sin_kxds /
m_kx;
314 const_y = -
m_ky * sin_kyds;
315 sincy = sin_kyds /
m_ky;
317 else if (
m_ky < 0_prt) {
318 sin_kyds = std::sinh(-
m_ky*slice_ds);
319 cos_kyds = std::cosh(-
m_ky*slice_ds);
320 const_y = -
m_ky * sin_kyds;
321 sincy = -sin_kyds /
m_ky;
330 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:367
amrex::ParticleReal m_cos_kxds
Definition ConstF.H:368
amrex::ParticleReal m_kx
Definition ConstF.H:359
void compute_constants(RefPart const &refpart)
Definition ConstF.H:94
static constexpr auto type
Definition ConstF.H:43
amrex::ParticleReal m_const_t
Definition ConstF.H:367
amrex::ParticleReal m_cos_kyds
Definition ConstF.H:368
amrex::ParticleReal m_kt
focusing y strength in 1/m
Definition ConstF.H:361
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:60
amrex::ParticleReal m_sincx
focusing t strength in 1/m
Definition ConstF.H:366
amrex::ParticleReal m_sincy
Definition ConstF.H:366
ImpactXParticleContainer::ParticleType PType
Definition ConstF.H:44
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:183
void reverse()
Definition ConstF.H:82
amrex::ParticleReal m_const_x
Definition ConstF.H:367
amrex::ParticleReal m_const_y
Definition ConstF.H:367
amrex::ParticleReal m_ky
focusing x strength in 1/m
Definition ConstF.H:360
amrex::ParticleReal m_cos_ktds
Definition ConstF.H:368
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition ConstF.H:279
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
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