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

#include <PRot.H>

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

Public Types

using PType = ImpactXParticleContainer::ParticleType
 

Public Member Functions

 PRot (amrex::ParticleReal phi_in, amrex::ParticleReal phi_out, 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< PRot >
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< PRot >
 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::NoFinalize
void finalize ()
 

Public Attributes

amrex::ParticleReal m_phi_in
 
amrex::ParticleReal m_phi_out
 normalized (max) RF voltage drop.
 

Static Public Attributes

static constexpr auto type = "PRot"
 
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_inv_beta
 RF wavenumber in 1/m.
 
amrex::ParticleReal m_sin_theta
 
amrex::ParticleReal m_cos_theta
 
amrex::ParticleReal m_sin_phi_in
 
amrex::ParticleReal m_cos_phi_in
 

Member Typedef Documentation

◆ PType

Constructor & Destructor Documentation

◆ PRot()

impactx::elements::PRot::PRot ( amrex::ParticleReal phi_in,
amrex::ParticleReal phi_out,
std::optional< std::string > name = std::nullopt )
inline

An exact pole face rotation in the x-z plane, from a frame in which the reference orbit has angle phi_in with the z-axis, to a frame in which the reference orbit has angle phi_out with the z-axis. The net rotation angle is phi_out - phi_in.

Parameters
phi_inInitial angle of reference trajectory w/r/t z (degrees)
phi_outFinal angle of reference trajectory w/r/t/ z (degrees)
namea user defined and not necessarily unique name of the element

Member Function Documentation

◆ compute_constants()

void impactx::elements::PRot::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::PRot::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 prot functor, so that a variable of this type can be used like a prot 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 (unused)
refpartreference particle (unused)

◆ transport_map()

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

◆ degree2rad

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

◆ m_cos_phi_in

amrex::ParticleReal impactx::elements::PRot::m_cos_phi_in
private

◆ m_cos_theta

amrex::ParticleReal impactx::elements::PRot::m_cos_theta
private

◆ m_inv_beta

amrex::ParticleReal impactx::elements::PRot::m_inv_beta
private

RF wavenumber in 1/m.

◆ m_phi_in

amrex::ParticleReal impactx::elements::PRot::m_phi_in

◆ m_phi_out

amrex::ParticleReal impactx::elements::PRot::m_phi_out

normalized (max) RF voltage drop.

◆ m_sin_phi_in

amrex::ParticleReal impactx::elements::PRot::m_sin_phi_in
private

◆ m_sin_theta

amrex::ParticleReal impactx::elements::PRot::m_sin_theta
private

◆ type

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

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