1#ifndef OPALX_BendBase_HH
2#define OPALX_BendBase_HH
35 explicit BendBase(
const std::string& name);
39 bool bends()
const override;
44 bool apply(
const std::shared_ptr<ParticleContainer_t>& pc)
override;
90 void setDesignEnergy(
const double& energy,
bool changeable =
true)
override;
100 std::vector<Vector_t<double, 3>>
getDesignPath(std::size_t minSamples = 32)
const;
141 void setK1(
double k1);
142 double getK1()
const;
152 double calcBendAngle(
double chordLength,
double radius)
const;
Defines the abstract interface for a single beamline component in the accelerator model.
ippl::Vector< T, Dim > Vector_t
The magnetic field of a multipole.
double getNormalComponent(int n) const
Get component.
void setNormalComponent(int n, double Bn)
Set component.
Common OPALX interface for analytic horizontal bending magnets.
bool apply(const std::shared_ptr< ParticleContainer_t > &pc) override
Apply to all particles. Kernel launch moved inside the function.
virtual BMultipoleField & getField() override=0
Return field.
double getEntryFaceCurvature() const
std::vector< Vector_t< double, 3 > > getDesignPath(std::size_t minSamples=32) const
Sample the local curved reference path of the bend body.
virtual const BMultipoleField & getField() const override=0
Return field.
std::size_t getNSlices() const
void setFieldMapFN(std::string fileName)
double calcBendAngle(double chordLength, double radius) const
void setExitFaceCurvature(double curvature)
void setLength(double length)
Set the nominal body length.
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.
double calcBetaGamma() const
double exitFaceRotation_m
double getChordLength() const
Return the geometric chord between entrance and exit frames.
double getEntryFaceRotation() const
virtual void setExitAngle(double exitAngle)
virtual void setEntranceAngle(double entranceAngle)
double entryFaceRotation_m
double getBendAngle() const
double getFieldAmplitude() const
double getDesignEnergy() const override
CoordinateSystemTrafo getEdgeToBegin() const override
double getExitFaceRotation() const
double entryFaceCurvature_m
void initialise(PartBunch_t *bunch, double &startField, double &endField) override
CoordinateSystemTrafo getEdgeToEnd() const override
virtual double getExitAngle() const =0
virtual void setBendAngle(double angle)
double exitFaceCurvature_m
void setFullGap(double gap)
void setSlices(double slices)
void setExitFaceRotation(double rotation)
void setDesignEnergy(const double &energy, bool changeable=true) override
double getStepsize() const
double getExitFaceCurvature() const
double getEntranceAngle() const
void setEntryFaceCurvature(double curvature)
bool designEnergyChangeable_m
void setStepsize(double stepSize)
void getFieldExtend(double &zBegin, double &zEnd) const override
Return the field-support extent of the component.
void setNSlices(const std::size_t &nSlices)
double calcFieldAmplitude(double radius) const
int getRequiredNumberOfTimeSteps() const override
double calcDesignRadius(double fieldAmplitude) const
double getStoredExitAngle() const
void setFieldAmplitude(double k0, double k0s)
Store the dipole design amplitudes used by the analytic field.
static void computeFieldHost(const Vector_t< double, 3 > &R, const BMultipoleField &field, Vector_t< double, 3 > &B)
std::string getFieldMapFN() const
bool bends() const override
void setEntryFaceRotation(double rotation)
double getFullGap() const
bool isInside(const Vector_t< double, 3 > &r) const override
Rigid spatial transform between a parent frame and a local frame.
virtual double getElementLength() const
Get design length.
virtual void setElementLength(double length)
Set design length.