OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Bend2D Class Referenceabstract

#include <Bend2D.h>

Inheritance diagram for Bend2D:
Inheritance graph
[legend]
Collaboration diagram for Bend2D:
Collaboration graph
[legend]

Public Member Functions

 Bend2D (const std::string &name)
 Constructor with given name. More...
 
 Bend2D ()
 
 Bend2D (const Bend2D &)
 
virtual ~Bend2D ()
 
virtual void accept (BeamlineVisitor &) const override=0
 Apply visitor to Bend2D. More...
 
virtual bool apply (const size_t &i, const double &t, Vector_t &E, Vector_t &B) override
 Apply field to particles with coordinates in magnet frame. More...
 
virtual bool apply (const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) override
 Apply field to particles in beam frame. More...
 
virtual bool applyToReferenceParticle (const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) override
 
virtual void goOnline (const double &kineticEnergy) override
 
virtual void finalise () override
 
virtual void getDimensions (double &sBegin, double &sEnd) const override
 
virtual ElementType getType () const override=0
 Get element type std::string. More...
 
virtual void initialise (PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override
 
double getBendRadius () const
 
double getEffectiveCenter () const
 
double getEffectiveLength () const
 
void setK1 (double k1)
 Set quadrupole field component. More...
 
virtual void setEntranceAngle (double entranceAngle) override
 
void setExitAngle (double exitAngle)
 
virtual double getExitAngle () const override
 
std::vector< Vector_tgetOutline () const
 
MeshData getSurfaceMesh () const
 
virtual CoordinateSystemTrafo getEdgeToEnd () const override
 
CoordinateSystemTrafo getBeginToEnd_local () const
 
virtual bool isInside (const Vector_t &r) const override
 
void setNSlices (const std::size_t &nSlices)
 
std::size_t getNSlices () const
 
std::array< double, 2 > getEntranceFringeFieldLength () const
 Get entrance fringe field length. More...
 
std::array< double, 2 > getExitFringeFieldLength () const
 Get exit fringe field length. More...
 
BoundingBox getBoundingBoxInLabCoords () const override
 
- Public Member Functions inherited from BendBase
 BendBase ()
 
 BendBase (const BendBase &)
 
 BendBase (const std::string &)
 
virtual bool bends () const
 Indicates that element bends the beam. More...
 
double getChordLength () const
 
virtual void setBendAngle (double angle)
 
double getBendAngle () const
 
virtual void setEntranceAngle (double entranceAngle)
 
double getEntranceAngle () const
 
virtual double getExitAngle () const =0
 
void setFullGap (double)
 
double getFullGap () const
 
virtual void setDesignEnergy (const double &energy, bool changeable=true)
 
double getDesignEnergy () const
 
std::vector< Vector_tgetDesignPath () const
 
void setFieldAmplitude (double k0, double k0s)
 
double getFieldAmplitude () const
 
void setFieldMapFN (std::string fileName)
 
std::string getFieldMapFN () const
 
- Public Member Functions inherited from Component
 Component (const std::string &name)
 Constructor with given name. More...
 
 Component ()
 
 Component (const Component &right)
 
virtual ~Component ()
 
virtual EMFieldgetField ()=0
 Return field. More...
 
virtual const EMFieldgetField () const =0
 Return field. More...
 
EVector Efield (const Point3D &P) const
 Return the field in a point. More...
 
BVector Bfield (const Point3D &P) const
 Return the field in a point. More...
 
EVector Efield (const Point3D &P, double t) const
 Return the field in a point. More...
 
BVector Bfield (const Point3D &P, double t) const
 Return the field in a point. More...
 
EBVectors EBfield (const Point3D &P) const
 Return the field in a point. More...
 
EBVectors EBfield (const Point3D &P, double t) const
 Return the field in a point. More...
 
virtual bool apply (const size_t &i, const double &t, Vector_t &E, Vector_t &B)
 
virtual bool apply (const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B)
 
virtual bool applyToReferenceParticle (const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B)
 
virtual bool getPotential (const Vector_t &, const double &, Vector_t &, double &)
 
virtual double getDesignEnergy () const
 
virtual void setDesignEnergy (const double &energy, bool changeable=true)
 
virtual void initialise (PartBunchBase< double, 3 > *bunch, double &startField, double &endField)=0
 
virtual void finalise ()=0
 
virtual bool bends () const =0
 
virtual void goOnline (const double &kineticEnergy)
 
virtual void goOffline ()
 
virtual bool Online ()
 
virtual void getDimensions (double &zBegin, double &zEnd) const =0
 
virtual ElementType getType () const
 Get element type std::string. More...
 
virtual const ElementBasegetDesign () const
 Return design element. More...
 
virtual void trackBunch (PartBunchBase< double, 3 > *bunch, const PartData &, bool revBeam, bool revTrack) const
 Track particle bunch. More...
 
virtual void trackMap (FVps< double, 6 > &map, const PartData &, bool revBeam, bool revTrack) const
 Track a map. More...
 
void setExitFaceSlope (const double &)
 
- Public Member Functions inherited from ElementBase
 ElementBase (const std::string &name)
 Constructor with given name. More...
 
 ElementBase ()
 
 ElementBase (const ElementBase &)
 
virtual ~ElementBase ()
 
virtual const std::string & getName () const
 Get element name. More...
 
virtual void setName (const std::string &name)
 Set element name. More...
 
virtual ElementType getType () const =0
 Get element type std::string. More...
 
std::string getTypeString () const
 
virtual BGeometryBasegetGeometry ()=0
 Get geometry. More...
 
virtual const BGeometryBasegetGeometry () const =0
 Get geometry. More...
 
virtual double getArcLength () const
 Get arc length. More...
 
virtual double getElementLength () const
 Get design length. More...
 
virtual void setElementLength (double length)
 Set design length. More...
 
virtual void getElementDimensions (double &begin, double &end) const
 
virtual double getOrigin () const
 Get origin position. More...
 
virtual double getEntrance () const
 Get entrance position. More...
 
virtual double getExit () const
 Get exit position. More...
 
virtual Euclid3D getTransform (double fromS, double toS) const
 Get transform. More...
 
virtual Euclid3D getTransform (double s) const
 Get transform. More...
 
virtual Euclid3D getTotalTransform () const
 Get transform. More...
 
virtual Euclid3D getEntranceFrame () const
 Get transform. More...
 
virtual Euclid3D getExitFrame () const
 Get transform. More...
 
virtual Euclid3D getEntrancePatch () const
 Get patch. More...
 
virtual Euclid3D getExitPatch () const
 Get patch. More...
 
virtual double getAttribute (const std::string &aKey) const
 Get attribute value. More...
 
virtual bool hasAttribute (const std::string &aKey) const
 Test for existence of an attribute. More...
 
virtual void removeAttribute (const std::string &aKey)
 Remove an existing attribute. More...
 
virtual void setAttribute (const std::string &aKey, double val)
 Set value of an attribute. More...
 
virtual ChannelgetChannel (const std::string &aKey, bool create=false)
 Construct a read/write channel. More...
 
virtual const ConstChannelgetConstChannel (const std::string &aKey) const
 Construct a read-only channel. More...
 
virtual void accept (BeamlineVisitor &visitor) const =0
 Apply visitor. More...
 
virtual ElementBaseclone () const =0
 Return clone. More...
 
virtual ElementBasecopyStructure ()
 Make a structural copy. More...
 
bool isSharable () const
 Test if the element can be shared. More...
 
virtual void makeSharable ()
 Set sharable flag. More...
 
bool update (const AttributeSet &)
 Update element. More...
 
virtual void setBoundaryGeometry (BoundaryGeometry *geo)
 
virtual BoundaryGeometrygetBoundaryGeometry () const
 return the attached boundary geometrt object if there is any More...
 
virtual bool hasBoundaryGeometry () const
 
virtual void setWake (WakeFunction *wf)
 attach a wake field to the element More...
 
virtual WakeFunctiongetWake () const
 return the attached wake object if there is any More...
 
virtual bool hasWake () const
 
virtual void setParticleMatterInteraction (ParticleMatterInteractionHandler *spys)
 
virtual ParticleMatterInteractionHandlergetParticleMatterInteraction () const
 
virtual bool hasParticleMatterInteraction () const
 
void setCSTrafoGlobal2Local (const CoordinateSystemTrafo &ori)
 
CoordinateSystemTrafo getCSTrafoGlobal2Local () const
 
void releasePosition ()
 
void fixPosition ()
 
bool isPositioned () const
 
virtual CoordinateSystemTrafo getEdgeToBegin () const
 
virtual CoordinateSystemTrafo getEdgeToEnd () const
 
void setAperture (const ApertureType &type, const std::vector< double > &args)
 
std::pair< ApertureType, std::vector< double > > getAperture () const
 
virtual bool isInside (const Vector_t &r) const
 
void setMisalignment (const CoordinateSystemTrafo &cst)
 
void getMisalignment (double &x, double &y, double &s) const
 
CoordinateSystemTrafo getMisalignment () const
 
void setActionRange (const std::queue< std::pair< double, double > > &range)
 
void setCurrentSCoordinate (double s)
 
void setRotationAboutZ (double rotation)
 Set rotation about z axis in bend frame. More...
 
double getRotationAboutZ () const
 
virtual BoundingBox getBoundingBoxInLabCoords () const
 
virtual int getRequiredNumberOfTimeSteps () const
 
void setOutputFN (std::string fn)
 Set output filename. More...
 
std::string getOutputFN () const
 Get output filename. More...
 
void setFlagDeleteOnTransverseExit (bool=true)
 
bool getFlagDeleteOnTransverseExit () const
 
void setElementPosition (double elemedge)
 Access to ELEMEDGE attribute. More...
 
double getElementPosition () const
 
bool isElementPositionSet () const
 
- Public Member Functions inherited from RCObject
int addReference () const
 Increment reference count. More...
 
int removeReference () const
 Decrement the reference count. More...
 
bool isShared () const
 Test for sharing. More...
 

Protected Member Functions

void setMessageHeader (const std::string &header)
 
double getStartField () const
 
- Protected Member Functions inherited from BendBase
double calcDesignRadius (double fieldAmplitude) const
 Calculate design radius from design energy and field amplitude. More...
 
double calcFieldAmplitude (double radius) const
 Calculate field amplitude from design energy and radius. More...
 
double calcBendAngle (double chordLength, double radius) const
 Calculate bend angle from chord length and design radius. More...
 
double calcDesignRadius (double chordLength, double angle) const
 Calculate design radius from chord length and bend angle. More...
 
double calcGamma () const
 Calculate gamma from design energy. More...
 
double calcBetaGamma () const
 Calculate beta*gamma from design energy. More...
 
- Protected Member Functions inherited from ElementBase
bool isInsideTransverse (const Vector_t &r) const
 
- Protected Member Functions inherited from RCObject
 RCObject ()
 Default constructor. More...
 
 RCObject (const RCObject &)
 Copy constructor. More...
 
virtual ~RCObject ()=0
 
RCObjectoperator= (const RCObject &right)
 

Private Member Functions

void operator= (const Bend2D &)
 
void adjustFringeFields (double ratio)
 
double calculateBendAngle ()
 
void calcEngeFunction (double zNormalized, const std::vector< double > &engeCoeff, int polyOrder, double &engeFunc, double &engeFuncDeriv, double &engeFuncSecDerivNorm)
 
Vector_t calcCentralField (const Vector_t &R, double deltaX)
 
Vector_t calcEntranceFringeField (const Vector_t &R, double deltaX)
 
Vector_t calcExitFringeField (const Vector_t &R, double deltaX)
 
void setupFringeWidths ()
 
bool calculateMapField (const Vector_t &R, Vector_t &B)
 
void calculateRefTrajectory (double &angleX, double &angleY)
 
double estimateFieldAdjustmentStep (double actualBendAngle)
 
void findBendEffectiveLength (double startField, double endField)
 
void findBendStrength ()
 
virtual bool findChordLength (double &chordLength)=0
 
bool findIdealBendParameters (double chordLength)
 
bool initializeFieldMap ()
 
bool inMagnetCentralRegion (const Vector_t &R) const
 
bool inMagnetEntranceRegion (const Vector_t &R) const
 
bool inMagnetExitRegion (const Vector_t &R) const
 
bool isPositionInEntranceField (const Vector_t &R) const
 
bool isPositionInExitField (const Vector_t &R) const
 
void print (Inform &msg, double bendAngleX, double bendAngle)
 
void readFieldMap (Inform &msg)
 
void setBendEffectiveLength (double startField, double endField)
 
void setBendStrength ()
 
void setEngeOriginDelta (double delta)
 
void setFieldCalcParam ()
 
void setGapFromFieldMap ()
 
bool setupBendGeometry (double &startField, double &endField)
 
bool setupDefaultFieldMap ()
 
void setFieldBoundaries (double startField, double endField)
 
void setupPusher (PartBunchBase< double, 3 > *bunch)
 
bool isFieldZero ()
 
void setCSTrafoToEntranceRegion (const CoordinateSystemTrafo &trafo)
 
void setCSTrafoToExitRegion (const CoordinateSystemTrafo &trafo)
 
Vector_t transformToEntranceRegion (const Vector_t &R) const
 
Vector_t transformToExitRegion (const Vector_t &R) const
 

Private Attributes

std::string messageHeader_m
 
BorisPusher pusher_m
 
double designRadius_m
 through the bend. More...
 
double exitAngle_m
 Bend design radius (m). More...
 
double fieldIndex_m
 and the exit face of the magnet (radians). More...
 
double startField_m
 Dipole field index. More...
 
double endField_m
 Start of magnet field map in s coordinates (m). More...
 
double widthEntranceFringe_m
 End of magnet field map in s coordinates (m). More...
 
double widthExitFringe_m
 
bool reinitialize_m
 
double entranceParameter1_m
 
double entranceParameter2_m
 
double entranceParameter3_m
 
double exitParameter1_m
 
double exitParameter2_m
 
double exitParameter3_m
 
std::vector< double > engeCoeffsEntry_m
 Enge coefficients for map entry and exit regions. More...
 
std::vector< double > engeCoeffsExit_m
 
gsl_spline ** entryFieldValues_m
 
gsl_spline ** exitFieldValues_m
 
gsl_interp_accel * entryFieldAccel_m
 
gsl_interp_accel * exitFieldAccel_m
 
double deltaBeginEntry_m
 
double deltaEndEntry_m
 function origin where Enge function starts. More...
 
int polyOrderEntry_m
 function origin that Enge function ends. More...
 
double deltaBeginExit_m
 Enge function order for entry region. More...
 
double deltaEndExit_m
 function origin that Enge function starts. More...
 
int polyOrderExit_m
 function origin that Enge function ends. More...
 
double cosEntranceAngle_m
 Enge function order for entry region. More...
 
double sinEntranceAngle_m
 
double tanEntranceAngle_m
 
double tanExitAngle_m
 
CoordinateSystemTrafo beginToEnd_m
 
CoordinateSystemTrafo beginToEnd_lcs_m
 
CoordinateSystemTrafo toEntranceRegion_m
 
CoordinateSystemTrafo toExitRegion_m
 
CoordinateSystemTrafo computeAngleTrafo_m
 
double maxAngle_m
 
std::size_t nSlices_m
 

Additional Inherited Members

- Static Public Member Functions inherited from ElementBase
static std::string getTypeString (ElementType type)
 
- Protected Attributes inherited from BendBase
double chordLength_m
 
double angle_m
 Bend angle. More...
 
double entranceAngle_m
 
Fieldmapfieldmap_m
 Magnet field map. More...
 
const bool fast_m = false
 Flag to turn on fast field calculation. More...
 
double gap_m
 Full vertical gap of the magnets. More...
 
double designEnergy_m
 Bend design energy (eV). More...
 
bool designEnergyChangeable_m
 
std::vector< Vector_trefTrajMap_m
 Map of reference particle trajectory. More...
 
double fieldAmplitudeX_m
 
double fieldAmplitudeY_m
 
double fieldAmplitude_m
 Field amplitude. More...
 
std::string fileName_m
 
- Protected Attributes inherited from Component
double exit_face_slope_m
 
PartBunchBase< double, 3 > * RefPartBunch_m
 
bool online_m
 
- Protected Attributes inherited from ElementBase
bool shareFlag
 
CoordinateSystemTrafo csTrafoGlobal2Local_m
 
CoordinateSystemTrafo misalignment_m
 
std::pair< ApertureType, std::vector< double > > aperture_m
 
double elementEdge_m
 
double rotationZAxis_m
 
- Static Protected Attributes inherited from Component
static const std::vector< double > defaultAperture_m
 

Detailed Description

Definition at line 51 of file Bend2D.h.

Constructor & Destructor Documentation

◆ Bend2D() [1/3]

Bend2D::Bend2D ( const std::string &  name)
explicit

Constructor with given name.

Definition at line 88 of file Bend2D.cpp.

◆ Bend2D() [2/3]

Bend2D::Bend2D ( )

Definition at line 41 of file Bend2D.cpp.

◆ Bend2D() [3/3]

Bend2D::Bend2D ( const Bend2D right)

Definition at line 45 of file Bend2D.cpp.

◆ ~Bend2D()

Bend2D::~Bend2D ( )
virtual

Definition at line 124 of file Bend2D.cpp.

References entryFieldAccel_m, entryFieldValues_m, exitFieldAccel_m, and exitFieldValues_m.

Member Function Documentation

◆ accept()

virtual void Bend2D::accept ( BeamlineVisitor ) const
overridepure virtual

Apply visitor to Bend2D.

Implements ElementBase.

Implemented in RBend, and SBend.

◆ adjustFringeFields()

void Bend2D::adjustFringeFields ( double  ratio)
private

◆ apply() [1/2]

bool Bend2D::apply ( const size_t &  i,
const double &  t,
Vector_t E,
Vector_t B 
)
overridevirtual

Apply field to particles with coordinates in magnet frame.

Reimplemented from Component.

Definition at line 148 of file Bend2D.cpp.

References apply(), PartBunchBase< T, Dim >::R, and Component::RefPartBunch_m.

Referenced by apply(), and applyToReferenceParticle().

Here is the call graph for this function:

◆ apply() [2/2]

bool Bend2D::apply ( const Vector_t R,
const Vector_t P,
const double &  t,
Vector_t E,
Vector_t B 
)
overridevirtual

Apply field to particles in beam frame.

Reimplemented from Component.

Definition at line 156 of file Bend2D.cpp.

References calculateMapField(), designRadius_m, BendBase::fieldAmplitude_m, ElementBase::getFlagDeleteOnTransverseExit(), Attrib::Distribution::R, and X.

Here is the call graph for this function:

◆ applyToReferenceParticle()

bool Bend2D::applyToReferenceParticle ( const Vector_t R,
const Vector_t P,
const double &  t,
Vector_t E,
Vector_t B 
)
overridevirtual

Reimplemented from Component.

Definition at line 179 of file Bend2D.cpp.

References apply(), and Attrib::Distribution::R.

Here is the call graph for this function:

◆ calcCentralField()

Vector_t Bend2D::calcCentralField ( const Vector_t R,
double  deltaX 
)
private

Definition at line 355 of file Bend2D.cpp.

Referenced by calculateMapField().

◆ calcEngeFunction()

void Bend2D::calcEngeFunction ( double  zNormalized,
const std::vector< double > &  engeCoeff,
int  polyOrder,
double &  engeFunc,
double &  engeFuncDeriv,
double &  engeFuncSecDerivNorm 
)
private

Definition at line 290 of file Bend2D.cpp.

References exp(), BendBase::gap_m, matheval::detail::math::isinf(), matheval::detail::math::isnan(), and pow().

Referenced by readFieldMap().

Here is the call graph for this function:

◆ calcEntranceFringeField()

Vector_t Bend2D::calcEntranceFringeField ( const Vector_t R,
double  deltaX 
)
private

◆ calcExitFringeField()

Vector_t Bend2D::calcExitFringeField ( const Vector_t R,
double  deltaX 
)
private

◆ calculateBendAngle()

double Bend2D::calculateBendAngle ( )
private

◆ calculateMapField()

bool Bend2D::calculateMapField ( const Vector_t R,
Vector_t B 
)
private

◆ calculateRefTrajectory()

void Bend2D::calculateRefTrajectory ( double &  angleX,
double &  angleY 
)
private

◆ estimateFieldAdjustmentStep()

double Bend2D::estimateFieldAdjustmentStep ( double  actualBendAngle)
private

Definition at line 576 of file Bend2D.cpp.

References abs(), BendBase::angle_m, BendBase::calcFieldAmplitude(), designRadius_m, BendBase::fieldAmplitude_m, pow(), and sqrt().

Referenced by findBendStrength().

Here is the call graph for this function:

◆ finalise()

void Bend2D::finalise ( )
inlineoverridevirtual

Implements Component.

Definition at line 279 of file Bend2D.h.

References Component::online_m.

◆ findBendEffectiveLength()

void Bend2D::findBendEffectiveLength ( double  startField,
double  endField 
)
private

Definition at line 592 of file Bend2D.cpp.

References abs(), BendBase::angle_m, calculateBendAngle(), BendBase::gap_m, setEngeOriginDelta(), setFieldBoundaries(), and setFieldCalcParam().

Referenced by setBendEffectiveLength().

Here is the call graph for this function:

◆ findBendStrength()

void Bend2D::findBendStrength ( )
private

Definition at line 682 of file Bend2D.cpp.

References abs(), BendBase::angle_m, calculateBendAngle(), copysign(), Physics::e, estimateFieldAdjustmentStep(), BendBase::fieldAmplitude_m, and Units::rad2deg.

Referenced by setBendStrength().

Here is the call graph for this function:

◆ findChordLength()

virtual bool Bend2D::findChordLength ( double &  chordLength)
privatepure virtual

Implemented in RBend, and SBend.

Referenced by adjustFringeFields(), setEngeOriginDelta(), and setupBendGeometry().

◆ findIdealBendParameters()

bool Bend2D::findIdealBendParameters ( double  chordLength)
private

◆ getBeginToEnd_local()

CoordinateSystemTrafo Bend2D::getBeginToEnd_local ( ) const
inline

◆ getBendRadius()

double Bend2D::getBendRadius ( ) const
inline

Definition at line 290 of file Bend2D.h.

References designRadius_m.

Referenced by CSRIGFWakeFunction::initialize(), and CSRWakeFunction::initialize().

◆ getBoundingBoxInLabCoords()

BoundingBox Bend2D::getBoundingBoxInLabCoords ( ) const
overridevirtual

◆ getDimensions()

void Bend2D::getDimensions ( double &  sBegin,
double &  sEnd 
) const
inlineoverridevirtual

Implements Component.

Definition at line 284 of file Bend2D.h.

References endField_m, and startField_m.

Referenced by CSRIGFWakeFunction::initialize(), and CSRWakeFunction::initialize().

◆ getEdgeToEnd()

CoordinateSystemTrafo Bend2D::getEdgeToEnd ( ) const
inlineoverridevirtual

Reimplemented from ElementBase.

Definition at line 348 of file Bend2D.h.

References beginToEnd_m.

Referenced by getBoundingBoxInLabCoords().

◆ getEffectiveCenter()

double Bend2D::getEffectiveCenter ( ) const
inline

◆ getEffectiveLength()

double Bend2D::getEffectiveLength ( ) const
inline

Definition at line 300 of file Bend2D.h.

References BendBase::angle_m, and designRadius_m.

Referenced by CSRIGFWakeFunction::initialize(), and CSRWakeFunction::initialize().

◆ getEntranceFringeFieldLength()

std::array< double, 2 > Bend2D::getEntranceFringeFieldLength ( ) const

Get entrance fringe field length.

Definition at line 1647 of file Bend2D.cpp.

References entranceParameter1_m, entranceParameter2_m, entranceParameter3_m, BendBase::fieldmap_m, and Fieldmap::get1DProfile1EntranceParam().

Here is the call graph for this function:

◆ getExitAngle()

double Bend2D::getExitAngle ( ) const
inlineoverridevirtual

Implements BendBase.

Definition at line 326 of file Bend2D.h.

References exitAngle_m.

Referenced by OpalBeamline::save3DInput(), and ThickTracker::visitSBend().

◆ getExitFringeFieldLength()

std::array< double, 2 > Bend2D::getExitFringeFieldLength ( ) const

Get exit fringe field length.

Definition at line 1667 of file Bend2D.cpp.

References exitParameter1_m, exitParameter2_m, exitParameter3_m, BendBase::fieldmap_m, and Fieldmap::get1DProfile1ExitParam().

Here is the call graph for this function:

◆ getNSlices()

std::size_t Bend2D::getNSlices ( ) const

Definition at line 1641 of file Bend2D.cpp.

References nSlices_m.

Referenced by ThickTracker::visitSBend().

◆ getOutline()

std::vector< Vector_t > Bend2D::getOutline ( ) const

◆ getStartField()

double Bend2D::getStartField ( ) const
inlineprotected

Definition at line 320 of file Bend2D.h.

References startField_m.

◆ getSurfaceMesh()

MeshData Bend2D::getSurfaceMesh ( ) const

◆ getType()

virtual ElementType Bend2D::getType ( ) const
overridepure virtual

Get element type std::string.

Reimplemented from Component.

Implemented in RBend, and SBend.

Referenced by getSurfaceMesh(), and setupBendGeometry().

◆ goOnline()

void Bend2D::goOnline ( const double &  kineticEnergy)
overridevirtual

Reimplemented from Component.

Definition at line 187 of file Bend2D.cpp.

References Component::online_m.

◆ initialise()

void Bend2D::initialise ( PartBunchBase< double, 3 > *  bunch,
double &  startField,
double &  endField 
)
overridevirtual

◆ initializeFieldMap()

bool Bend2D::initializeFieldMap ( )
private

Definition at line 782 of file Bend2D.cpp.

References BendBase::fast_m, BendBase::fieldmap_m, BendBase::fileName_m, Fieldmap::getFieldmap(), and setupDefaultFieldMap().

Referenced by initialise().

Here is the call graph for this function:

◆ inMagnetCentralRegion()

bool Bend2D::inMagnetCentralRegion ( const Vector_t R) const
private

◆ inMagnetEntranceRegion()

bool Bend2D::inMagnetEntranceRegion ( const Vector_t R) const
private

Definition at line 815 of file Bend2D.cpp.

References abs(), ElementBase::aperture_m, entranceParameter1_m, and Attrib::Distribution::R.

Referenced by calculateMapField(), and isInside().

Here is the call graph for this function:

◆ inMagnetExitRegion()

bool Bend2D::inMagnetExitRegion ( const Vector_t R) const
private

Definition at line 822 of file Bend2D.cpp.

References abs(), ElementBase::aperture_m, exitParameter3_m, getBeginToEnd_local(), Attrib::Distribution::R, and CoordinateSystemTrafo::transformTo().

Referenced by calculateMapField(), and isInside().

Here is the call graph for this function:

◆ isFieldZero()

bool Bend2D::isFieldZero ( )
private

◆ isInside()

bool Bend2D::isInside ( const Vector_t r) const
overridevirtual

Reimplemented from ElementBase.

Definition at line 1615 of file Bend2D.cpp.

References abs(), BendBase::gap_m, inMagnetCentralRegion(), inMagnetEntranceRegion(), inMagnetExitRegion(), and Attrib::Distribution::R.

Here is the call graph for this function:

◆ isPositionInEntranceField()

bool Bend2D::isPositionInEntranceField ( const Vector_t R) const
private

◆ isPositionInExitField()

bool Bend2D::isPositionInExitField ( const Vector_t R) const
private

Definition at line 838 of file Bend2D.cpp.

References exitParameter1_m, exitParameter3_m, getBeginToEnd_local(), polyOrderExit_m, Attrib::Distribution::R, and CoordinateSystemTrafo::transformTo().

Referenced by calculateMapField().

Here is the call graph for this function:

◆ operator=()

void Bend2D::operator= ( const Bend2D )
private

◆ print()

void Bend2D::print ( Inform msg,
double  bendAngleX,
double  bendAngle 
)
private

◆ readFieldMap()

void Bend2D::readFieldMap ( Inform msg)
private

◆ setBendEffectiveLength()

void Bend2D::setBendEffectiveLength ( double  startField,
double  endField 
)
private

Definition at line 1026 of file Bend2D.cpp.

References abs(), BendBase::angle_m, calculateBendAngle(), and findBendEffectiveLength().

Referenced by setupBendGeometry().

Here is the call graph for this function:

◆ setBendStrength()

void Bend2D::setBendStrength ( )
private

Definition at line 1038 of file Bend2D.cpp.

References BendBase::calcFieldAmplitude(), designRadius_m, BendBase::fieldAmplitude_m, and findBendStrength().

Referenced by setupBendGeometry().

Here is the call graph for this function:

◆ setCSTrafoToEntranceRegion()

void Bend2D::setCSTrafoToEntranceRegion ( const CoordinateSystemTrafo trafo)
inlineprivate

Definition at line 360 of file Bend2D.h.

References toEntranceRegion_m.

◆ setCSTrafoToExitRegion()

void Bend2D::setCSTrafoToExitRegion ( const CoordinateSystemTrafo trafo)
inlineprivate

Definition at line 365 of file Bend2D.h.

References toExitRegion_m.

◆ setEngeOriginDelta()

void Bend2D::setEngeOriginDelta ( double  delta)
private

◆ setEntranceAngle()

void Bend2D::setEntranceAngle ( double  entranceAngle)
inlineoverridevirtual

Reimplemented from BendBase.

Reimplemented in RBend.

Definition at line 332 of file Bend2D.h.

References cos(), cosEntranceAngle_m, BendBase::entranceAngle_m, BendBase::setEntranceAngle(), sin(), sinEntranceAngle_m, tan(), and tanEntranceAngle_m.

Referenced by findIdealBendParameters(), RBend::setEntranceAngle(), setupBendGeometry(), and OpalSBend::update().

Here is the call graph for this function:

◆ setExitAngle()

void Bend2D::setExitAngle ( double  exitAngle)
inline

Definition at line 341 of file Bend2D.h.

References exitAngle_m, tan(), and tanExitAngle_m.

Referenced by findIdealBendParameters(), RBend::setBendAngle(), RBend::setEntranceAngle(), and OpalSBend::update().

Here is the call graph for this function:

◆ setFieldBoundaries()

void Bend2D::setFieldBoundaries ( double  startField,
double  endField 
)
private

Definition at line 1234 of file Bend2D.cpp.

References BendBase::angle_m, cos(), deltaBeginEntry_m, deltaEndExit_m, designRadius_m, endField_m, BendBase::entranceAngle_m, exitAngle_m, and startField_m.

Referenced by findBendEffectiveLength(), and setupBendGeometry().

Here is the call graph for this function:

◆ setFieldCalcParam()

void Bend2D::setFieldCalcParam ( )
private

◆ setGapFromFieldMap()

void Bend2D::setGapFromFieldMap ( )
private

Definition at line 1157 of file Bend2D.cpp.

References adjustFringeFields(), BendBase::fieldmap_m, BendBase::gap_m, and Fieldmap::getFieldGap().

Referenced by readFieldMap().

Here is the call graph for this function:

◆ setK1()

void Bend2D::setK1 ( double  k1)
inline

Set quadrupole field component.

Definition at line 305 of file Bend2D.h.

References abs(), and fieldIndex_m.

Referenced by OpalRBend::update(), and OpalSBend::update().

Here is the call graph for this function:

◆ setMessageHeader()

void Bend2D::setMessageHeader ( const std::string &  header)
inlineprotected

Definition at line 314 of file Bend2D.h.

References messageHeader_m.

Referenced by RBend::RBend(), and SBend::SBend().

◆ setNSlices()

void Bend2D::setNSlices ( const std::size_t &  nSlices)

Definition at line 1636 of file Bend2D.cpp.

References nSlices_m.

Referenced by OpalRBend::update(), and OpalSBend::update().

◆ setupBendGeometry()

bool Bend2D::setupBendGeometry ( double &  startField,
double &  endField 
)
private

◆ setupDefaultFieldMap()

bool Bend2D::setupDefaultFieldMap ( )
private

Definition at line 1218 of file Bend2D.cpp.

References endl(), ERRORMSG, and ElementBase::getElementLength().

Referenced by initializeFieldMap().

Here is the call graph for this function:

◆ setupFringeWidths()

void Bend2D::setupFringeWidths ( )
private

◆ setupPusher()

void Bend2D::setupPusher ( PartBunchBase< double, 3 > *  bunch)
private

Definition at line 1241 of file Bend2D.cpp.

References PartBunchBase< T, Dim >::getReference(), BorisPusher::initialise(), pusher_m, and Component::RefPartBunch_m.

Referenced by initialise().

Here is the call graph for this function:

◆ transformToEntranceRegion()

Vector_t Bend2D::transformToEntranceRegion ( const Vector_t R) const
inlineprivate

Definition at line 370 of file Bend2D.h.

References Attrib::Distribution::R, toEntranceRegion_m, and CoordinateSystemTrafo::transformTo().

Referenced by calculateMapField().

Here is the call graph for this function:

◆ transformToExitRegion()

Vector_t Bend2D::transformToExitRegion ( const Vector_t R) const
inlineprivate

Definition at line 375 of file Bend2D.h.

References Attrib::Distribution::R, toExitRegion_m, and CoordinateSystemTrafo::transformTo().

Referenced by calculateMapField().

Here is the call graph for this function:

Member Data Documentation

◆ beginToEnd_lcs_m

CoordinateSystemTrafo Bend2D::beginToEnd_lcs_m
private

Definition at line 267 of file Bend2D.h.

Referenced by getBeginToEnd_local(), and setFieldCalcParam().

◆ beginToEnd_m

CoordinateSystemTrafo Bend2D::beginToEnd_m
private

Definition at line 266 of file Bend2D.h.

Referenced by getEdgeToEnd(), and setFieldCalcParam().

◆ computeAngleTrafo_m

CoordinateSystemTrafo Bend2D::computeAngleTrafo_m
private

Definition at line 271 of file Bend2D.h.

Referenced by inMagnetCentralRegion(), and setFieldCalcParam().

◆ cosEntranceAngle_m

double Bend2D::cosEntranceAngle_m
private

◆ deltaBeginEntry_m

double Bend2D::deltaBeginEntry_m
private

◆ deltaBeginExit_m

double Bend2D::deltaBeginExit_m
private

Enge function order for entry region.

Definition at line 255 of file Bend2D.h.

Referenced by setFieldCalcParam().

◆ deltaEndEntry_m

double Bend2D::deltaEndEntry_m
private

function origin where Enge function starts.

Perpendicular distance from entrance Enge

Definition at line 251 of file Bend2D.h.

Referenced by setFieldCalcParam().

◆ deltaEndExit_m

double Bend2D::deltaEndExit_m
private

function origin that Enge function starts.

Perpendicular distance from exit Enge

Definition at line 257 of file Bend2D.h.

Referenced by setFieldBoundaries(), and setFieldCalcParam().

◆ designRadius_m

double Bend2D::designRadius_m
private

◆ endField_m

double Bend2D::endField_m
private

Start of magnet field map in s coordinates (m).

Definition at line 205 of file Bend2D.h.

Referenced by calculateBendAngle(), calculateRefTrajectory(), getDimensions(), initialise(), print(), setFieldBoundaries(), and setupBendGeometry().

◆ engeCoeffsEntry_m

std::vector<double> Bend2D::engeCoeffsEntry_m
private

Enge coefficients for map entry and exit regions.

Definition at line 237 of file Bend2D.h.

Referenced by print(), and readFieldMap().

◆ engeCoeffsExit_m

std::vector<double> Bend2D::engeCoeffsExit_m
private

Definition at line 238 of file Bend2D.h.

Referenced by print(), and readFieldMap().

◆ entranceParameter1_m

double Bend2D::entranceParameter1_m
private

◆ entranceParameter2_m

double Bend2D::entranceParameter2_m
private

◆ entranceParameter3_m

double Bend2D::entranceParameter3_m
private

◆ entryFieldAccel_m

gsl_interp_accel* Bend2D::entryFieldAccel_m
private

Definition at line 242 of file Bend2D.h.

Referenced by calcEntranceFringeField(), readFieldMap(), and ~Bend2D().

◆ entryFieldValues_m

gsl_spline** Bend2D::entryFieldValues_m
private

Definition at line 240 of file Bend2D.h.

Referenced by calcEntranceFringeField(), readFieldMap(), and ~Bend2D().

◆ exitAngle_m

double Bend2D::exitAngle_m
private

Bend design radius (m).

Definition at line 201 of file Bend2D.h.

Referenced by findIdealBendParameters(), getExitAngle(), getSurfaceMesh(), print(), setExitAngle(), setFieldBoundaries(), and setFieldCalcParam().

◆ exitFieldAccel_m

gsl_interp_accel* Bend2D::exitFieldAccel_m
private

Definition at line 243 of file Bend2D.h.

Referenced by calcExitFringeField(), readFieldMap(), and ~Bend2D().

◆ exitFieldValues_m

gsl_spline** Bend2D::exitFieldValues_m
private

Definition at line 241 of file Bend2D.h.

Referenced by calcExitFringeField(), readFieldMap(), and ~Bend2D().

◆ exitParameter1_m

double Bend2D::exitParameter1_m
private

◆ exitParameter2_m

double Bend2D::exitParameter2_m
private

◆ exitParameter3_m

double Bend2D::exitParameter3_m
private

◆ fieldIndex_m

double Bend2D::fieldIndex_m
private

and the exit face of the magnet (radians).

Angle between outgoing reference trajectory

Definition at line 203 of file Bend2D.h.

Referenced by print(), and setK1().

◆ maxAngle_m

double Bend2D::maxAngle_m
private

Definition at line 272 of file Bend2D.h.

Referenced by inMagnetCentralRegion(), and setFieldCalcParam().

◆ messageHeader_m

std::string Bend2D::messageHeader_m
private

Definition at line 194 of file Bend2D.h.

Referenced by initialise(), and setMessageHeader().

◆ nSlices_m

std::size_t Bend2D::nSlices_m
private

Definition at line 274 of file Bend2D.h.

Referenced by getNSlices(), and setNSlices().

◆ polyOrderEntry_m

int Bend2D::polyOrderEntry_m
private

function origin that Enge function ends.

Perpendicular distance from entrance Enge

Definition at line 253 of file Bend2D.h.

Referenced by isPositionInEntranceField(), print(), and readFieldMap().

◆ polyOrderExit_m

int Bend2D::polyOrderExit_m
private

function origin that Enge function ends.

Perpendicular distance from exit Enge

Definition at line 259 of file Bend2D.h.

Referenced by isPositionInExitField(), print(), and readFieldMap().

◆ pusher_m

BorisPusher Bend2D::pusher_m
private

Definition at line 196 of file Bend2D.h.

Referenced by calculateBendAngle(), calculateRefTrajectory(), and setupPusher().

◆ reinitialize_m

bool Bend2D::reinitialize_m
private

Definition at line 216 of file Bend2D.h.

Referenced by setupBendGeometry().

◆ sinEntranceAngle_m

double Bend2D::sinEntranceAngle_m
private

◆ startField_m

double Bend2D::startField_m
private

◆ tanEntranceAngle_m

double Bend2D::tanEntranceAngle_m
private

◆ tanExitAngle_m

double Bend2D::tanExitAngle_m
private

Definition at line 264 of file Bend2D.h.

Referenced by getOutline(), getSurfaceMesh(), and setExitAngle().

◆ toEntranceRegion_m

CoordinateSystemTrafo Bend2D::toEntranceRegion_m
private

◆ toExitRegion_m

CoordinateSystemTrafo Bend2D::toExitRegion_m
private

◆ widthEntranceFringe_m

double Bend2D::widthEntranceFringe_m
private

End of magnet field map in s coordinates (m).

Definition at line 207 of file Bend2D.h.

Referenced by getOutline(), and setupFringeWidths().

◆ widthExitFringe_m

double Bend2D::widthExitFringe_m
private

Definition at line 208 of file Bend2D.h.

Referenced by getOutline(), and setupFringeWidths().


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