ImpactX
Public Types | Public Member Functions | Private Attributes | List of all members
impactx::elements::detail::PushSingleParticle< T_Element > Struct Template Reference

#include <beamoptic.H>

Public Types

using PType = ImpactXParticleContainer::ParticleType
 

Public Member Functions

 PushSingleParticle (T_Element element, PType *AMREX_RESTRICT aos_ptr, amrex::ParticleReal *AMREX_RESTRICT part_px, amrex::ParticleReal *AMREX_RESTRICT part_py, amrex::ParticleReal *AMREX_RESTRICT part_pt, RefPart ref_part)
 
 PushSingleParticle ()=delete
 
 PushSingleParticle (PushSingleParticle const &)=default
 
 PushSingleParticle (PushSingleParticle &&)=default
 
 ~PushSingleParticle ()=default
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void operator() (long i) const
 

Private Attributes

T_Element const m_element
 
PType *const AMREX_RESTRICT m_aos_ptr
 
amrex::ParticleReal *const AMREX_RESTRICT m_part_px
 
amrex::ParticleReal *const AMREX_RESTRICT m_part_py
 
amrex::ParticleReal *const AMREX_RESTRICT m_part_pt
 
RefPart const m_ref_part
 

Detailed Description

template<typename T_Element>
struct impactx::elements::detail::PushSingleParticle< T_Element >

Push a single particle through an element

Note: we usually would just write a C++ lambda below in ParallelFor. But, due to restrictions in NVCC as of 11.5, we cannot write a lambda in a lambda as we also std::visit the element types of our lattice elements list. error #3206-D: An extended device lambda cannot be defined inside a generic lambda expression("operator()"). Thus, we fall back to writing a C++ functor here, instead of nesting two lambdas.

Nvidia bug report: 3458976 Minimal demonstrator: https://cuda.godbolt.org/z/39e4q53Ye

Template Parameters
T_ElementThis can be a
See also
Drift,
Quad,
Sbend, etc.

Member Typedef Documentation

◆ PType

Constructor & Destructor Documentation

◆ PushSingleParticle() [1/4]

template<typename T_Element>
impactx::elements::detail::PushSingleParticle< T_Element >::PushSingleParticle ( T_Element  element,
PType *AMREX_RESTRICT  aos_ptr,
amrex::ParticleReal *AMREX_RESTRICT  part_px,
amrex::ParticleReal *AMREX_RESTRICT  part_py,
amrex::ParticleReal *AMREX_RESTRICT  part_pt,
RefPart  ref_part 
)
inline

Constructor taking in pointers to particle data

Parameters
elementthe beamline element to push through
aos_ptrthe array-of-struct with position and ids
part_pxthe array to the particle momentum (x)
part_pythe array to the particle momentum (y)
part_ptthe array to the particle momentum (t)
ref_partthe struct containing the reference particle

◆ PushSingleParticle() [2/4]

template<typename T_Element>
impactx::elements::detail::PushSingleParticle< T_Element >::PushSingleParticle ( )
delete

◆ PushSingleParticle() [3/4]

template<typename T_Element>
impactx::elements::detail::PushSingleParticle< T_Element >::PushSingleParticle ( PushSingleParticle< T_Element > const &  )
default

◆ PushSingleParticle() [4/4]

template<typename T_Element>
impactx::elements::detail::PushSingleParticle< T_Element >::PushSingleParticle ( PushSingleParticle< T_Element > &&  )
default

◆ ~PushSingleParticle()

template<typename T_Element>
impactx::elements::detail::PushSingleParticle< T_Element >::~PushSingleParticle ( )
default

Member Function Documentation

◆ operator()()

template<typename T_Element>
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void impactx::elements::detail::PushSingleParticle< T_Element >::operator() ( long  i) const
inline

Push a single particle through an element

Parameters
iparticle index in the current box

Member Data Documentation

◆ m_aos_ptr

template<typename T_Element>
PType* const AMREX_RESTRICT impactx::elements::detail::PushSingleParticle< T_Element >::m_aos_ptr
private

◆ m_element

template<typename T_Element>
T_Element const impactx::elements::detail::PushSingleParticle< T_Element >::m_element
private

◆ m_part_pt

template<typename T_Element>
amrex::ParticleReal* const AMREX_RESTRICT impactx::elements::detail::PushSingleParticle< T_Element >::m_part_pt
private

◆ m_part_px

template<typename T_Element>
amrex::ParticleReal* const AMREX_RESTRICT impactx::elements::detail::PushSingleParticle< T_Element >::m_part_px
private

◆ m_part_py

template<typename T_Element>
amrex::ParticleReal* const AMREX_RESTRICT impactx::elements::detail::PushSingleParticle< T_Element >::m_part_py
private

◆ m_ref_part

template<typename T_Element>
RefPart const impactx::elements::detail::PushSingleParticle< T_Element >::m_ref_part
private

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