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

#include <PolygonAperture.H>

Inheritance diagram for impactx::elements::PolygonAperture:
impactx::elements::mixin::Named impactx::elements::mixin::BeamOptic< PolygonAperture > impactx::elements::mixin::LinearTransport< PolygonAperture > impactx::elements::mixin::Thin impactx::elements::mixin::Alignment impactx::elements::mixin::NoFinalize

Public Types

enum  Action { transmit , absorb }
 
using PType = ImpactXParticleContainer::ParticleType
 

Public Member Functions

 PolygonAperture (std::vector< amrex::ParticleReal > vertices_x, std::vector< amrex::ParticleReal > vertices_y, amrex::ParticleReal min_radius2, amrex::ParticleReal repeat_x, amrex::ParticleReal repeat_y, bool shift_odd_x, Action action, amrex::ParticleReal dx=0, amrex::ParticleReal dy=0, amrex::ParticleReal rotation_degree=0, 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< PolygonAperture >
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< PolygonAperture >
 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::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::NoFinalize
void finalize ()
 

Static Public Member Functions

static std::string action_name (Action const &action)
 

Public Attributes

Action m_action
 
amrex::ParticleReal m_repeat_x
 action type (transmit, absorb)
 
amrex::ParticleReal m_repeat_y
 horizontal period for repeated masking
 
bool m_shift_odd_x
 vertical period for repeated masking
 
int m_id
 for hexagonal/triangular mask patterns: horizontal shift of every 2nd (odd) vertical period by m_repeat_x / 2. Use Alignment offsets to move whole mask as needed.
 
amrex::ParticleReal m_min_radius2
 unique PolygonAperture id used for data lookup map
 
std::vector< double >::size_type m_nvert = 0
 
amrex::ParticleReal * m_vertices_x_h_data = nullptr
 number of vertices
 
amrex::ParticleReal * m_vertices_y_h_data = nullptr
 non-owning pointer to host x vertices
 
amrex::ParticleReal * m_vertices_x_d_data = nullptr
 non-owning pointer to host vertices
 
amrex::ParticleReal * m_vertices_y_d_data = nullptr
 non-owning pointer to device x vertices
 
- 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]
 

Static Public Attributes

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

Member Typedef Documentation

◆ PType

Member Enumeration Documentation

◆ Action

Enumerator
transmit 
absorb 

Constructor & Destructor Documentation

◆ PolygonAperture()

impactx::elements::PolygonAperture::PolygonAperture ( std::vector< amrex::ParticleReal > vertices_x,
std::vector< amrex::ParticleReal > vertices_y,
amrex::ParticleReal min_radius2,
amrex::ParticleReal repeat_x,
amrex::ParticleReal repeat_y,
bool shift_odd_x,
Action action,
amrex::ParticleReal dx = 0,
amrex::ParticleReal dy = 0,
amrex::ParticleReal rotation_degree = 0,
std::optional< std::string > name = std::nullopt )
inline

A thin collimator element that applies a transverse aperture boundary defined by points of a polygon vertices. Particles outside the boundary are considered lost.

Parameters
actionspecify action of domain (transmit/absorb)
vertices_xarray of coordinates of the horizontal vertex positions (m)
vertices_yarray of coordinates of the vertical vertex positions (m)
min_radius2a minimum radius**2 below which all particles are transmitted
repeat_xhorizontal period for repeated masking, optional (m)
repeat_yvertical period for repeated masking, optional (m)
shift_odd_xfor hexagonal/triangular mask patterns: horizontal shift of every 2nd (odd) vertical period by repeat_x / 2. Use alignment offsets dx,dy to move whole mask as needed.
dxhorizontal translation error in m
dyvertical translation error in m
rotation_degreerotation error in the transverse plane [degrees]
namea user defined and not necessarily unique name of the element

Member Function Documentation

◆ action_name()

std::string impactx::elements::PolygonAperture::action_name ( Action const & action)
static

◆ compute_constants()

void impactx::elements::PolygonAperture::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 (unused)

◆ operator()()

template<typename T_Real = amrex::ParticleReal, typename T_IdCpu = uint64_t>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void impactx::elements::PolygonAperture::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 an aperture functor, so that a variable of this type can be used like an aperture function.

Parameters
xparticle position in x
yparticle position in y
tparticle position in t (unused)
pxparticle momentum in x
pyparticle momentum in y
ptparticle momentum in t (unused)
idcpuparticle global index
refpartreference particle (unused)

◆ transport_map()

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

Action impactx::elements::PolygonAperture::m_action

◆ m_id

int impactx::elements::PolygonAperture::m_id

for hexagonal/triangular mask patterns: horizontal shift of every 2nd (odd) vertical period by m_repeat_x / 2. Use Alignment offsets to move whole mask as needed.

◆ m_min_radius2

amrex::ParticleReal impactx::elements::PolygonAperture::m_min_radius2

unique PolygonAperture id used for data lookup map

◆ m_nvert

std::vector<double>::size_type impactx::elements::PolygonAperture::m_nvert = 0

◆ m_repeat_x

amrex::ParticleReal impactx::elements::PolygonAperture::m_repeat_x

action type (transmit, absorb)

◆ m_repeat_y

amrex::ParticleReal impactx::elements::PolygonAperture::m_repeat_y

horizontal period for repeated masking

◆ m_shift_odd_x

bool impactx::elements::PolygonAperture::m_shift_odd_x

vertical period for repeated masking

◆ m_vertices_x_d_data

amrex::ParticleReal* impactx::elements::PolygonAperture::m_vertices_x_d_data = nullptr

non-owning pointer to host vertices

◆ m_vertices_x_h_data

amrex::ParticleReal* impactx::elements::PolygonAperture::m_vertices_x_h_data = nullptr

number of vertices

◆ m_vertices_y_d_data

amrex::ParticleReal* impactx::elements::PolygonAperture::m_vertices_y_d_data = nullptr

non-owning pointer to device x vertices

◆ m_vertices_y_h_data

amrex::ParticleReal* impactx::elements::PolygonAperture::m_vertices_y_h_data = nullptr

non-owning pointer to host x vertices

◆ type

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

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