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

#include <RFCavity.H>

Public Types

using PType = ImpactXParticleContainer::ParticleType
 

Public Member Functions

 RFCavity (amrex::ParticleReal const ds, amrex::ParticleReal const escale, amrex::ParticleReal const freq, amrex::ParticleReal const phase, int const mapsteps, int const nslice)
 
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 RF_Efield (amrex::ParticleReal const zeval) const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void map3 (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
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void map1 (amrex::ParticleReal const tau, RefPart &refpart, amrex::ParticleReal &zeval) const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int nslice () const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal ds () const
 

Static Public Attributes

static constexpr auto name = "RFCavity"
 

Private Attributes

amrex::ParticleReal m_ds
 
amrex::ParticleReal m_escale
 segment length in m More...
 
amrex::ParticleReal m_freq
 scaling factor for RF electric field More...
 
amrex::ParticleReal m_phase
 RF frequency in Hz. More...
 
int m_mapsteps
 RF driven phase in deg. More...
 
int m_nslice
 number of map integration steps per slice More...
 

Member Typedef Documentation

◆ PType

Constructor & Destructor Documentation

◆ RFCavity()

impactx::RFCavity::RFCavity ( amrex::ParticleReal const  ds,
amrex::ParticleReal const  escale,
amrex::ParticleReal const  freq,
amrex::ParticleReal const  phase,
int const  mapsteps,
int const  nslice 
)
inline

An RF cavity

Parameters
dsSegment length in m
escaleScaling factor for on-axis RF electric field in 1/m
freqRF frequency in Hz
phaseRF driven phase in deg
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

Member Function Documentation

◆ ds()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal impactx::RFCavity::ds ( ) const
inline

Return the segment length

Returns
value in meters

◆ map1()

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

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

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::RFCavity::map2 ( amrex::ParticleReal const  tau,
RefPart refpart,
amrex::ParticleReal &  zeval 
) const
inline

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

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

◆ map3()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void impactx::RFCavity::map3 ( 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 an RF cavity through the symplectic map associated with H_3 in the Hamiltonian splitting H = H_1 + H_2 + H_3.

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

◆ nslice()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int impactx::RFCavity::nslice ( ) const
inline

Number of slices used for the application of space charge

Returns
positive integer

◆ operator()() [1/2]

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void impactx::RFCavity::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 an RF cavity functor, so that a variable of this type can be used like an RF cavity 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::RFCavity::operator() ( RefPart &AMREX_RESTRICT  refpart) const
inline

This pushes the reference particle.

Parameters
[in,out]refpartreference particle

◆ RF_Efield()

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

This evaluates the on-axis RF electric field 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_ds

amrex::ParticleReal impactx::RFCavity::m_ds
private

◆ m_escale

amrex::ParticleReal impactx::RFCavity::m_escale
private

segment length in m

◆ m_freq

amrex::ParticleReal impactx::RFCavity::m_freq
private

scaling factor for RF electric field

◆ m_mapsteps

int impactx::RFCavity::m_mapsteps
private

RF driven phase in deg.

◆ m_nslice

int impactx::RFCavity::m_nslice
private

number of map integration steps per slice

◆ m_phase

amrex::ParticleReal impactx::RFCavity::m_phase
private

RF frequency in Hz.

◆ name

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

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