10#ifndef IMPACTX_DISTRIBUTION_TRIANGLE
11#define IMPACTX_DISTRIBUTION_TRIANGLE
42 amrex::ParticleReal
const lambdax, amrex::ParticleReal
const lambday,
43 amrex::ParticleReal
const lambdat, amrex::ParticleReal
const lambdapx,
44 amrex::ParticleReal
const lambdapy, amrex::ParticleReal
const lambdapt,
45 amrex::ParticleReal
const muxpx=0.0, amrex::ParticleReal
const muypy=0.0,
46 amrex::ParticleReal
const mutpt=0.0, amrex::ParticleReal
const meanx=0.0,
47 amrex::ParticleReal
const meany=0.0, amrex::ParticleReal
const meant=0.0,
48 amrex::ParticleReal
const meanpx=0.0, amrex::ParticleReal
const meanpy=0.0,
49 amrex::ParticleReal
const meanpt=0.0, amrex::ParticleReal
const dispx=0.0,
50 amrex::ParticleReal
const disppx=0.0, amrex::ParticleReal
const dispy=0.0,
51 amrex::ParticleReal
const disppy=0.0
67 void initialize ([[maybe_unused]] amrex::ParticleReal bunch_charge, [[maybe_unused]]
RefPart const & ref)
92 amrex::ParticleReal & x,
93 amrex::ParticleReal & y,
94 amrex::ParticleReal &
t,
95 amrex::ParticleReal & px,
96 amrex::ParticleReal & py,
97 amrex::ParticleReal & pt,
102 using namespace amrex::literals;
105 amrex::ParticleReal ln1, norm, u0, u1, u2;
106 amrex::ParticleReal g1, g2, g3, g4, g5;
107 amrex::ParticleReal d, root, a1, a2;
112 t = std::sqrt(2_prt)*(2_prt-3_prt*std::sqrt(u0));
117 ln1 = std::sqrt(-2_prt*std::log(u1));
118 g1 = ln1 * std::cos(2_prt*pi*u2);
119 g2 = ln1 * std::sin(2_prt*pi*u2);
122 ln1 = std::sqrt(-2_prt*std::log(u1));
123 g3 = ln1 * std::cos(2_prt*pi*u2);
124 g4 = ln1 * std::sin(2_prt*pi*u2);
127 ln1 = std::sqrt(-2_prt*std::log(u1));
128 g5 = ln1 * std::cos(2_prt*pi*u2);
134 norm = std::sqrt(g1*g1+g2*g2+g3*g3+g4*g4);
143 u2 = std::sqrt(d+2_prt) * std::pow(u1,1_prt/d);
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
static constexpr amrex::Real pi
@ t
fixed t as the independent variable
Definition ImpactXParticleContainer.H:38
Definition ReferenceParticle.H:31
Triangle(amrex::ParticleReal const lambdax, amrex::ParticleReal const lambday, amrex::ParticleReal const lambdat, amrex::ParticleReal const lambdapx, amrex::ParticleReal const lambdapy, amrex::ParticleReal const lambdapt, amrex::ParticleReal const muxpx=0.0, amrex::ParticleReal const muypy=0.0, amrex::ParticleReal const mutpt=0.0, amrex::ParticleReal const meanx=0.0, amrex::ParticleReal const meany=0.0, amrex::ParticleReal const meant=0.0, amrex::ParticleReal const meanpx=0.0, amrex::ParticleReal const meanpy=0.0, amrex::ParticleReal const meanpt=0.0, amrex::ParticleReal const dispx=0.0, amrex::ParticleReal const disppx=0.0, amrex::ParticleReal const dispy=0.0, amrex::ParticleReal const disppy=0.0)
Definition Triangle.H:41
amrex::ParticleReal m_lambdaPy
Definition Triangle.H:182
amrex::ParticleReal m_lambdaPx
related position axis intercepts (length) of the phase space ellipse
Definition Triangle.H:182
amrex::ParticleReal m_disppx
Definition Triangle.H:186
void initialize(amrex::ParticleReal bunch_charge, RefPart const &ref)
Definition Triangle.H:67
amrex::ParticleReal m_meanpt
Definition Triangle.H:185
amrex::ParticleReal m_meant
Definition Triangle.H:184
amrex::ParticleReal m_lambdaT
Definition Triangle.H:181
amrex::ParticleReal m_meanx
correlation length-momentum
Definition Triangle.H:184
amrex::ParticleReal m_lambdaX
Definition Triangle.H:181
amrex::ParticleReal m_mutpt
Definition Triangle.H:183
amrex::ParticleReal m_dispy
Definition Triangle.H:186
amrex::ParticleReal m_dispx
momentum coordinates of centroid offset
Definition Triangle.H:186
amrex::ParticleReal m_lambdaY
Definition Triangle.H:181
amrex::ParticleReal m_disppy
Definition Triangle.H:186
amrex::ParticleReal m_muypy
Definition Triangle.H:183
amrex::ParticleReal m_lambdaPt
Definition Triangle.H:182
amrex::ParticleReal m_meanpy
Definition Triangle.H:185
amrex::ParticleReal m_meany
Definition Triangle.H:184
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator()(amrex::ParticleReal &x, amrex::ParticleReal &y, amrex::ParticleReal &t, amrex::ParticleReal &px, amrex::ParticleReal &py, amrex::ParticleReal &pt, amrex::RandomEngine const &engine) const
Definition Triangle.H:91
amrex::ParticleReal m_meanpx
spatial coordinates of centroid offset
Definition Triangle.H:185
void finalize()
Definition Triangle.H:76
amrex::ParticleReal m_muxpx
related momentum axis intercepts of the phase space ellipse
Definition Triangle.H:183