ImpactX
Loading...
Searching...
No Matches
impactx::elements::mixin::Alignment Struct Reference

#include <alignment.H>

Inheritance diagram for impactx::elements::mixin::Alignment:
impactx::elements::Aperture impactx::elements::Buncher impactx::elements::CFbend impactx::elements::ChrAcc impactx::elements::ChrDrift impactx::elements::ChrPlasmaLens impactx::elements::ChrQuad impactx::elements::ConstF impactx::elements::DipEdge impactx::elements::Drift impactx::elements::ExactCFbend impactx::elements::ExactDrift impactx::elements::ExactMultipole impactx::elements::ExactQuad impactx::elements::ExactSbend impactx::elements::Kicker impactx::elements::LinearMap impactx::elements::Multipole impactx::elements::NonlinearLens impactx::elements::PlaneXYRot impactx::elements::Quad impactx::elements::QuadEdge impactx::elements::RFCavity impactx::elements::Sbend impactx::elements::ShortRF impactx::elements::SoftQuadrupole impactx::elements::SoftSolenoid impactx::elements::Sol impactx::elements::TaperedPL impactx::elements::ThinDipole

Public Member Functions

 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 Attributes

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 amrex::ParticleReal degree2rad = ablastr::constant::math::pi / 180.0
 

Private Attributes

amrex::ParticleReal m_sin_rotation
 rotation error in the transverse plane [rad]
 
amrex::ParticleReal m_cos_rotation
 std::sin(m_rotation)
 

Detailed Description

This is a helper class for lattice elements with horizontal/vertical alignment errors

Constructor & Destructor Documentation

◆ Alignment() [1/4]

impactx::elements::mixin::Alignment::Alignment ( amrex::ParticleReal dx,
amrex::ParticleReal dy,
amrex::ParticleReal rotation_degree )
inline

A finite-length element

Parameters
dxhorizontal translation error in m
dyvertical translation error in m
rotation_degreerotation error in the transverse plane [degrees]

◆ Alignment() [2/4]

impactx::elements::mixin::Alignment::Alignment ( )
default

◆ Alignment() [3/4]

impactx::elements::mixin::Alignment::Alignment ( Alignment const & )
default

◆ Alignment() [4/4]

impactx::elements::mixin::Alignment::Alignment ( Alignment && )
default

◆ ~Alignment()

impactx::elements::mixin::Alignment::~Alignment ( )
default

Member Function Documentation

◆ compute_constants()

void impactx::elements::mixin::Alignment::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

◆ dx()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal impactx::elements::mixin::Alignment::dx ( ) const
inline

Horizontal translation error

Returns
horizontal translation error in m

◆ dy()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal impactx::elements::mixin::Alignment::dy ( ) const
inline

Vertical translation error

Returns
vertical translation error in m

◆ operator=() [1/2]

Alignment & impactx::elements::mixin::Alignment::operator= ( Alignment && rhs)
default

◆ operator=() [2/2]

Alignment & impactx::elements::mixin::Alignment::operator= ( Alignment const & )
default

◆ rotation()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal impactx::elements::mixin::Alignment::rotation ( ) const
inline

rotation error in the transverse plane

Returns
rotation error in the transverse plane [degrees]

◆ shift_in()

template<typename T_Real>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void impactx::elements::mixin::Alignment::shift_in ( T_Real &AMREX_RESTRICT x,
T_Real &AMREX_RESTRICT y,
T_Real &AMREX_RESTRICT px,
T_Real &AMREX_RESTRICT py ) const
inline

Shift the particle into the alignment error frame

The

See also
compute_constants method must be called before pushing particles through this operator.
Parameters
[in,out]xhorizontal position relative to reference particle
[in,out]yvertical position relative to reference particle
[in,out]pxhorizontal momentum relative to reference particle
[in,out]pyvertical momentum relative to reference particle

◆ shift_out()

template<typename T_Real>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void impactx::elements::mixin::Alignment::shift_out ( T_Real &AMREX_RESTRICT x,
T_Real &AMREX_RESTRICT y,
T_Real &AMREX_RESTRICT px,
T_Real &AMREX_RESTRICT py ) const
inline

Shift the particle out of the alignment error frame

The

See also
compute_constants method must be called before pushing particles through this operator.
Parameters
[in,out]xhorizontal position relative to reference particle
[in,out]yvertical position relative to reference particle
[in,out]pxhorizontal momentum relative to reference particle
[in,out]pyvertical momentum relative to reference particle

Member Data Documentation

◆ degree2rad

amrex::ParticleReal impactx::elements::mixin::Alignment::degree2rad = ablastr::constant::math::pi / 180.0
staticconstexpr

◆ m_cos_rotation

amrex::ParticleReal impactx::elements::mixin::Alignment::m_cos_rotation
private

std::sin(m_rotation)

◆ m_dx

amrex::ParticleReal impactx::elements::mixin::Alignment::m_dx = 0

◆ m_dy

amrex::ParticleReal impactx::elements::mixin::Alignment::m_dy = 0

horizontal translation error [m]

◆ m_rotation

amrex::ParticleReal impactx::elements::mixin::Alignment::m_rotation = 0

vertical translation error [m]

◆ m_sin_rotation

amrex::ParticleReal impactx::elements::mixin::Alignment::m_sin_rotation
private

rotation error in the transverse plane [rad]


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