OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
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 =0
 Apply visitor to Bend2D. More...
 
virtual void addKR (int i, double t, Vector_t &K)
 
virtual void addKT (int i, double t, Vector_t &K)
 
virtual bool apply (const size_t &i, const double &t, Vector_t &E, Vector_t &B)
 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)
 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)
 
virtual void goOnline (const double &kineticEnergy)
 
virtual void finalise ()
 
virtual void getDimensions (double &sBegin, double &sEnd) const
 
virtual ElementBase::ElementType getType () const =0
 Get element type std::string. More...
 
virtual void initialise (PartBunchBase< double, 3 > *bunch, double &startField, double &endField)
 
double getBendRadius () const
 
double getEffectiveCenter () const
 
double getEffectiveLength () const
 
double getStartElement () const
 
void setK1 (double k1)
 Set quadrupole field component. More...
 
void setExitAngle (double exitAngle)
 
virtual double getExitAngle () const
 
double getMapLength () const
 
std::vector< Vector_tgetOutline () const
 
MeshData getSurfaceMesh () const
 
virtual CoordinateSystemTrafo getEdgeToEnd () const
 
CoordinateSystemTrafo getBeginToEnd_local () const
 
virtual bool isInside (const Vector_t &r) const
 
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...
 
- 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...
 
void setLength (double length)
 
double getLength () const
 
double getChordLength () const
 
virtual void setBendAngle (double angle)
 
double getBendAngle () const
 
virtual void setEntranceAngle (double entranceAngle)
 
double getEntranceAngle () const
 
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 getPotential (const Vector_t &R, const double &t, Vector_t &A, double &phi)
 
virtual void goOffline ()
 
virtual bool Online ()
 
virtual void setComponentType (std::string)
 
virtual std::string getComponentType () const
 
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...
 
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 ElementImagegetImage () const
 Construct an image. 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...
 
virtual ElementBasemakeAlignWrapper ()
 Allow misalignment. More...
 
virtual ElementBasemakeFieldWrapper ()
 Allow field errors. More...
 
virtual ElementBasemakeWrappers ()
 Allow errors. More...
 
virtual ElementBaseremoveAlignWrapper ()
 Remove align wrapper. More...
 
virtual const ElementBaseremoveAlignWrapper () const
 Remove align wrapper. More...
 
virtual ElementBaseremoveFieldWrapper ()
 Remove field wrapper. More...
 
virtual const ElementBaseremoveFieldWrapper () const
 Remove field wrapper. More...
 
virtual ElementBaseremoveWrappers ()
 Return the design element. More...
 
virtual const ElementBaseremoveWrappers () const
 Return the design element. 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
ParticleMatterInteractionHandler
getParticleMatterInteraction () const
 
virtual bool hasParticleMatterInteraction () const
 
ElemType getElType () const
 returns element type as enumeration needed in the envelope tracker More...
 
void setElType (ElemType elt)
 set the element type as enumeration needed in the envelope tracker More...
 
void setCSTrafoGlobal2Local (const CoordinateSystemTrafo &ori)
 
CoordinateSystemTrafo getCSTrafoGlobal2Local () const
 
void releasePosition ()
 
void fixPosition ()
 
bool isPositioned () const
 
virtual CoordinateSystemTrafo getEdgeToBegin () const
 
void setAperture (const ApertureType &type, const std::vector< double > &args)
 
std::pair
< ElementBase::ApertureType,
std::vector< double > > 
getAperture () const
 
void setMisalignment (double x, double y, double s)
 
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
 
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
 
FieldmapgetFieldmap ()
 
- Protected Member Functions inherited from ElementBase
bool isInsideTransverse (const Vector_t &r, double f=1) 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, double mass, double betaGamma)
 
void findBendEffectiveLength (double startField, double endField)
 
void findBendStrength (double mass, double gamma, double betaGamma, double charge)
 
virtual bool findChordLength (Inform &msg, double &chordLength)=0
 
bool findIdealBendParameters (double chordLength)
 
bool initializeFieldMap (Inform &msg)
 
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 (Inform &msg, double &startField, double &endField)
 
bool setupDefaultFieldMap (Inform &msg)
 
void setFieldBoundaries (double startField, double endField)
 
void setupPusher (PartBunchBase< double, 3 > *bunch)
 
bool treatAsDrift (Inform &msg, double chordlength)
 
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
 
Fieldmapfieldmap_m
 through the bend. More...
 
const bool fast_m = false
 Magnet field map. More...
 
double designRadius_m
 Flag to turn on fast field calculation. 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

- Public Types inherited from ElementBase
enum  ApertureType { RECTANGULAR, ELLIPTICAL, CONIC_RECTANGULAR, CONIC_ELLIPTICAL }
 
enum  ElementType {
  ALIGNWRAPPER, BEAMBEAM, BEAMBEAM3D, BEAMLINE,
  BEAMSTRIPPING, CCOLLIMATOR, CORRECTOR, CORRECTORWRAPPER,
  CYCLOTRON, CYCLOTRONWRAPPER, CYCLOTRONVALLEY, DEGRADER,
  DIAGNOSTIC, DRIFT, FLEXIBLECOLLIMATOR, INTEGRATOR,
  LAMBERTSON, MARKER, MONITOR, MPSPLITINTEGRATOR,
  MULTIPOLE, MULTIPOLET, MULTIPOLEWRAPPER, OFFSET,
  PARALLELPLATE, PATCH, PROBE, RBEND,
  RBEND3D, RBENDWRAPPER, RFCAVITY, RFQUADRUPOLE,
  RING, SBEND3D, SBEND, SBENDWRAPPER,
  SEPARATOR, SEPTUM, SOLENOID, SOURCE,
  STRIPPER, TRAVELINGWAVE, VARIABLERFCAVITY, ANY
}
 
- Static Public Member Functions inherited from ElementBase
static std::string getTypeString (ElementType type)
 
- Protected Attributes inherited from BendBase
double length_m
 
double chordLength_m
 
double angle_m
 
double entranceAngle_m
 
double gap_m
 Angle between incoming reference trajectory. More...
 
double designEnergy_m
 
bool designEnergyChangeable_m
 Bend design energy (eV). More...
 
std::vector< Vector_trefTrajMap_m
 Map of reference particle trajectory. More...
 
double bX_m
 
double bY_m
 
double fieldAmplitude_m
 
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::Bend2D ( const std::string &  name)
explicit

Constructor with given name.

Definition at line 91 of file Bend2D.cpp.

References isDipole, and ElementBase::setElType().

Here is the call graph for this function:

Bend2D::Bend2D ( )

Definition at line 40 of file Bend2D.cpp.

Bend2D::Bend2D ( const Bend2D right)

Definition at line 44 of file Bend2D.cpp.

References isDipole, and ElementBase::setElType().

Here is the call graph for this function:

Bend2D::~Bend2D ( )
virtual

Definition at line 131 of file Bend2D.cpp.

References entryFieldAccel_m, entryFieldValues_m, exitFieldAccel_m, and exitFieldValues_m.

Member Function Documentation

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

Apply visitor to Bend2D.

Implements ElementBase.

Implemented in RBend, SBend, RBendWrapper, and SBendWrapper.

virtual void Bend2D::addKR ( int  i,
double  t,
Vector_t K 
)
inlinevirtual

Reimplemented from Component.

Reimplemented in RBend, and SBend.

Definition at line 68 of file Bend2D.h.

virtual void Bend2D::addKT ( int  i,
double  t,
Vector_t K 
)
inlinevirtual

Reimplemented from Component.

Reimplemented in RBend, and SBend.

Definition at line 69 of file Bend2D.h.

void Bend2D::adjustFringeFields ( double  ratio)
private
bool Bend2D::apply ( const size_t &  i,
const double &  t,
Vector_t E,
Vector_t B 
)
virtual

Apply field to particles with coordinates in magnet frame.

Reimplemented from Component.

Reimplemented in SectorFieldMapComponent.

Definition at line 155 of file Bend2D.cpp.

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

Referenced by applyToReferenceParticle().

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

Apply field to particles in beam frame.

Reimplemented from Component.

Reimplemented in SectorFieldMapComponent.

Definition at line 163 of file Bend2D.cpp.

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

Here is the call graph for this function:

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

Reimplemented from Component.

Definition at line 186 of file Bend2D.cpp.

References apply().

Here is the call graph for this function:

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

Definition at line 365 of file Bend2D.cpp.

Referenced by calculateMapField().

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

Definition at line 301 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:

Vector_t Bend2D::calcEntranceFringeField ( const Vector_t R,
double  deltaX 
)
private
Vector_t Bend2D::calcExitFringeField ( const Vector_t R,
double  deltaX 
)
private
double Bend2D::calculateBendAngle ( )
private
bool Bend2D::calculateMapField ( const Vector_t R,
Vector_t B 
)
private
void Bend2D::calculateRefTrajectory ( double &  angleX,
double &  angleY 
)
private
double Bend2D::estimateFieldAdjustmentStep ( double  actualBendAngle,
double  mass,
double  betaGamma 
)
private

Definition at line 587 of file Bend2D.cpp.

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

Referenced by findBendStrength().

Here is the call graph for this function:

void Bend2D::finalise ( )
inlinevirtual

Implements Component.

Reimplemented in SectorFieldMapComponent.

Definition at line 299 of file Bend2D.h.

References Component::online_m.

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

Definition at line 605 of file Bend2D.cpp.

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

Referenced by setBendEffectiveLength().

Here is the call graph for this function:

void Bend2D::findBendStrength ( double  mass,
double  gamma,
double  betaGamma,
double  charge 
)
private

Definition at line 695 of file Bend2D.cpp.

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

Referenced by setBendStrength().

Here is the call graph for this function:

virtual bool Bend2D::findChordLength ( Inform msg,
double &  chordLength 
)
privatepure virtual

Implemented in RBend, and SBend.

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

bool Bend2D::findIdealBendParameters ( double  chordLength)
private
CoordinateSystemTrafo Bend2D::getBeginToEnd_local ( ) const
inline
double Bend2D::getBendRadius ( ) const
inline

Definition at line 310 of file Bend2D.h.

References designRadius_m.

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

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

Implements Component.

Reimplemented in SectorFieldMapComponent.

Definition at line 304 of file Bend2D.h.

References endField_m, and startField_m.

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

CoordinateSystemTrafo Bend2D::getEdgeToEnd ( ) const
inlinevirtual

Reimplemented from ElementBase.

Definition at line 376 of file Bend2D.h.

References beginToEnd_m.

double Bend2D::getEffectiveCenter ( ) const
inline
double Bend2D::getEffectiveLength ( ) const
inline

Definition at line 320 of file Bend2D.h.

References BendBase::angle_m, and designRadius_m.

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

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

Get entrance fringe field length.

Definition at line 1695 of file Bend2D.cpp.

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

Here is the call graph for this function:

double Bend2D::getExitAngle ( ) const
inlinevirtual

Implements BendBase.

Definition at line 357 of file Bend2D.h.

References exitAngle_m.

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

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

Get exit fringe field length.

Definition at line 1715 of file Bend2D.cpp.

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

Here is the call graph for this function:

Fieldmap * Bend2D::getFieldmap ( )
inlineprotected

Definition at line 351 of file Bend2D.h.

References fieldmap_m.

Referenced by RBend::addKR(), and RBend::addKT().

double Bend2D::getMapLength ( ) const
inline

Definition at line 370 of file Bend2D.h.

References entranceParameter2_m, and exitParameter2_m.

std::size_t Bend2D::getNSlices ( ) const

Definition at line 1689 of file Bend2D.cpp.

References nSlices_m.

Referenced by ThickTracker::visitSBend().

std::vector< Vector_t > Bend2D::getOutline ( ) const
double Bend2D::getStartElement ( ) const
inline

Definition at line 325 of file Bend2D.h.

References ElementBase::elementEdge_m.

double Bend2D::getStartField ( ) const
inlineprotected

Definition at line 345 of file Bend2D.h.

References startField_m.

Referenced by RBend::addKR(), and RBend::addKT().

MeshData Bend2D::getSurfaceMesh ( ) const
virtual ElementBase::ElementType Bend2D::getType ( ) const
pure virtual

Get element type std::string.

Reimplemented from Component.

Implemented in RBend, SBend, RBendWrapper, and SBendWrapper.

Referenced by getSurfaceMesh(), and setupBendGeometry().

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

Reimplemented from Component.

Definition at line 194 of file Bend2D.cpp.

References Component::online_m.

void Bend2D::initialise ( PartBunchBase< double, 3 > *  bunch,
double &  startField,
double &  endField 
)
virtual
bool Bend2D::initializeFieldMap ( Inform msg)
private

Definition at line 818 of file Bend2D.cpp.

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

Referenced by initialise().

Here is the call graph for this function:

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

Definition at line 851 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:

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

Definition at line 858 of file Bend2D.cpp.

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

Referenced by calculateMapField(), and isInside().

Here is the call graph for this function:

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

Reimplemented from ElementBase.

Definition at line 1663 of file Bend2D.cpp.

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

Here is the call graph for this function:

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

Definition at line 874 of file Bend2D.cpp.

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

Referenced by calculateMapField().

Here is the call graph for this function:

void Bend2D::operator= ( const Bend2D )
private
void Bend2D::print ( Inform msg,
double  bendAngleX,
double  bendAngle 
)
private
void Bend2D::readFieldMap ( Inform msg)
private
void Bend2D::setBendEffectiveLength ( double  startField,
double  endField 
)
private

Definition at line 1062 of file Bend2D.cpp.

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

Referenced by setupBendGeometry().

Here is the call graph for this function:

void Bend2D::setBendStrength ( )
private
void Bend2D::setCSTrafoToEntranceRegion ( const CoordinateSystemTrafo trafo)
inlineprivate

Definition at line 388 of file Bend2D.h.

References toEntranceRegion_m.

void Bend2D::setCSTrafoToExitRegion ( const CoordinateSystemTrafo trafo)
inlineprivate

Definition at line 393 of file Bend2D.h.

References toExitRegion_m.

void Bend2D::setEngeOriginDelta ( double  delta)
private
void Bend2D::setExitAngle ( double  exitAngle)
inline

Definition at line 363 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:

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

Definition at line 1280 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:

void Bend2D::setFieldCalcParam ( )
private
void Bend2D::setGapFromFieldMap ( )
private

Definition at line 1204 of file Bend2D.cpp.

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

Referenced by readFieldMap().

Here is the call graph for this function:

void Bend2D::setK1 ( double  k1)
inline

Set quadrupole field component.

Definition at line 330 of file Bend2D.h.

References abs(), and fieldIndex_m.

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

Here is the call graph for this function:

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

Definition at line 339 of file Bend2D.h.

References messageHeader_m.

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

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

Definition at line 1684 of file Bend2D.cpp.

References nSlices_m.

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

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

Definition at line 1264 of file Bend2D.cpp.

References endl(), ERRORMSG, and BendBase::length_m.

Referenced by initializeFieldMap().

Here is the call graph for this function:

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

Definition at line 1288 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:

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

Definition at line 398 of file Bend2D.h.

References toEntranceRegion_m, and CoordinateSystemTrafo::transformTo().

Referenced by calculateMapField().

Here is the call graph for this function:

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

Definition at line 403 of file Bend2D.h.

References toExitRegion_m, and CoordinateSystemTrafo::transformTo().

Referenced by calculateMapField().

Here is the call graph for this function:

bool Bend2D::treatAsDrift ( Inform msg,
double  chordlength 
)
private

Member Data Documentation

CoordinateSystemTrafo Bend2D::beginToEnd_lcs_m
private

Definition at line 287 of file Bend2D.h.

Referenced by getBeginToEnd_local(), and setFieldCalcParam().

CoordinateSystemTrafo Bend2D::beginToEnd_m
private

Definition at line 286 of file Bend2D.h.

Referenced by getEdgeToEnd(), and setFieldCalcParam().

CoordinateSystemTrafo Bend2D::computeAngleTrafo_m
private

Definition at line 291 of file Bend2D.h.

Referenced by inMagnetCentralRegion(), and setFieldCalcParam().

double Bend2D::cosEntranceAngle_m
private

Enge function order for entry region.

Definition at line 281 of file Bend2D.h.

Referenced by calculateMapField(), getOutline(), getSurfaceMesh(), inMagnetCentralRegion(), and setFieldCalcParam().

double Bend2D::deltaBeginEntry_m
private
double Bend2D::deltaBeginExit_m
private

Enge function order for entry region.

Definition at line 275 of file Bend2D.h.

Referenced by setFieldCalcParam().

double Bend2D::deltaEndEntry_m
private

function origin where Enge function starts.

Perpendicular distance from entrance Enge

Definition at line 271 of file Bend2D.h.

Referenced by setFieldCalcParam().

double Bend2D::deltaEndExit_m
private

function origin that Enge function starts.

Perpendicular distance from exit Enge

Definition at line 277 of file Bend2D.h.

Referenced by setFieldBoundaries(), and setFieldCalcParam().

double Bend2D::designRadius_m
private
double Bend2D::endField_m
private

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

Definition at line 225 of file Bend2D.h.

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

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

Enge coefficients for map entry and exit regions.

Definition at line 257 of file Bend2D.h.

Referenced by print(), and readFieldMap().

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

Definition at line 258 of file Bend2D.h.

Referenced by print(), and readFieldMap().

double Bend2D::entranceParameter1_m
private
double Bend2D::entranceParameter2_m
private
double Bend2D::entranceParameter3_m
private
gsl_interp_accel* Bend2D::entryFieldAccel_m
private

Definition at line 262 of file Bend2D.h.

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

gsl_spline** Bend2D::entryFieldValues_m
private

Definition at line 260 of file Bend2D.h.

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

double Bend2D::exitAngle_m
private

Bend design radius (m).

and the entrance face of the magnet (radians).

Definition at line 221 of file Bend2D.h.

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

gsl_interp_accel* Bend2D::exitFieldAccel_m
private

Definition at line 263 of file Bend2D.h.

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

gsl_spline** Bend2D::exitFieldValues_m
private

Definition at line 261 of file Bend2D.h.

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

double Bend2D::exitParameter1_m
private
double Bend2D::exitParameter2_m
private
double Bend2D::exitParameter3_m
private
const bool Bend2D::fast_m = false
private

Magnet field map.

Definition at line 216 of file Bend2D.h.

Referenced by initializeFieldMap().

double Bend2D::fieldIndex_m
private

and the exit face of the magnet (radians).

Angle between outgoing reference trajectory

Definition at line 223 of file Bend2D.h.

Referenced by print(), and setK1().

Fieldmap* Bend2D::fieldmap_m
private

through the bend.

Pusher used to integrate reference particle

Definition at line 215 of file Bend2D.h.

Referenced by getEntranceFringeFieldLength(), getExitFringeFieldLength(), getFieldmap(), initializeFieldMap(), readFieldMap(), and setGapFromFieldMap().

double Bend2D::maxAngle_m
private

Definition at line 292 of file Bend2D.h.

Referenced by inMagnetCentralRegion(), and setFieldCalcParam().

std::string Bend2D::messageHeader_m
private

Definition at line 210 of file Bend2D.h.

Referenced by initialise(), and setMessageHeader().

std::size_t Bend2D::nSlices_m
private

Definition at line 294 of file Bend2D.h.

Referenced by getNSlices(), and setNSlices().

int Bend2D::polyOrderEntry_m
private

function origin that Enge function ends.

Perpendicular distance from entrance Enge

Definition at line 273 of file Bend2D.h.

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

int Bend2D::polyOrderExit_m
private

function origin that Enge function ends.

Perpendicular distance from exit Enge

Definition at line 279 of file Bend2D.h.

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

BorisPusher Bend2D::pusher_m
private

Definition at line 212 of file Bend2D.h.

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

bool Bend2D::reinitialize_m
private

Definition at line 236 of file Bend2D.h.

Referenced by setupBendGeometry().

double Bend2D::sinEntranceAngle_m
private
double Bend2D::startField_m
private
double Bend2D::tanEntranceAngle_m
private

Definition at line 283 of file Bend2D.h.

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

double Bend2D::tanExitAngle_m
private

Definition at line 284 of file Bend2D.h.

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

CoordinateSystemTrafo Bend2D::toEntranceRegion_m
private
CoordinateSystemTrafo Bend2D::toExitRegion_m
private
double Bend2D::widthEntranceFringe_m
private

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

Definition at line 227 of file Bend2D.h.

Referenced by getOutline(), and setupFringeWidths().

double Bend2D::widthExitFringe_m
private

Definition at line 228 of file Bend2D.h.

Referenced by getOutline(), and setupFringeWidths().


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