OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <Bend2D.h>
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 ElementBase::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_t > | getOutline () 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 |
double | getEntranceAngle () const |
void | setFullGap (double) |
double | getFullGap () const |
virtual void | setDesignEnergy (const double &energy, bool changeable=true) |
double | getDesignEnergy () const |
std::vector< Vector_t > | getDesignPath () 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 EMField & | getField ()=0 |
Return field. More... | |
virtual const EMField & | getField () 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 &, const double &, Vector_t &, double &) |
virtual void | goOffline () |
virtual bool | Online () |
virtual void | setComponentType (std::string) |
virtual std::string | getComponentType () const |
virtual const ElementBase & | getDesign () 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 BGeometryBase & | getGeometry ()=0 |
Get geometry. More... | |
virtual const BGeometryBase & | getGeometry () 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 Channel * | getChannel (const std::string &aKey, bool create=false) |
Construct a read/write channel. More... | |
virtual const ConstChannel * | getConstChannel (const std::string &aKey) const |
Construct a read-only channel. More... | |
virtual ElementBase * | clone () const =0 |
Return clone. More... | |
virtual ElementBase * | copyStructure () |
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 BoundaryGeometry * | getBoundaryGeometry () 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 WakeFunction * | getWake () 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 |
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 (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 int | getRequiredNumberOfTimeSteps () const |
void | setOutputFN (std::string fn) |
Set output filename. More... | |
std::string | getOutputFN () const |
Get output filename. More... | |
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 |
RCObject & | operator= (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 | |
Public Types inherited from ElementBase | |
enum | ApertureType { RECTANGULAR , ELLIPTICAL , CONIC_RECTANGULAR , CONIC_ELLIPTICAL } |
enum | ElementType { BEAMLINE , CCOLLIMATOR , CORRECTOR , CYCLOTRON , DEGRADER , DRIFT , FLEXIBLECOLLIMATOR , MARKER , MONITOR , MPSPLITINTEGRATOR , MULTIPOLE , MULTIPOLET , OFFSET , PROBE , RBEND , RBEND3D , RFCAVITY , RING , SBEND3D , SBEND , SEPTUM , SOLENOID , SOURCE , STRIPPER , TRAVELINGWAVE , UNDULATOR , VACUUM , VARIABLERFCAVITY , ANY } |
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 |
Fieldmap * | fieldmap_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_t > | refTrajMap_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 |
|
explicit |
Constructor with given name.
Definition at line 87 of file Bend2D.cpp.
Bend2D::Bend2D | ( | ) |
Definition at line 40 of file Bend2D.cpp.
Bend2D::Bend2D | ( | const Bend2D & | right | ) |
Definition at line 44 of file Bend2D.cpp.
|
virtual |
Definition at line 123 of file Bend2D.cpp.
References entryFieldAccel_m, entryFieldValues_m, exitFieldAccel_m, and exitFieldValues_m.
|
overridepure virtual |
|
private |
Definition at line 233 of file Bend2D.cpp.
References abs(), BendBase::chordLength_m, entranceParameter1_m, entranceParameter2_m, entranceParameter3_m, exitParameter1_m, exitParameter2_m, exitParameter3_m, findChordLength(), and setupFringeWidths().
Referenced by setGapFromFieldMap().
|
overridevirtual |
Apply field to particles with coordinates in magnet frame.
Reimplemented from Component.
Definition at line 147 of file Bend2D.cpp.
References PartBunchBase< T, Dim >::R, and Component::RefPartBunch_m.
Referenced by applyToReferenceParticle().
|
overridevirtual |
Apply field to particles in beam frame.
Reimplemented from Component.
Definition at line 155 of file Bend2D.cpp.
References calculateMapField(), designRadius_m, BendBase::fieldAmplitude_m, Attrib::Distribution::R, and X.
|
overridevirtual |
Reimplemented from Component.
Definition at line 178 of file Bend2D.cpp.
References apply(), and Attrib::Distribution::R.
Definition at line 355 of file Bend2D.cpp.
Referenced by calculateMapField().
|
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().
Definition at line 373 of file Bend2D.cpp.
References entranceParameter1_m, entranceParameter2_m, entranceParameter3_m, entryFieldAccel_m, entryFieldValues_m, pow(), Attrib::Distribution::R, CoordinateSystemTrafo::rotateFrom(), and CoordinateSystemTrafo::transformTo().
Referenced by calculateMapField().
Definition at line 410 of file Bend2D.cpp.
References exitFieldAccel_m, exitFieldValues_m, exitParameter1_m, exitParameter2_m, exitParameter3_m, getBeginToEnd_local(), pow(), Attrib::Distribution::R, CoordinateSystemTrafo::rotateFrom(), and CoordinateSystemTrafo::transformTo().
Referenced by calculateMapField().
|
private |
Definition at line 251 of file Bend2D.cpp.
References atan2(), Physics::c, BendBase::calcBetaGamma(), calculateMapField(), cosEntranceAngle_m, deltaBeginEntry_m, endField_m, BendBase::entranceAngle_m, euclidean_norm(), BendBase::fieldAmplitude_m, PartBunchBase< T, Dim >::getdT(), BorisPusher::kick(), BorisPusher::push(), pusher_m, Component::RefPartBunch_m, sinEntranceAngle_m, startField_m, tanEntranceAngle_m, and X.
Referenced by findBendEffectiveLength(), findBendStrength(), and setBendEffectiveLength().
Definition at line 446 of file Bend2D.cpp.
References abs(), calcCentralField(), calcEntranceFringeField(), calcExitFringeField(), cosEntranceAngle_m, designRadius_m, BendBase::gap_m, getBeginToEnd_local(), inMagnetCentralRegion(), inMagnetEntranceRegion(), inMagnetExitRegion(), isPositionInEntranceField(), isPositionInExitField(), Attrib::Distribution::R, sinEntranceAngle_m, CoordinateSystemTrafo::transformTo(), transformToEntranceRegion(), and transformToExitRegion().
Referenced by apply(), calculateBendAngle(), and calculateRefTrajectory().
|
private |
Definition at line 509 of file Bend2D.cpp.
References atan2(), Physics::c, BendBase::calcBetaGamma(), BendBase::calcGamma(), calculateMapField(), Util::combineFilePath(), cosEntranceAngle_m, deltaBeginEntry_m, endField_m, endl(), BendBase::entranceAngle_m, BendBase::fieldAmplitude_m, OpalData::getAuxiliaryOutputDirectory(), PartBunchBase< T, Dim >::getdT(), OpalData::getInputBasename(), OpalData::getInstance(), ElementBase::getName(), BorisPusher::kick(), IpplInfo::myNode(), BorisPusher::push(), pusher_m, Component::RefPartBunch_m, BendBase::refTrajMap_m, sinEntranceAngle_m, startField_m, tanEntranceAngle_m, Options::writeBendTrajectories, and X.
Referenced by initialise().
|
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().
|
inlineoverridevirtual |
|
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().
|
private |
Definition at line 682 of file Bend2D.cpp.
References abs(), BendBase::angle_m, calculateBendAngle(), copysign(), Physics::e, estimateFieldAdjustmentStep(), BendBase::fieldAmplitude_m, and Physics::rad2deg.
Referenced by setBendStrength().
|
privatepure virtual |
Implemented in SBend, and RBend.
Referenced by adjustFringeFields(), setEngeOriginDelta(), and setupBendGeometry().
|
private |
Definition at line 750 of file Bend2D.cpp.
References abs(), BendBase::angle_m, atan2(), BendBase::calcBendAngle(), BendBase::calcDesignRadius(), BendBase::calcFieldAmplitude(), copysign(), designRadius_m, BendBase::entranceAngle_m, exitAngle_m, BendBase::fieldAmplitude_m, BendBase::fieldAmplitudeX_m, BendBase::fieldAmplitudeY_m, PartBunchBase< T, Dim >::getQ(), Physics::pi, Component::RefPartBunch_m, ElementBase::rotationZAxis_m, setEntranceAngle(), and setExitAngle().
Referenced by setupBendGeometry().
|
inline |
Definition at line 354 of file Bend2D.h.
References beginToEnd_lcs_m.
Referenced by calcExitFringeField(), calculateMapField(), getOutline(), getSurfaceMesh(), inMagnetCentralRegion(), inMagnetExitRegion(), isPositionInExitField(), OpalBeamline::save3DLattice(), and setFieldCalcParam().
|
inline |
Definition at line 290 of file Bend2D.h.
References designRadius_m.
Referenced by CSRIGFWakeFunction::initialize(), and CSRWakeFunction::initialize().
|
overridevirtual |
Reimplemented from ElementBase.
Definition at line 1685 of file Bend2D.cpp.
References ElementBase::csTrafoGlobal2Local_m, ElementBase::getEdgeToBegin(), getEdgeToEnd(), BendBase::getFullGap(), getOutline(), ElementBase::BoundingBox::lowerLeftCorner, max(), CoordinateSystemTrafo::transformFrom(), and ElementBase::BoundingBox::upperRightCorner.
|
inlineoverridevirtual |
Implements Component.
Definition at line 284 of file Bend2D.h.
References endField_m, and startField_m.
Referenced by CSRIGFWakeFunction::initialize(), and CSRWakeFunction::initialize().
|
inlineoverridevirtual |
Reimplemented from ElementBase.
Definition at line 348 of file Bend2D.h.
References beginToEnd_m.
Referenced by getBoundingBoxInLabCoords().
|
inline |
Definition at line 295 of file Bend2D.h.
References BendBase::angle_m, designRadius_m, and ElementBase::elementEdge_m.
Referenced by CSRIGFWakeFunction::initialize(), and CSRWakeFunction::initialize().
|
inline |
Definition at line 300 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 1647 of file Bend2D.cpp.
References entranceParameter1_m, entranceParameter2_m, entranceParameter3_m, BendBase::fieldmap_m, and Fieldmap::get1DProfile1EntranceParam().
|
inlineoverridevirtual |
Implements BendBase.
Definition at line 326 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 1667 of file Bend2D.cpp.
References exitParameter1_m, exitParameter2_m, exitParameter3_m, BendBase::fieldmap_m, and Fieldmap::get1DProfile1ExitParam().
std::size_t Bend2D::getNSlices | ( | ) | const |
Definition at line 1641 of file Bend2D.cpp.
References nSlices_m.
Referenced by ThickTracker::visitSBend().
std::vector< Vector_t > Bend2D::getOutline | ( | ) | const |
Definition at line 1280 of file Bend2D.cpp.
References a, abs(), ElementBase::aperture_m, atan2(), ceil(), Util::combineFilePath(), cos(), cosEntranceAngle_m, Physics::deg2rad, designRadius_m, dot(), endl(), entranceParameter1_m, exitParameter3_m, fmod(), OpalData::getAuxiliaryOutputDirectory(), getBeginToEnd_local(), OpalData::getInputBasename(), OpalData::getInstance(), ElementBase::getName(), getQuaternion(), max(), IpplInfo::myNode(), pow(), Attrib::Distribution::R, Quaternion::rotate(), sin(), sinEntranceAngle_m, tanEntranceAngle_m, tanExitAngle_m, CoordinateSystemTrafo::transformFrom(), CoordinateSystemTrafo::transformTo(), Physics::two_pi, widthEntranceFringe_m, widthExitFringe_m, and Options::writeBendTrajectories.
Referenced by getBoundingBoxInLabCoords(), and getSurfaceMesh().
|
inlineprotected |
Definition at line 320 of file Bend2D.h.
References startField_m.
MeshData Bend2D::getSurfaceMesh | ( | ) | const |
Definition at line 1387 of file Bend2D.cpp.
References abs(), BendBase::angle_m, ElementBase::aperture_m, asin(), cos(), cosEntranceAngle_m, cross(), MeshData::decorations_m, designRadius_m, det(), dot(), Physics::e, BendBase::entranceAngle_m, entranceParameter1_m, entranceParameter3_m, euclidean_norm(), exitAngle_m, exitParameter1_m, exitParameter3_m, getBeginToEnd_local(), BendBase::getFullGap(), getOutline(), getType(), pow(), Attrib::Distribution::R, ElementBase::RBEND, Quaternion::rotate(), CoordinateSystemTrafo::rotateFrom(), sin(), sinEntranceAngle_m, Attrib::Legacy::Distribution::T, tanEntranceAngle_m, tanExitAngle_m, toEntranceRegion_m, toExitRegion_m, CoordinateSystemTrafo::transformFrom(), CoordinateSystemTrafo::transformTo(), MeshData::triangles_m, and MeshData::vertices_m.
Referenced by MeshGenerator::add().
|
overridepure virtual |
Get element type std::string.
Reimplemented from Component.
Implemented in SBend, and RBend.
Referenced by getSurfaceMesh(), and setupBendGeometry().
|
overridevirtual |
Reimplemented from Component.
Definition at line 186 of file Bend2D.cpp.
References Component::online_m.
|
overridevirtual |
Implements Component.
Definition at line 190 of file Bend2D.cpp.
References calculateRefTrajectory(), ElementBase::elementEdge_m, endField_m, endl(), ERRORMSG, BendBase::fileName_m, ElementBase::getName(), gmsg, initializeFieldMap(), level2(), messageHeader_m, name, print(), readFieldMap(), ElementBase::setElementLength(), setupBendGeometry(), setupFringeWidths(), setupPusher(), startField_m, and Util::toUpper().
|
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().
|
private |
Definition at line 797 of file Bend2D.cpp.
References abs(), ElementBase::aperture_m, atan2(), computeAngleTrafo_m, cosEntranceAngle_m, designRadius_m, euclidean_norm(), fmod(), getBeginToEnd_local(), maxAngle_m, Attrib::Distribution::R, sinEntranceAngle_m, CoordinateSystemTrafo::transformTo(), and Physics::two_pi.
Referenced by calculateMapField(), and isInside().
|
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().
|
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().
|
private |
Definition at line 1248 of file Bend2D.cpp.
References abs(), BendBase::angle_m, BendBase::calcDesignRadius(), BendBase::chordLength_m, BendBase::designEnergy_m, designRadius_m, endl(), BendBase::fieldAmplitude_m, BendBase::fieldAmplitudeX_m, BendBase::fieldAmplitudeY_m, pow(), and WARNMSG.
Referenced by setupBendGeometry().
|
overridevirtual |
Reimplemented from ElementBase.
Definition at line 1615 of file Bend2D.cpp.
References abs(), BendBase::gap_m, inMagnetCentralRegion(), inMagnetEntranceRegion(), inMagnetExitRegion(), and Attrib::Distribution::R.
|
private |
Definition at line 831 of file Bend2D.cpp.
References entranceParameter1_m, entranceParameter3_m, polyOrderEntry_m, and Attrib::Distribution::R.
Referenced by calculateMapField().
|
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().
|
private |
|
private |
Definition at line 846 of file Bend2D.cpp.
References BendBase::angle_m, BendBase::designEnergy_m, designRadius_m, ElementBase::elementEdge_m, endField_m, endl(), engeCoeffsEntry_m, engeCoeffsExit_m, BendBase::entranceAngle_m, entranceParameter1_m, entranceParameter2_m, entranceParameter3_m, exitAngle_m, exitParameter1_m, exitParameter2_m, exitParameter3_m, BendBase::fieldAmplitude_m, fieldIndex_m, BendBase::fileName_m, BendBase::gap_m, level2(), polyOrderEntry_m, polyOrderExit_m, Physics::rad2deg, ElementBase::rotationZAxis_m, and startField_m.
Referenced by initialise().
|
private |
Definition at line 946 of file Bend2D.cpp.
References abs(), Physics::c, calcEngeFunction(), ceil(), Physics::e, engeCoeffsEntry_m, engeCoeffsExit_m, entranceParameter1_m, entranceParameter2_m, entranceParameter3_m, entryFieldAccel_m, entryFieldValues_m, exitFieldAccel_m, exitFieldValues_m, exitParameter1_m, exitParameter2_m, exitParameter3_m, BendBase::fieldmap_m, BendBase::fileName_m, BendBase::gap_m, Fieldmap::get1DProfile1EngeCoeffs(), Fieldmap::get1DProfile1EntranceParam(), Fieldmap::get1DProfile1ExitParam(), Fieldmap::getInfo(), ElementBase::getName(), level2(), polyOrderEntry_m, polyOrderExit_m, Fieldmap::readMap(), and setGapFromFieldMap().
Referenced by initialise().
|
private |
Definition at line 1026 of file Bend2D.cpp.
References abs(), BendBase::angle_m, calculateBendAngle(), and findBendEffectiveLength().
Referenced by setupBendGeometry().
|
private |
Definition at line 1038 of file Bend2D.cpp.
References BendBase::calcFieldAmplitude(), designRadius_m, BendBase::fieldAmplitude_m, and findBendStrength().
Referenced by setupBendGeometry().
|
inlineprivate |
Definition at line 360 of file Bend2D.h.
References toEntranceRegion_m.
|
inlineprivate |
Definition at line 365 of file Bend2D.h.
References toExitRegion_m.
|
private |
Definition at line 1047 of file Bend2D.cpp.
References abs(), BendBase::chordLength_m, entranceParameter1_m, entranceParameter2_m, entranceParameter3_m, exitParameter1_m, exitParameter2_m, exitParameter3_m, findChordLength(), and setupFringeWidths().
Referenced by findBendEffectiveLength().
|
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().
|
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().
|
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().
|
private |
Definition at line 1069 of file Bend2D.cpp.
References abs(), ElementBase::aperture_m, atan2(), beginToEnd_lcs_m, beginToEnd_m, computeAngleTrafo_m, Quaternion::conjugate(), cos(), cosEntranceAngle_m, deltaBeginEntry_m, deltaBeginExit_m, deltaEndEntry_m, deltaEndExit_m, designRadius_m, dot(), entranceParameter1_m, entranceParameter2_m, entranceParameter3_m, exitAngle_m, exitParameter1_m, exitParameter2_m, exitParameter3_m, fmod(), getBeginToEnd_local(), BendBase::getBendAngle(), BendBase::getChordLength(), BendBase::getEntranceAngle(), getQuaternion(), ElementBase::getRotationAboutZ(), maxAngle_m, pow(), Attrib::Distribution::R, Quaternion::rotate(), sin(), sinEntranceAngle_m, toEntranceRegion_m, toExitRegion_m, CoordinateSystemTrafo::transformFrom(), CoordinateSystemTrafo::transformTo(), and Physics::two_pi.
Referenced by findBendEffectiveLength(), and setupBendGeometry().
|
private |
Definition at line 1157 of file Bend2D.cpp.
References adjustFringeFields(), BendBase::fieldmap_m, BendBase::gap_m, and Fieldmap::getFieldGap().
Referenced by readFieldMap().
|
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().
|
inlineprotected |
Definition at line 314 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 1636 of file Bend2D.cpp.
References nSlices_m.
Referenced by OpalRBend::update(), and OpalSBend::update().
|
private |
Definition at line 1166 of file Bend2D.cpp.
References ElementBase::aperture_m, BendBase::chordLength_m, designRadius_m, ElementBase::elementEdge_m, endField_m, BendBase::fileName_m, findChordLength(), findIdealBendParameters(), BendBase::getEntranceAngle(), getType(), isFieldZero(), ElementBase::RBEND, reinitialize_m, setBendEffectiveLength(), setBendStrength(), setEntranceAngle(), setFieldBoundaries(), setFieldCalcParam(), and startField_m.
Referenced by initialise().
|
private |
Definition at line 1218 of file Bend2D.cpp.
References endl(), ERRORMSG, and ElementBase::getElementLength().
Referenced by initializeFieldMap().
|
private |
Definition at line 1629 of file Bend2D.cpp.
References ElementBase::aperture_m, entranceParameter1_m, entranceParameter3_m, exitParameter1_m, exitParameter3_m, min(), widthEntranceFringe_m, and widthExitFringe_m.
Referenced by adjustFringeFields(), initialise(), and setEngeOriginDelta().
|
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().
Definition at line 370 of file Bend2D.h.
References Attrib::Distribution::R, toEntranceRegion_m, and CoordinateSystemTrafo::transformTo().
Referenced by calculateMapField().
Definition at line 375 of file Bend2D.h.
References Attrib::Distribution::R, toExitRegion_m, and CoordinateSystemTrafo::transformTo().
Referenced by calculateMapField().
|
private |
Definition at line 267 of file Bend2D.h.
Referenced by getBeginToEnd_local(), and setFieldCalcParam().
|
private |
Definition at line 266 of file Bend2D.h.
Referenced by getEdgeToEnd(), and setFieldCalcParam().
|
private |
Definition at line 271 of file Bend2D.h.
Referenced by inMagnetCentralRegion(), and setFieldCalcParam().
|
private |
Enge function order for entry region.
Definition at line 261 of file Bend2D.h.
Referenced by calculateBendAngle(), calculateMapField(), calculateRefTrajectory(), getOutline(), getSurfaceMesh(), inMagnetCentralRegion(), setEntranceAngle(), and setFieldCalcParam().
|
private |
Definition at line 249 of file Bend2D.h.
Referenced by calculateBendAngle(), calculateRefTrajectory(), setFieldBoundaries(), and setFieldCalcParam().
|
private |
Enge function order for entry region.
Definition at line 255 of file Bend2D.h.
Referenced by setFieldCalcParam().
|
private |
function origin where Enge function starts.
Perpendicular distance from entrance Enge
Definition at line 251 of file Bend2D.h.
Referenced by setFieldCalcParam().
|
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().
|
private |
through the bend.
Pusher used to integrate reference particle
Definition at line 199 of file Bend2D.h.
Referenced by apply(), calculateMapField(), estimateFieldAdjustmentStep(), findIdealBendParameters(), getBendRadius(), getEffectiveCenter(), getEffectiveLength(), getOutline(), getSurfaceMesh(), inMagnetCentralRegion(), isFieldZero(), print(), setBendStrength(), setFieldBoundaries(), setFieldCalcParam(), and setupBendGeometry().
|
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().
|
private |
Enge coefficients for map entry and exit regions.
Definition at line 237 of file Bend2D.h.
Referenced by print(), and readFieldMap().
|
private |
Definition at line 238 of file Bend2D.h.
Referenced by print(), and readFieldMap().
|
private |
Definition at line 229 of file Bend2D.h.
Referenced by adjustFringeFields(), calcEntranceFringeField(), getEntranceFringeFieldLength(), getOutline(), getSurfaceMesh(), inMagnetEntranceRegion(), isPositionInEntranceField(), print(), readFieldMap(), setEngeOriginDelta(), setFieldCalcParam(), and setupFringeWidths().
|
private |
Definition at line 230 of file Bend2D.h.
Referenced by adjustFringeFields(), calcEntranceFringeField(), getEntranceFringeFieldLength(), print(), readFieldMap(), setEngeOriginDelta(), and setFieldCalcParam().
|
private |
Definition at line 231 of file Bend2D.h.
Referenced by adjustFringeFields(), calcEntranceFringeField(), getEntranceFringeFieldLength(), getSurfaceMesh(), isPositionInEntranceField(), print(), readFieldMap(), setEngeOriginDelta(), setFieldCalcParam(), and setupFringeWidths().
|
private |
Definition at line 242 of file Bend2D.h.
Referenced by calcEntranceFringeField(), readFieldMap(), and ~Bend2D().
|
private |
Definition at line 240 of file Bend2D.h.
Referenced by calcEntranceFringeField(), readFieldMap(), and ~Bend2D().
|
private |
Bend design radius (m).
Definition at line 201 of file Bend2D.h.
Referenced by findIdealBendParameters(), getExitAngle(), getSurfaceMesh(), print(), setExitAngle(), setFieldBoundaries(), and setFieldCalcParam().
|
private |
Definition at line 243 of file Bend2D.h.
Referenced by calcExitFringeField(), readFieldMap(), and ~Bend2D().
|
private |
Definition at line 241 of file Bend2D.h.
Referenced by calcExitFringeField(), readFieldMap(), and ~Bend2D().
|
private |
Definition at line 232 of file Bend2D.h.
Referenced by adjustFringeFields(), calcExitFringeField(), getExitFringeFieldLength(), getSurfaceMesh(), isPositionInExitField(), print(), readFieldMap(), setEngeOriginDelta(), setFieldCalcParam(), and setupFringeWidths().
|
private |
Definition at line 233 of file Bend2D.h.
Referenced by adjustFringeFields(), calcExitFringeField(), getExitFringeFieldLength(), print(), readFieldMap(), setEngeOriginDelta(), and setFieldCalcParam().
|
private |
Definition at line 234 of file Bend2D.h.
Referenced by adjustFringeFields(), calcExitFringeField(), getExitFringeFieldLength(), getOutline(), getSurfaceMesh(), inMagnetExitRegion(), isPositionInExitField(), print(), readFieldMap(), setEngeOriginDelta(), setFieldCalcParam(), and setupFringeWidths().
|
private |
|
private |
Definition at line 272 of file Bend2D.h.
Referenced by inMagnetCentralRegion(), and setFieldCalcParam().
|
private |
Definition at line 194 of file Bend2D.h.
Referenced by initialise(), and setMessageHeader().
|
private |
Definition at line 274 of file Bend2D.h.
Referenced by getNSlices(), and setNSlices().
|
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().
|
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().
|
private |
Definition at line 196 of file Bend2D.h.
Referenced by calculateBendAngle(), calculateRefTrajectory(), and setupPusher().
|
private |
Definition at line 216 of file Bend2D.h.
Referenced by setupBendGeometry().
|
private |
Definition at line 262 of file Bend2D.h.
Referenced by calculateBendAngle(), calculateMapField(), calculateRefTrajectory(), getOutline(), getSurfaceMesh(), inMagnetCentralRegion(), setEntranceAngle(), and setFieldCalcParam().
|
private |
Dipole field index.
Definition at line 204 of file Bend2D.h.
Referenced by calculateBendAngle(), calculateRefTrajectory(), getDimensions(), getStartField(), initialise(), print(), setFieldBoundaries(), and setupBendGeometry().
|
private |
Definition at line 263 of file Bend2D.h.
Referenced by calculateBendAngle(), calculateRefTrajectory(), getOutline(), getSurfaceMesh(), and setEntranceAngle().
|
private |
Definition at line 264 of file Bend2D.h.
Referenced by getOutline(), getSurfaceMesh(), and setExitAngle().
|
private |
Definition at line 268 of file Bend2D.h.
Referenced by getSurfaceMesh(), setCSTrafoToEntranceRegion(), setFieldCalcParam(), and transformToEntranceRegion().
|
private |
Definition at line 269 of file Bend2D.h.
Referenced by getSurfaceMesh(), setCSTrafoToExitRegion(), setFieldCalcParam(), and transformToExitRegion().
|
private |
End of magnet field map in s coordinates (m).
Definition at line 207 of file Bend2D.h.
Referenced by getOutline(), and setupFringeWidths().
|
private |
Definition at line 208 of file Bend2D.h.
Referenced by getOutline(), and setupFringeWidths().