10#ifndef IMPACTX_ELEMENTS_PROGRAMMABLE_H
11#define IMPACTX_ELEMENTS_PROGRAMMABLE_H
36 static constexpr auto type =
"Programmable";
48 std::optional<std::string>
name = std::nullopt
56 throw std::runtime_error(
"Programmable: reverse() is not supported.");
75 [[maybe_unused]]
bool spin
87 using LinearTransport::operator();
99 throw std::runtime_error(
"The Programmable element cannot be used for linear transport maps. Use the LinearMap element instead.");
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
T_ParticleType ParticleType
Definition ImpactXParticleContainer.H:136
impactx::ParIterSoA iterator
amrex iterator for particle boxes
Definition ImpactXParticleContainer.H:139
amrex_particle_real ParticleReal
amrex::SmallMatrix< amrex::ParticleReal, 6, 6, amrex::Order::F, 1 > Map6x6
Definition CovarianceMatrix.H:20
static constexpr __host__ __device__ SmallMatrix< T, NRows, NCols, ORDER, StartIndex > Identity() noexcept
Definition ReferenceParticle.H:33
std::function< void(RefPart &)> m_ref_particle
hook for beam particles (pti, ref)
Definition Programmable.H:143
std::function< void(ImpactXParticleContainer::iterator *, RefPart &)> m_beam_particles
hook for push of whole container (pc, step, period)
Definition Programmable.H:142
ImpactXParticleContainer::ParticleType PType
Definition Programmable.H:37
void reverse()
Definition Programmable.H:54
std::function< void(ImpactXParticleContainer *, int, int)> m_push
Definition Programmable.H:141
bool m_threadsafe
number of slices used for the application of space charge
Definition Programmable.H:139
amrex::ParticleReal m_ds
Definition Programmable.H:129
void operator()(ImpactXParticleContainer &pc, int step, int period) const
Definition Programmable.cpp:20
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int nslice() const
Definition Programmable.H:109
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition Programmable.H:96
std::function< void()> m_finalize
hook for reference particle
Definition Programmable.H:144
int m_nslice
segment length in m
Definition Programmable.H:130
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal ds() const
Definition Programmable.H:119
static constexpr auto type
Definition Programmable.H:36
void finalize()
Definition Programmable.cpp:61
Programmable(amrex::ParticleReal ds=0.0, int nslice=1, std::optional< std::string > name=std::nullopt)
Definition Programmable.H:45
Definition lineartransport.H:50
AMREX_GPU_HOST Named(std::optional< std::string > name)
Definition named.H:57
AMREX_FORCE_INLINE std::string name() const
Definition named.H:122