10#ifndef IMPACTX_ELEMENTS_PROGRAMMABLE_H
11#define IMPACTX_ELEMENTS_PROGRAMMABLE_H
36 static constexpr auto type =
"Programmable";
46 amrex::ParticleReal
ds=0.0,
48 std::optional<std::string>
name = std::nullopt
80 using LinearTransport::operator();
92 throw std::runtime_error(
"The Programmable element cannot be used for linear transport maps. Use the LinearMap element instead.");
112 amrex::ParticleReal
ds ()
const
122 amrex::ParticleReal
m_ds = 0.0;
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
T_ParticleType ParticleType
Definition ImpactXParticleContainer.H:133
impactx::ParIterSoA iterator
amrex iterator for particle boxes
Definition ImpactXParticleContainer.H:136
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:31
std::function< void(RefPart &)> m_ref_particle
hook for beam particles
Definition Programmable.H:136
std::function< void(ImpactXParticleContainer::iterator *, RefPart &)> m_beam_particles
hook for push of whole container (pc, step, period)
Definition Programmable.H:135
ImpactXParticleContainer::ParticleType PType
Definition Programmable.H:37
std::function< void(ImpactXParticleContainer *, int, int)> m_push
Definition Programmable.H:134
bool m_threadsafe
number of slices used for the application of space charge
Definition Programmable.H:132
amrex::ParticleReal m_ds
Definition Programmable.H:122
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:102
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition Programmable.H:89
std::function< void()> m_finalize
hook for reference particle
Definition Programmable.H:137
int m_nslice
segment length in m
Definition Programmable.H:123
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal ds() const
Definition Programmable.H:112
static constexpr auto type
Definition Programmable.H:36
void finalize()
Definition Programmable.cpp:60
Programmable(amrex::ParticleReal ds=0.0, int nslice=1, std::optional< std::string > name=std::nullopt)
Definition Programmable.H:45
Definition lineartransport.H:29
AMREX_GPU_HOST Named(std::optional< std::string > name)
Definition named.H:57
AMREX_FORCE_INLINE std::string name() const
Definition named.H:122