1#ifndef OPALX_Multipole_HH
2#define OPALX_Multipole_HH
33 explicit Multipole(
const std::string& name);
71 virtual bool apply(
const std::shared_ptr<ParticleContainer_t>& pc)
override;
141 virtual bool bends()
const override;
145 virtual void getFieldExtend(
double& zBegin,
double& zEnd)
const override;
180 KOKKOS_INLINE_FUNCTION
184 const Kokkos::View<double*>
SkewComponents,
int max_NormalComponent,
185 int max_SkewComponent);
Defines the abstract interface for a single beamline component in the accelerator model.
ippl::Vector< T, Dim > Vector_t
constexpr int MAX_MP_ORDER
The magnetic field of a multipole.
Abstract base class for all field maps. It acts as a factory for creating specific field map types ba...
Interface for general multipole.
void setSkewComponent(int n, double)
virtual void accept(BeamlineVisitor &) const override
Accepts a BeamlineVisitor.
int max_NormalComponent_m
size_t getMaxSkewComponentIndex() const
size_t getMaxNormalComponentIndex() const
void setNormalComponent(int n, double)
virtual const StraightGeometry & getGeometry() const override=0
Get geometry.
virtual const BMultipoleField & getField() const override=0
Return field.
virtual void initialise(PartBunch_t *bunch, double &startField, double &endField) override
Setup, multipole goes online.
bool isFocusing(int n) const
virtual bool applyToReferenceParticle(const Vector_t< double, 3 > &R, const Vector_t< double, 3 > &P, const double &t, Vector_t< double, 3 > &E, Vector_t< double, 3 > &B) override
Apply to reference particle with position R and momemtum P.
virtual StraightGeometry & getGeometry() override=0
Get geometry.
virtual void finalise() override
void setNSlices(const std::size_t &nSlices)
virtual bool bends() const override
void computeFieldHost(Vector_t< double, 3 > R, Vector_t< double, 3 > &E, Vector_t< double, 3 > &B) const
Computes the E and B field at position R of the reference particle.
Kokkos::View< double * > SkewComponents
virtual ElementType getType() const override
Get element type std::string.
virtual bool isInside(const Vector_t< double, 3 > &r) const override
virtual bool apply(const std::shared_ptr< ParticleContainer_t > &pc) override
Apply to all particles. Kernel launch moved inside the function.
Kokkos::View< double * > SkewComponentErrors
Kokkos::View< double * > NormalComponentErrors
Kokkos::View< double * > NormalComponents
static KOKKOS_INLINE_FUNCTION void computeField(Vector_t< double, 3 > R, Vector_t< double, 3 > &E, Vector_t< double, 3 > &B, const Kokkos::View< double * > NormalComponents, const Kokkos::View< double * > SkewComponents, int max_NormalComponent, int max_SkewComponent)
Computes the E and B field at position R.
double getSkewComponent(int n) const
Gets the n-th skew component of the multipole expansion.
virtual void getFieldExtend(double &zBegin, double &zEnd) const override
Return the field-support extent of the component.
std::size_t getNSlices() const
double getNormalComponent(int n) const
Gets the n-th normal component of the multipole expansion.
virtual BMultipoleField & getField() override=0
Return field.
void operator=(const Multipole &)
A geometry representing a straight line.