34 static constexpr
auto name =
"Sol";
48 amrex::ParticleReal
ds,
49 amrex::ParticleReal ks,
50 amrex::ParticleReal
dx = 0,
51 amrex::ParticleReal
dy = 0,
52 amrex::ParticleReal rotation_degree = 0,
62 using BeamOptic::operator();
74 PType & AMREX_RESTRICT p,
75 amrex::ParticleReal & AMREX_RESTRICT px,
76 amrex::ParticleReal & AMREX_RESTRICT py,
77 amrex::ParticleReal & AMREX_RESTRICT pt,
81 using namespace amrex::literals;
87 amrex::ParticleReal
const x = p.pos(
RealAoS::x);
88 amrex::ParticleReal
const y = p.pos(
RealAoS::y);
92 amrex::ParticleReal
const slice_ds =
m_ds /
nslice();
95 amrex::ParticleReal
const pt_ref = refpart.
pt;
96 amrex::ParticleReal
const betgam2 =
pow(pt_ref, 2) - 1.0_prt;
100 amrex::ParticleReal
const alpha =
m_ks/2.0_prt;
101 amrex::ParticleReal
const theta =
alpha*slice_ds;
104 amrex::ParticleReal xout = x;
105 amrex::ParticleReal yout = y;
106 amrex::ParticleReal tout =
t;
107 amrex::ParticleReal pxout = px;
108 amrex::ParticleReal pyout = py;
109 amrex::ParticleReal ptout = pt;
113 xout = cos_theta*x + sin_theta/
alpha*px;
114 pxout = -
alpha*sin_theta*x + cos_theta*px;
116 yout = cos_theta*y + sin_theta/
alpha*py;
117 pyout = -
alpha*sin_theta*y + cos_theta*py;
119 tout =
t + (slice_ds/betgam2)*pt;
128 p.pos(
RealAoS::x) = cos_theta*xout + sin_theta*yout;
129 pxout = cos_theta*px + sin_theta*py;
131 p.pos(
RealAoS::y) = -sin_theta*xout + cos_theta*yout;
132 pyout = -sin_theta*px + cos_theta*py;
153 using namespace amrex::literals;
156 amrex::ParticleReal
const x = refpart.x;
157 amrex::ParticleReal
const px = refpart.px;
158 amrex::ParticleReal
const y = refpart.y;
159 amrex::ParticleReal
const py = refpart.py;
160 amrex::ParticleReal
const z = refpart.z;
161 amrex::ParticleReal
const pz = refpart.pz;
162 amrex::ParticleReal
const t = refpart.t;
163 amrex::ParticleReal
const pt = refpart.pt;
164 amrex::ParticleReal
const s = refpart.s;
167 amrex::ParticleReal
const slice_ds =
m_ds /
nslice();
170 amrex::ParticleReal
const step = slice_ds /
sqrt(
pow(pt,2)-1.0_prt);
173 refpart.x = x + step*px;
174 refpart.y = y + step*py;
175 refpart.z = z + step*pz;
176 refpart.t =
t - step*pt;
179 refpart.s =
s + slice_ds;
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
T_ParticleType ParticleType
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE std::pair< double, double > sincos(double x)
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > pow(const GpuComplex< T > &a_z, const T &a_y) noexcept
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > sqrt(const GpuComplex< T > &a_z) noexcept
Definition: ImpactX.cpp:35
@ t
fixed t as the independent variable
@ x
position in x [m] (at fixed s OR fixed t)
Definition: ImpactXParticleContainer.H:49
@ y
position in y [m] (at fixed s OR fixed t)
Definition: ImpactXParticleContainer.H:50
@ t
c * time-of-flight [m] (at fixed s)
Definition: ImpactXParticleContainer.H:51
Definition: ReferenceParticle.H:30
amrex::ParticleReal pt
energy, normalized by rest energy
Definition: ReferenceParticle.H:39
static constexpr auto name
Definition: Sol.H:34
ImpactXParticleContainer::ParticleType PType
Definition: Sol.H:35
Sol(amrex::ParticleReal ds, amrex::ParticleReal ks, amrex::ParticleReal dx=0, amrex::ParticleReal dy=0, amrex::ParticleReal rotation_degree=0, int nslice=1)
Definition: Sol.H:47
amrex::ParticleReal m_ks
Definition: Sol.H:183
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator()(PType &AMREX_RESTRICT p, amrex::ParticleReal &AMREX_RESTRICT px, amrex::ParticleReal &AMREX_RESTRICT py, amrex::ParticleReal &AMREX_RESTRICT pt, RefPart const &refpart) const
Definition: Sol.H:73
Definition: alignment.H:27
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void shift_out(amrex::ParticleReal &AMREX_RESTRICT x, amrex::ParticleReal &AMREX_RESTRICT y, amrex::ParticleReal &AMREX_RESTRICT px, amrex::ParticleReal &AMREX_RESTRICT py) const
Definition: alignment.H:91
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dx() const
Definition: alignment.H:120
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void shift_in(amrex::ParticleReal &AMREX_RESTRICT x, amrex::ParticleReal &AMREX_RESTRICT y, amrex::ParticleReal &AMREX_RESTRICT px, amrex::ParticleReal &AMREX_RESTRICT py) const
Definition: alignment.H:61
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dy() const
Definition: alignment.H:130
Definition: beamoptic.H:135
Definition: nofinalize.H:22
Thick(amrex::ParticleReal ds, int nslice)
Definition: thick.H:30
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
amrex::ParticleReal m_ds
Definition: thick.H:58