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

#include <CFbend.H>

Inheritance diagram for impactx::elements::CFbend:
impactx::elements::mixin::Named impactx::elements::mixin::BeamOptic< CFbend > impactx::elements::mixin::LinearTransport< CFbend > impactx::elements::mixin::Thick impactx::elements::mixin::Alignment impactx::elements::mixin::PipeAperture impactx::elements::mixin::NoFinalize

Public Types

using PType = ImpactXParticleContainer::ParticleType
 

Public Member Functions

 CFbend (amrex::ParticleReal ds, amrex::ParticleReal rc, amrex::ParticleReal k, 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)
 
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_DEVICE AMREX_FORCE_INLINE void operator() (RefPart &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< CFbend >
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< CFbend >
 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::Thick
 Thick (amrex::ParticleReal ds, int nslice)
 
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::PipeAperture
 PipeAperture (amrex::ParticleReal aperture_x, amrex::ParticleReal aperture_y)
 
 PipeAperture ()=default
 
 PipeAperture (PipeAperture const &)=default
 
PipeApertureoperator= (PipeAperture const &)=default
 
 PipeAperture (PipeAperture &&)=default
 
PipeApertureoperator= (PipeAperture &&rhs)=default
 
 ~PipeAperture ()=default
 
template<typename T_Real = amrex::ParticleReal, typename T_IdCpu = uint64_t>
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
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal aperture_x () const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal aperture_y () const
 
- Public Member Functions inherited from impactx::elements::mixin::NoFinalize
void finalize ()
 

Public Attributes

amrex::ParticleReal m_rc
 
amrex::ParticleReal m_k
 bend radius in m
 
- Public Attributes inherited from impactx::elements::mixin::Thick
amrex::ParticleReal m_ds
 
int m_nslice
 segment length in m
 
- 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]
 
- Public Attributes inherited from impactx::elements::mixin::PipeAperture
amrex::ParticleReal m_inv_aperture_x = 0
 
amrex::ParticleReal m_inv_aperture_y = 0
 inverse of the horizontal aperture size [1/m]
 

Static Public Attributes

static constexpr auto type = "CFbend"
 
- Static Public Attributes inherited from impactx::elements::mixin::Alignment
static constexpr amrex::ParticleReal degree2rad = ablastr::constant::math::pi / 180.0
 

Private Attributes

amrex::ParticleReal m_R11
 quadrupole strength in m^(-2)
 
amrex::ParticleReal m_R12
 
amrex::ParticleReal m_R16
 
amrex::ParticleReal m_R21
 
amrex::ParticleReal m_R22
 
amrex::ParticleReal m_R26
 
amrex::ParticleReal m_R33
 
amrex::ParticleReal m_R34
 
amrex::ParticleReal m_R43
 
amrex::ParticleReal m_R44
 
amrex::ParticleReal m_R51
 
amrex::ParticleReal m_R52
 
amrex::ParticleReal m_R56
 

Member Typedef Documentation

◆ PType

Constructor & Destructor Documentation

◆ CFbend()

impactx::elements::CFbend::CFbend ( amrex::ParticleReal ds,
amrex::ParticleReal rc,
amrex::ParticleReal k,
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 )
inline

An combined-function bend, consisting of an ideal sector bend with an upright quadrupole focusing component.

Parameters
dsSegment length in m.
rcRadius of curvature in m.
kQuadrupole strength in m^(-2) (MADX convention) = (gradient in T/m) / (rigidity in T-m) k > 0 horizontal focusing k < 0 horizontal defocusing
dxhorizontal translation error in m
dyvertical translation error in m
rotation_degreerotation error in the transverse plane [degrees]
aperture_xhorizontal half-aperture in m
aperture_yvertical half-aperture in m
nslicenumber of slices used for the application of space charge
namea user defined and not necessarily unique name of the element

Member Function Documentation

◆ compute_constants()

void impactx::elements::CFbend::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()() [1/2]

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void impactx::elements::CFbend::operator() ( RefPart &AMREX_RESTRICT refpart) const
inline

This pushes the reference particle.

Parameters
[in,out]refpartreference particle

◆ operator()() [2/2]

template<typename T_Real = amrex::ParticleReal, typename T_IdCpu = uint64_t>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void impactx::elements::CFbend::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 cfbend functor, so that a variable of this type can be used like a cfbend 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
idcpuparticle global index
refpartreference particle (unused)

◆ transport_map()

AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 impactx::elements::CFbend::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_k

amrex::ParticleReal impactx::elements::CFbend::m_k

bend radius in m

◆ m_R11

amrex::ParticleReal impactx::elements::CFbend::m_R11
private

quadrupole strength in m^(-2)

◆ m_R12

amrex::ParticleReal impactx::elements::CFbend::m_R12
private

◆ m_R16

amrex::ParticleReal impactx::elements::CFbend::m_R16
private

◆ m_R21

amrex::ParticleReal impactx::elements::CFbend::m_R21
private

◆ m_R22

amrex::ParticleReal impactx::elements::CFbend::m_R22
private

◆ m_R26

amrex::ParticleReal impactx::elements::CFbend::m_R26
private

◆ m_R33

amrex::ParticleReal impactx::elements::CFbend::m_R33
private

◆ m_R34

amrex::ParticleReal impactx::elements::CFbend::m_R34
private

◆ m_R43

amrex::ParticleReal impactx::elements::CFbend::m_R43
private

◆ m_R44

amrex::ParticleReal impactx::elements::CFbend::m_R44
private

◆ m_R51

amrex::ParticleReal impactx::elements::CFbend::m_R51
private

◆ m_R52

amrex::ParticleReal impactx::elements::CFbend::m_R52
private

◆ m_R56

amrex::ParticleReal impactx::elements::CFbend::m_R56
private

◆ m_rc

amrex::ParticleReal impactx::elements::CFbend::m_rc

◆ type

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

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