ImpactX
Loading...
Searching...
No Matches
impactx::elements::QuadEdge Struct Reference

#include <QuadEdge.H>

Inheritance diagram for impactx::elements::QuadEdge:
impactx::elements::mixin::Named impactx::elements::mixin::BeamOptic< QuadEdge > impactx::elements::mixin::LinearTransport< QuadEdge > impactx::elements::mixin::Thin impactx::elements::mixin::Alignment impactx::elements::mixin::NoFinalize amrex::simd::Vectorized< amrex::simd::native_simd_size_particlereal > amrex::simd::detail::InternalVectorized

Public Types

enum  Location { entry = 1 , exit = -1 }
 
using PType = ImpactXParticleContainer::ParticleType
 

Public Member Functions

 QuadEdge (amrex::ParticleReal k, int unit, Location flag, amrex::ParticleReal dx=0, amrex::ParticleReal dy=0, amrex::ParticleReal rotation_degree=0, std::optional< std::string > name=std::nullopt)
 
void compute_constants (RefPart const &refpart)
 
template<typename T_Real = amrex::ParticleReal, typename T_IdCpu = uint64_t>
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
 
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map (RefPart const &AMREX_RESTRICT refpart) const
 
- Public Member Functions inherited from impactx::elements::mixin::Named
AMREX_GPU_HOST void set_name (std::string const &new_name)
 
AMREX_GPU_HOST Named (std::optional< std::string > name)
 
AMREX_GPU_HOST_DEVICE ~Named ()
 
AMREX_GPU_HOST Named (Named const &other)
 
AMREX_GPU_HOST Namedoperator= (Named const &other)
 
AMREX_GPU_HOST_DEVICE Named (Named &&other) noexcept
 
AMREX_GPU_HOST_DEVICE Namedoperator= (Named &&other) noexcept
 
AMREX_FORCE_INLINE std::string name () const
 
AMREX_FORCE_INLINE bool has_name () const
 
- Public Member Functions inherited from impactx::elements::mixin::BeamOptic< QuadEdge >
void operator() (ImpactXParticleContainer &pc, int step, int period)
 
void operator() (ImpactXParticleContainer::iterator &pti, RefPart &AMREX_RESTRICT ref_part)
 
- Public Member Functions inherited from impactx::elements::mixin::LinearTransport< QuadEdge >
 LinearTransport ()=default
 
 LinearTransport (LinearTransport const &)=default
 
 LinearTransport (LinearTransport &&)=default
 
LinearTransportoperator= (LinearTransport const &)=default
 
LinearTransportoperator= (LinearTransport &&rhs)=default
 
 ~LinearTransport ()=default
 
AMREX_GPU_HOST AMREX_FORCE_INLINE void operator() (Map6x6 &AMREX_RESTRICT cm, RefPart const &AMREX_RESTRICT ref) const
 
- Public Member Functions inherited from impactx::elements::mixin::Thin
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator() (RefPart &AMREX_RESTRICT refpart) const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int nslice () const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal ds () const
 
- Public Member Functions inherited from impactx::elements::mixin::Alignment
 Alignment (amrex::ParticleReal dx, amrex::ParticleReal dy, amrex::ParticleReal rotation_degree)
 
 Alignment ()=default
 
 Alignment (Alignment const &)=default
 
Alignmentoperator= (Alignment const &)=default
 
 Alignment (Alignment &&)=default
 
Alignmentoperator= (Alignment &&rhs)=default
 
 ~Alignment ()=default
 
void compute_constants (RefPart const &refpart)
 
template<typename T_Real>
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
 
template<typename T_Real>
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
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dx () const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dy () const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal rotation () const
 
- Public Member Functions inherited from impactx::elements::mixin::NoFinalize
void finalize ()
 

Public Attributes

amrex::ParticleReal m_k
 
int m_unit
 quadrupole focusing strength
 
Location m_flag
 unit specification for quad strength
 
- Public Attributes inherited from impactx::elements::mixin::Alignment
amrex::ParticleReal m_dx = 0
 
amrex::ParticleReal m_dy = 0
 horizontal translation error [m]
 
amrex::ParticleReal m_rotation = 0
 vertical translation error [m]
 

Static Public Attributes

static constexpr auto type = "QuadEdge"
 
- Static Public Attributes inherited from impactx::elements::mixin::Alignment
static constexpr amrex::ParticleReal degree2rad = ablastr::constant::math::pi / 180.0
 
- Static Public Attributes inherited from amrex::simd::Vectorized< amrex::simd::native_simd_size_particlereal >
static constexpr int simd_width
 

Private Attributes

amrex::ParticleReal m_g
 +1 for entry, or -1 for exit
 
amrex::ParticleReal m_a
 
amrex::ParticleReal m_beta
 
amrex::ParticleReal m_gamma
 

Member Typedef Documentation

◆ PType

Member Enumeration Documentation

◆ Location

Enumerator
entry 
exit 

for leading (entry) fringe field

Constructor & Destructor Documentation

◆ QuadEdge()

impactx::elements::QuadEdge::QuadEdge ( amrex::ParticleReal k,
int unit,
Location flag,
amrex::ParticleReal dx = 0,
amrex::ParticleReal dy = 0,
amrex::ParticleReal rotation_degree = 0,
std::optional< std::string > name = std::nullopt )
inline

Quadrupole entry or exit fringe field effects.

This is a third-order nonlinear symplectic map, representing model-independent terms that contribute in the hard-edge limit. Chromatic energy dependence is included. We use an explicit (symplectification) of the map generated by eq (28) of:

References: E. Forest and J. Milutinovic, Nucl. Instrum. and Methods in Phys. Res. A 269, 474-482 (1988), https://doi.org/10.1016/0168-9002(88)90123-4

Parameters
kQuadrupole strength in m^(-2) (MADX convention) = (gradient in T/m) / (rigidity in T-m) OR Quadrupole strength in T/m (MaryLie convention) k > 0 horizontal focusing k < 0 horizontal defocusing
unitUnit specification unit = 0 MADX convention (default) unit = 1 MaryLie convention
flagFlag specifying entry or exit location
dxhorizontal translation error in m
dyvertical translation error in m
rotation_degreerotation error in the transverse plane [degrees]
namea user defined and not necessarily unique name of the element

Member Function Documentation

◆ compute_constants()

void impactx::elements::QuadEdge::compute_constants ( RefPart const & refpart)
inline

Compute and cache the constants for the push.

In particular, used to pre-compute and cache variables that are independent of the individually tracked particle.

Parameters
refpartreference particle

◆ operator()()

template<typename T_Real = amrex::ParticleReal, typename T_IdCpu = uint64_t>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void impactx::elements::QuadEdge::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
inline

This is a quadedge functor, so that a variable of this type can be used like a quadedge function.

The

See also
compute_constants method must be called before pushing particles through this operator.
Parameters
xparticle position in x
yparticle position in y
tparticle position in t
pxparticle momentum in x
pyparticle momentum in y
ptparticle momentum in t (unchanged)
idcpuparticle global index (unused)
refpartreference particle (unused)

◆ transport_map()

AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 impactx::elements::QuadEdge::transport_map ( RefPart const &AMREX_RESTRICT refpart) const
inline

This function returns the linear transport map.

Parameters
[in]refpartreference particle
Returns
6x6 transport matrix

Member Data Documentation

◆ m_a

amrex::ParticleReal impactx::elements::QuadEdge::m_a
private

◆ m_beta

amrex::ParticleReal impactx::elements::QuadEdge::m_beta
private

◆ m_flag

Location impactx::elements::QuadEdge::m_flag

unit specification for quad strength

◆ m_g

amrex::ParticleReal impactx::elements::QuadEdge::m_g
private

+1 for entry, or -1 for exit

◆ m_gamma

amrex::ParticleReal impactx::elements::QuadEdge::m_gamma
private

◆ m_k

amrex::ParticleReal impactx::elements::QuadEdge::m_k

◆ m_unit

int impactx::elements::QuadEdge::m_unit

quadrupole focusing strength

◆ type

auto impactx::elements::QuadEdge::type = "QuadEdge"
staticconstexpr

The documentation for this struct was generated from the following file: