ImpactX
Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
impactx::SoftQuadrupole Struct Reference

#include <SoftQuad.H>

Inheritance diagram for impactx::SoftQuadrupole:
impactx::elements::BeamOptic< SoftQuadrupole > impactx::elements::Thick impactx::data::SoftQuadrupole_device_copyable

Public Types

using PType = ImpactXParticleContainer::ParticleType
 

Public Member Functions

AMREX_GPU_HOST SoftQuadrupole (amrex::ParticleReal ds, amrex::ParticleReal gscale, std::vector< amrex::ParticleReal > cos_coef, std::vector< amrex::ParticleReal > sin_coef, int mapsteps=1, int nslice=1)
 
 SoftQuadrupole (SoftQuadrupole const &other)
 
SoftQuadrupoleoperator= (SoftQuadrupole const &other)
 
 SoftQuadrupole (SoftQuadrupole &&other)=default
 
SoftQuadrupoleoperator= (SoftQuadrupole &&other)=default
 
AMREX_GPU_HOST ~SoftQuadrupole ()=default
 
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, [[maybe_unused]] RefPart const &refpart) const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator() (RefPart &AMREX_RESTRICT refpart) const
 
std::tuple< amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal > AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Quad_Bfield (amrex::ParticleReal const zeval) const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void map1 (amrex::ParticleReal const tau, RefPart &refpart, [[maybe_unused]] amrex::ParticleReal &zeval) const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void map2 (amrex::ParticleReal const tau, RefPart &refpart, amrex::ParticleReal &zeval) const
 
- Public Member Functions inherited from impactx::elements::BeamOptic< SoftQuadrupole >
void operator() (ImpactXParticleContainer &pc, int step)
 
void operator() (ImpactXParticleContainer::iterator &pti, RefPart &AMREX_RESTRICT ref_part)
 
- Public Member Functions inherited from impactx::elements::Thick
 Thick (amrex::ParticleReal const ds, int const 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::data::SoftQuadrupole_device_copyable
 SoftQuadrupole_device_copyable (amrex::ParticleReal gscale, int mapsteps=1)
 non-owning pointer to device sine coefficients More...
 
 SoftQuadrupole_device_copyable (SoftQuadrupole_device_copyable const &)=default
 
SoftQuadrupole_device_copyableoperator= (SoftQuadrupole_device_copyable const &)=default
 
 SoftQuadrupole_device_copyable (SoftQuadrupole_device_copyable &&)=default
 
SoftQuadrupole_device_copyableoperator= (SoftQuadrupole_device_copyable &&)=default
 

Static Public Attributes

static constexpr auto name = "SoftQuadrupole"
 

Private Attributes

amrex::Gpu::DeviceVector< amrex::ParticleReal > m_cos_coef
 
amrex::Gpu::DeviceVector< amrex::ParticleReal > m_sin_coef
 cosine coefficients in Fourier expansion of on-axis magnetic field Bz More...
 

Additional Inherited Members

- Public Attributes inherited from impactx::data::SoftQuadrupole_device_copyable
amrex::ParticleReal m_gscale
 
int m_mapsteps
 scaling factor for quad field gradient More...
 
int m_ncoef = 0
 number of map integration steps per slice More...
 
amrex::ParticleReal * m_cos_data = nullptr
 number of Fourier coefficients More...
 
amrex::ParticleReal * m_sin_data = nullptr
 non-owning pointer to device cosine coefficients More...
 
- Protected Attributes inherited from impactx::elements::Thick
amrex::ParticleReal m_ds
 
int m_nslice
 segment length in m More...
 

Member Typedef Documentation

◆ PType

Constructor & Destructor Documentation

◆ SoftQuadrupole() [1/3]

AMREX_GPU_HOST impactx::SoftQuadrupole::SoftQuadrupole ( amrex::ParticleReal  ds,
amrex::ParticleReal  gscale,
std::vector< amrex::ParticleReal >  cos_coef,
std::vector< amrex::ParticleReal >  sin_coef,
int  mapsteps = 1,
int  nslice = 1 
)
inline

A soft-edge quadrupole

Parameters
dsSegment length in m
gscaleScaling factor for on-axis field gradient Bz in 1/m^2
cos_coefTODO
sin_coefTODO
mapstepsnumber of integration steps per slice used for map and reference particle push in applied fields
nslicenumber of slices used for the application of space charge

◆ SoftQuadrupole() [2/3]

impactx::SoftQuadrupole::SoftQuadrupole ( SoftQuadrupole const &  other)
inline

◆ SoftQuadrupole() [3/3]

impactx::SoftQuadrupole::SoftQuadrupole ( SoftQuadrupole &&  other)
default

◆ ~SoftQuadrupole()

AMREX_GPU_HOST impactx::SoftQuadrupole::~SoftQuadrupole ( )
default

Member Function Documentation

◆ map1()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void impactx::SoftQuadrupole::map1 ( amrex::ParticleReal const  tau,
RefPart refpart,
[[maybe_unused] ] amrex::ParticleReal &  zeval 
) const
inline

This pushes the reference particle and the linear map matrix elements for a quadrupole through the symplectic map associated with H_1 in the Hamiltonian splitting H = H_1 + H_2.

Parameters
tauMap step size in m
[in,out]refpartreference particle
[in,out]zevalLongitudinal on-axis location in m

◆ map2()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void impactx::SoftQuadrupole::map2 ( amrex::ParticleReal const  tau,
RefPart refpart,
amrex::ParticleReal &  zeval 
) const
inline

This pushes the reference particle and the linear map matrix elements for a quadrupole through the symplectic map associated with H_2 in the Hamiltonian splitting H = H_1 + H_2.

Parameters
tauMap step size in m
[in,out]refpartreference particle
[in,out]zevalLongitudinal on-axis location in m

◆ operator()() [1/2]

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void impactx::SoftQuadrupole::operator() ( PType &AMREX_RESTRICT  p,
amrex::ParticleReal &AMREX_RESTRICT  px,
amrex::ParticleReal &AMREX_RESTRICT  py,
amrex::ParticleReal &AMREX_RESTRICT  pt,
[[maybe_unused] ] RefPart const &  refpart 
) const
inline

This is a soft-edge quadrupole functor, so that a variable of this type can be used like a soft-edge quadrupole function.

Parameters
pParticle AoS data for positions and cpu/id
pxparticle momentum in x
pyparticle momentum in y
ptparticle momentum in t
refpartreference particle

◆ operator()() [2/2]

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

This pushes the reference particle.

Parameters
[in,out]refpartreference particle

◆ operator=() [1/2]

SoftQuadrupole& impactx::SoftQuadrupole::operator= ( SoftQuadrupole const &  other)
inline

◆ operator=() [2/2]

SoftQuadrupole& impactx::SoftQuadrupole::operator= ( SoftQuadrupole &&  other)
default

◆ Quad_Bfield()

std::tuple<amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal> AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE impactx::SoftQuadrupole::Quad_Bfield ( amrex::ParticleReal const  zeval) const
inline

This evaluates the on-axis magnetic field Bz at a fixed location z, together with certain required integrals and derivatives. The field returned is normalized to a peak value of 1.

Parameters
zevalLongitudinal on-axis location in m

Member Data Documentation

◆ m_cos_coef

amrex::Gpu::DeviceVector<amrex::ParticleReal> impactx::SoftQuadrupole::m_cos_coef
private

◆ m_sin_coef

amrex::Gpu::DeviceVector<amrex::ParticleReal> impactx::SoftQuadrupole::m_sin_coef
private

cosine coefficients in Fourier expansion of on-axis magnetic field Bz

◆ name

constexpr auto impactx::SoftQuadrupole::name = "SoftQuadrupole"
static

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