|
OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <MultipoleTBase.h>


Public Member Functions | |
| MultipoleTBase () | |
| MultipoleTBase (const std::string &name) | |
| MultipoleTBase (const MultipoleTBase &right) | |
| ~MultipoleTBase () | |
| EMField & | getField () |
| const EMField & | getField () const |
| bool | apply (const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) |
| bool | apply (const size_t &i, const double &t, Vector_t &E, Vector_t &B) |
| void | initialise (PartBunchBase< double, 3 > *, double &startField, double &endField) |
| void | finalise () |
| bool | bends () const |
| double | getDipoleConstant () const |
| void | setDipoleConstant (const double &B0) |
| std::size_t | getMaxOrder () const |
| virtual void | setMaxOrder (const std::size_t &maxOrder) |
| std::size_t | getTransMaxOrder () const |
| void | setTransMaxOrder (const std::size_t &transMaxOrder) |
| void | setTransProfile (const std::size_t &n, const double &Bn) |
| double | getTransProfile (const std::size_t &n) const |
| std::vector< double > | getTransProfile () const |
| bool | setFringeField (const double &s0, const double &lambda_left, const double &lambda_right) |
| std::vector< double > | getFringeLength () const |
| void | setEntranceAngle (const double &entranceAngle) |
| virtual void | setBendAngle (const double &angle) |
| virtual double | getBendAngle () const |
| double | getEntranceAngle () const |
| void | setLength (const double &length) |
| double | getLength () const |
| void | setAperture (const double &vertAp, const double &horizAp) |
| std::vector< double > | getAperture () const |
| void | setRotation (const double &rot) |
| double | getRotation () const |
| double | getBoundingBoxLength () const |
| void | setBoundingBoxLength (const double &boundingBoxLength) |
| virtual void | getDimensions (double &zBegin, double &zEnd) const |
Public Member Functions inherited from Component | |
| Component (const std::string &name) | |
| Constructor with given name. More... | |
| Component () | |
| Component (const Component &right) | |
| virtual | ~Component () |
| 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 | 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 | goOnline (const double &kineticEnergy) |
| virtual void | goOffline () |
| virtual bool | Online () |
| virtual ElementBase::ElementType | getType () const |
| Get element type std::string. More... | |
| 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 void | accept (BeamlineVisitor &visitor) const =0 |
| Apply visitor. 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 |
| virtual CoordinateSystemTrafo | getEdgeToEnd () const |
| void | setAperture (const ApertureType &type, const std::vector< double > &args) |
| std::pair< ElementBase::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 | 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 | |
| double | getFringeDeriv (const std::size_t &n, const double &s) |
| double | getTransDeriv (const std::size_t &n, const double &x) |
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 | |
| Vector_t | rotateFrame (const Vector_t &R) |
| Vector_t | rotateFrameInverse (Vector_t &B) |
| virtual void | transformCoords (Vector_t &R)=0 |
| virtual void | transformBField (Vector_t &B, const Vector_t &R)=0 |
| virtual double | getBx (const Vector_t &R) |
| double | getBz (const Vector_t &R) |
| virtual double | getBs (const Vector_t &R) |
| bool | insideAperture (const Vector_t &R) |
| virtual double | getRadius (const double &s)=0 |
| virtual double | getScaleFactor (const double &x, const double &s)=0 |
| double | getFnDerivX (const std::size_t &n, const double &x, const double &s) |
| double | getFnDerivS (const std::size_t &n, const double &x, const double &s) |
| virtual double | getFn (const std::size_t &n, const double &x, const double &s)=0 |
Private Attributes | |
| endfieldmodel::Tanh | fringeField_l |
| endfieldmodel::Tanh | fringeField_r |
| std::size_t | maxOrder_m |
| std::size_t | transMaxOrder_m = 0 |
| std::vector< double > | transProfile_m |
| double | length_m |
| double | entranceAngle_m |
| double | rotation_m |
| double | boundingBoxLength_m |
| double | verticalApert_m |
| double | horizontalApert_m |
| BMultipoleField | dummy |
MultipoleTBase is a base class for a straight or curved combined
function magnet (up to arbitrary multipole component) with fringe fields.
Class category: AbsBeamline
$Author: Titus Dascalu, Martin Duy Tat, Chris Rogers
The field is obtained from the scalar potential
\[ V = f_0(x,s) z + f_1 (x,s) \frac{z^3}{3!} + f_2 (x,s) \frac{z^5}{5!} + ... \]
(x,z,s) -> Frenet-Serret local coordinates along the magnet
z -> vertical component
assume mid-plane symmetry
set field on mid-plane -> \( B_z = f_0(x,s) = T(x) \cdot S(s) \)
T(x) -> transverse profile; this is a polynomial describing the field expansion on the mid-plane inside the magnet (not in the fringe field); 1st term is the dipole strength, 2nd term is the quadrupole gradient * x, etc.
-> when setting the magnet, one gives the multipole coefficients of this polynomial (i.e. dipole strength,
quadrupole gradient, etc.)
----------— example --------------------------------------------—
Setting a combined function magnet with dipole, quadrupole and sextupole components:
\( T(x) = B_0 + B_1 \cdot x + B_2 \cdot x^2 \)
user gives \( B_0, B_1, B_2 \)
----------— example end ----------------------------------------—
S(s) -> fringe field
recursion -> \( f_n (x,s) = (-1)^n \cdot \sum_{i=0}^{n} C_n^i \cdot T^{(2i)} \cdot S^{(2n-2i)} \)
for curved magnets the above recursion is more complicated
\( C_n^i \) -> binomial coeff; \( T^{(n)} \) -> n-th derivative
Definition at line 86 of file MultipoleTBase.h.
| MultipoleTBase::MultipoleTBase | ( | ) |
Default constructor
Definition at line 36 of file MultipoleTBase.cpp.
|
explicit |
| MultipoleTBase::MultipoleTBase | ( | const MultipoleTBase & | right | ) |
Copy constructor
Definition at line 54 of file MultipoleTBase.cpp.
References Component::RefPartBunch_m.
| MultipoleTBase::~MultipoleTBase | ( | ) |
Destructor
Definition at line 71 of file MultipoleTBase.cpp.
|
inlinevirtual |
Calculate the field at the position of the ith particle
| i | -> Index of the particle event; field is calculated at this position If particle is outside field map true is returned, otherwise false is returned |
| t | -> Time at which the field is to be calculated |
| E | -> Calculated electric field - always 0 (no E-field) |
| B | -> Calculated magnetic field |
Reimplemented from Component.
Definition at line 335 of file MultipoleTBase.h.
References apply(), PartBunchBase< T, Dim >::P, PartBunchBase< T, Dim >::R, and Component::RefPartBunch_m.

|
virtual |
Calculate the field at some arbitrary position
If particle is outside field map true is returned, otherwise false is returned
| R | -> Position in the lab coordinate system of the multipole |
| P | -> Not used |
| t | -> Time at which the field is to be calculated |
| E | -> Calculated electric field - always 0 (no E-field) |
| B | -> Calculated magnetic field |
Rotate coordinates around the central axis of the magnet
Go to local Frenet-Serret coordinates
Calculate B-field in the local Frenet-Serret frame
Transform B-field from local to lab coordinates
Reimplemented from Component.
Definition at line 74 of file MultipoleTBase.cpp.
References getBs(), getBx(), getBz(), insideAperture(), Attrib::Distribution::R, rotateFrame(), transformBField(), and transformCoords().
Referenced by apply().

|
inlinevirtual |
Return true if dipole component not zero
Implements Component.
Definition at line 453 of file MultipoleTBase.h.
References transProfile_m.
|
inlinevirtual |
Finalise the MultipoleT - sets bunch to NULL
Implements Component.
Definition at line 331 of file MultipoleTBase.h.
References Component::RefPartBunch_m.
|
inline |
Get the aperture dimensions Returns a vector of 2 doubles
Definition at line 434 of file MultipoleTBase.h.
References horizontalApert_m, and verticalApert_m.
|
inlinevirtual |
Get the bending angle of the magnet
Reimplemented in MultipoleTCurvedVarRadius, and MultipoleTCurvedConstRadius.
Definition at line 342 of file MultipoleTBase.h.
|
inline |
Get distance between centre of magnet and entrance
Definition at line 404 of file MultipoleTBase.h.
References boundingBoxLength_m.
Referenced by MultipoleTCurvedConstRadius::initialise(), MultipoleTCurvedVarRadius::initialise(), and MultipoleTStraight::initialise().
|
privatevirtual |
Returns the component of the field along the central axis
Returns zero far outside fringe field \( Bs = sum_n z^(2n+1) / (2n+1)! \partial_s f_n / h_s \)
Reimplemented in MultipoleTStraight.
Definition at line 171 of file MultipoleTBase.cpp.
References abs(), getFnDerivS(), getFringeDeriv(), getMaxOrder(), getScaleFactor(), Hypervolume::n, and Attrib::Distribution::R.
Referenced by apply().

|
privatevirtual |
Returns the radial component of the field
Returns zero far outside fringe field \( Bx = sum_n z^(2n+1) / (2n+1)! * \partial_x f_n \)
Reimplemented in MultipoleTStraight.
Definition at line 156 of file MultipoleTBase.cpp.
References abs(), getFnDerivX(), getFringeDeriv(), getMaxOrder(), Hypervolume::n, and Attrib::Distribution::R.
Referenced by apply().

|
private |
Returns the vertical field component
Returns zero far outside fringe field \( Bz = sum_n f_n * z^(2n) / (2n)! \)
Definition at line 142 of file MultipoleTBase.cpp.
References abs(), getFn(), getFringeDeriv(), getMaxOrder(), Hypervolume::n, and Attrib::Distribution::R.
Referenced by apply().

|
inlinevirtual |
|
inline |
Get the dipole constant B_0
Definition at line 367 of file MultipoleTBase.h.
References transProfile_m.
|
inline |
|
inlinevirtual |
Return a dummy field value
Implements Component.
Definition at line 457 of file MultipoleTBase.h.
References dummy.
|
inlinevirtual |
Return a dummy field value
Implements Component.
Definition at line 461 of file MultipoleTBase.h.
References dummy.
|
privatepure virtual |
Calculate fn(x, s) by expanding the differential operator (from Laplacian and scalar potential) in terms of polynomials
| n | -> nth derivative |
| x | -> Coordinate x |
| s | -> Coordinate s |
Implemented in MultipoleTStraight, MultipoleTCurvedVarRadius, and MultipoleTCurvedConstRadius.
Referenced by getBz(), getFnDerivS(), and getFnDerivX().
|
private |
Calculate partial derivative of fn wrt s using a 5-point finite difference formula Error of order stepSize^4
| n | -> nth derivative |
| x | -> Coordinate x |
| s | -> Coordinate s |
Definition at line 239 of file MultipoleTBase.cpp.
References Physics::e, getFn(), getFringeDeriv(), getTransDeriv(), and Hypervolume::n.
Referenced by getBs().

|
private |
Calculate partial derivative of fn wrt x using a 5-point finite difference formula Error of order stepSize^4
| n | -> nth derivative |
| x | -> Coordinate x |
| s | -> Coordinate s |
Definition at line 223 of file MultipoleTBase.cpp.
References Physics::e, getFn(), getFringeDeriv(), getTransDeriv(), and Hypervolume::n.
Referenced by getBx().

|
protected |
Returns the value of the fringe field n-th derivative at s
| n | -> nth derivative |
| s | -> Coordinate s |
Definition at line 186 of file MultipoleTBase.cpp.
References fringeField_l, fringeField_r, endfieldmodel::Tanh::getNegTanh(), endfieldmodel::Tanh::getTanh(), tanhderiv::integrate(), and Hypervolume::n.
Referenced by getBs(), MultipoleTStraight::getBs(), getBx(), MultipoleTStraight::getBx(), getBz(), MultipoleTCurvedConstRadius::getFn(), MultipoleTCurvedVarRadius::getFn(), MultipoleTStraight::getFn(), getFnDerivS(), getFnDerivX(), and MultipoleTCurvedVarRadius::getRadius().

|
inline |
Return vector of 2 doubles [left fringe length, right fringelength]
Definition at line 441 of file MultipoleTBase.h.
References fringeField_l, fringeField_r, and endfieldmodel::Tanh::getLambda().
Referenced by MultipoleTCurvedVarRadius::initialise(), MultipoleTCurvedVarRadius::transformBField(), and MultipoleTCurvedVarRadius::transformCoords().

|
inline |
Get the length of the magnet
Definition at line 400 of file MultipoleTBase.h.
References length_m.
Referenced by MultipoleTCurvedConstRadius::getFn(), MultipoleTCurvedVarRadius::getFn(), MultipoleTCurvedConstRadius::getRadius(), MultipoleTCurvedVarRadius::getRadius(), MultipoleTCurvedConstRadius::getScaleFactor(), MultipoleTCurvedConstRadius::initialise(), MultipoleTCurvedVarRadius::initialise(), MultipoleTCurvedConstRadius::transformBField(), MultipoleTCurvedVarRadius::transformBField(), MultipoleTCurvedConstRadius::transformCoords(), and MultipoleTCurvedVarRadius::transformCoords().
|
inline |
Get the number of terms used in calculation of field components
Definition at line 375 of file MultipoleTBase.h.
References maxOrder_m.
Referenced by getBs(), MultipoleTStraight::getBs(), getBx(), MultipoleTStraight::getBx(), and getBz().
|
privatepure virtual |
Radius of curvature
| s | -> Coordinate s |
Implemented in MultipoleTStraight, MultipoleTCurvedVarRadius, and MultipoleTCurvedConstRadius.
|
inline |
Get the angle of rotation of the magnet around its axis
Definition at line 388 of file MultipoleTBase.h.
References rotation_m.
|
privatepure virtual |
Returns the scale factor \( h_s = 1 + x / \rho(s) \)
| x | -> Coordinate x |
| s | -> Coordinate s |
Implemented in MultipoleTStraight, MultipoleTCurvedVarRadius, and MultipoleTCurvedConstRadius.
Referenced by getBs().
|
protected |
Returns the value of the transverse field n-th derivative at x
Transverse field is a polynomial in x, differentiation follows usual polynomial rules of differentiation
| n | -> nth derivative |
| x | -> Coordinate x |
Definition at line 199 of file MultipoleTBase.cpp.
References getTransMaxOrder(), getTransProfile(), Hypervolume::n, and transMaxOrder_m.
Referenced by MultipoleTStraight::getBs(), MultipoleTStraight::getBx(), MultipoleTCurvedConstRadius::getFn(), MultipoleTCurvedVarRadius::getFn(), MultipoleTStraight::getFn(), getFnDerivS(), and getFnDerivX().

|
inline |
Get the maximum order in the given transverse profile
Definition at line 379 of file MultipoleTBase.h.
References transMaxOrder_m.
Referenced by getTransDeriv(), MultipoleTCurvedConstRadius::setMaxOrder(), and MultipoleTCurvedVarRadius::setMaxOrder().
|
inline |
Get all terms of transverse profile
Definition at line 363 of file MultipoleTBase.h.
References transProfile_m.
Referenced by getTransDeriv().
|
inline |
Get transverse profile
| n | -> Power of x |
Definition at line 359 of file MultipoleTBase.h.
References Hypervolume::n, and transProfile_m.
|
inlinevirtual |
Initialise the MultipoleT
| bunch | -> Bunch the global bunch object |
| startField | -> Not used |
| endField | -> Not used |
Implements Component.
Reimplemented in MultipoleTStraight, MultipoleTCurvedVarRadius, and MultipoleTCurvedConstRadius.
Definition at line 448 of file MultipoleTBase.h.
|
inlineprivate |
Tests if inside the magnet
| R | -> Coordinate vector |
Definition at line 350 of file MultipoleTBase.h.
References abs(), horizontalApert_m, Attrib::Distribution::R, and verticalApert_m.
Referenced by apply().

Rotate frame for skew elements
Consecutive rotations: 1st -> about central axis 2nd -> azimuthal rotation
| R | -> Vector to be rotated |
Apply two 2D rotation matrices to coordinate vector Rotate around central axis => skew fields Rotate azymuthaly => entrance angle
Definition at line 98 of file MultipoleTBase.cpp.
References cos(), entranceAngle_m, Attrib::Distribution::R, rotation_m, and sin().
Referenced by apply().

Inverse of the 1st rotation in rotateFrame() method
Used to rotate B field back to global coordinate system
This function represents the inverse of the rotation around the central axis performed by rotateFrame() method Used to rotate B field back to global coordinate system
Definition at line 118 of file MultipoleTBase.cpp.
References cos(), rotation_m, and sin().

|
inline |
Set the aperture dimensions
This element only supports a rectangular aperture
| vertAp | -> Vertical aperture length |
| horizAp | -> Horisontal aperture length |
Definition at line 428 of file MultipoleTBase.h.
References horizontalApert_m, and verticalApert_m.
Referenced by OpalMultipoleTCurvedConstRadius::update(), OpalMultipoleTCurvedVarRadius::update(), and OpalMultipoleTStraight::update().
|
inlinevirtual |
Set the bending angle of the magnet
Reimplemented in MultipoleTCurvedVarRadius, and MultipoleTCurvedConstRadius.
Definition at line 340 of file MultipoleTBase.h.
|
inline |
Set distance between centre of magnet and enctrance
| boundingBoxLength | -> Distance between centre and entrance |
Definition at line 408 of file MultipoleTBase.h.
References boundingBoxLength_m.
Referenced by OpalMultipoleTCurvedConstRadius::update(), OpalMultipoleTCurvedVarRadius::update(), and OpalMultipoleTStraight::update().
|
inline |
Set the dipole constant B_0
Definition at line 421 of file MultipoleTBase.h.
References transMaxOrder_m, and transProfile_m.
|
inline |
Set the entrance angle
| entranceAngle | -> Entrance angle |
Definition at line 346 of file MultipoleTBase.h.
References entranceAngle_m.
Referenced by OpalMultipoleTCurvedConstRadius::update(), OpalMultipoleTCurvedVarRadius::update(), and OpalMultipoleTStraight::update().
| bool MultipoleTBase::setFringeField | ( | const double & | s0, |
| const double & | lambda_left, | ||
| const double & | lambda_right | ||
| ) |
Set fringe field model
Tanh model used here
\[ 1/2 * \left [tanh \left( \frac{s + s_0}{\lambda_{left}} \right) - tanh \left( \frac{s - s_0}{\lambda_{right}} \right) \right] \]
| s0 | -> Centre field length and \lambda_{left} -> Left end field length \lambda_{right} -> Right end field length |
Definition at line 130 of file MultipoleTBase.cpp.
References fringeField_l, fringeField_r, and maxOrder_m.
Referenced by OpalMultipoleTCurvedConstRadius::update(), OpalMultipoleTCurvedVarRadius::update(), and OpalMultipoleTStraight::update().
|
inline |
Set the length of the magnet If straight-> Actual length If curved -> Arc length
Definition at line 396 of file MultipoleTBase.h.
References abs(), and length_m.
Referenced by OpalMultipoleTCurvedConstRadius::update(), OpalMultipoleTCurvedVarRadius::update(), and OpalMultipoleTStraight::update().

|
inlinevirtual |
Set the number of terms used in calculation of field components
Maximum power of z in Bz is 2 * maxOrder_m
| maxOrder | -> Number of terms in expansion in z |
Reimplemented in MultipoleTStraight, MultipoleTCurvedVarRadius, and MultipoleTCurvedConstRadius.
Definition at line 371 of file MultipoleTBase.h.
References maxOrder_m.
Referenced by MultipoleTCurvedConstRadius::setMaxOrder(), MultipoleTCurvedVarRadius::setMaxOrder(), and MultipoleTStraight::setMaxOrder().
|
inline |
Set the angle of rotation of the magnet around its axis
To make skew components
| rot | -> Angle of rotation |
Definition at line 392 of file MultipoleTBase.h.
References rotation_m.
Referenced by OpalMultipoleTCurvedConstRadius::update(), OpalMultipoleTCurvedVarRadius::update(), and OpalMultipoleTStraight::update().
|
inline |
Set the maximum order in the given transverse profile
| transMaxOrder | -> Highest power of x in field expansion |
Definition at line 383 of file MultipoleTBase.h.
References transMaxOrder_m, and transProfile_m.
Referenced by OpalMultipoleTCurvedConstRadius::update(), OpalMultipoleTCurvedVarRadius::update(), and OpalMultipoleTStraight::update().
|
inline |
Set transverse profile T(x) T(x) = B_0 + B1 x + B2 x^2 + B3 x^3 + ...
| n | -> Order of the term (d^n/dx^n) to be set |
| Bn | -> Value of transverse profile coefficient |
Definition at line 412 of file MultipoleTBase.h.
References Hypervolume::n, transMaxOrder_m, and transProfile_m.
Referenced by OpalMultipoleTCurvedConstRadius::update(), OpalMultipoleTCurvedVarRadius::update(), and OpalMultipoleTStraight::update().
|
privatepure virtual |
Transform B-field from Frenet-Serret coordinates to lab coordinates
Implemented in MultipoleTStraight, MultipoleTCurvedVarRadius, and MultipoleTCurvedConstRadius.
Referenced by apply().
|
privatepure virtual |
Transform to Frenet-Serret coordinates for sector magnets
Implemented in MultipoleTStraight, MultipoleTCurvedVarRadius, and MultipoleTCurvedConstRadius.
Referenced by apply().
|
private |
Distance between centre of magnet and entrance
Definition at line 265 of file MultipoleTBase.h.
Referenced by getBoundingBoxLength(), and setBoundingBoxLength().
|
private |
|
private |
Definition at line 262 of file MultipoleTBase.h.
Referenced by getEntranceAngle(), rotateFrame(), and setEntranceAngle().
|
private |
Definition at line 237 of file MultipoleTBase.h.
Referenced by getFringeDeriv(), getFringeLength(), and setFringeField().
|
private |
Definition at line 238 of file MultipoleTBase.h.
Referenced by getFringeDeriv(), getFringeLength(), and setFringeField().
|
private |
Definition at line 283 of file MultipoleTBase.h.
Referenced by getAperture(), insideAperture(), and setAperture().
|
private |
Magnet parameters
Definition at line 261 of file MultipoleTBase.h.
Referenced by getLength(), and setLength().
|
private |
Number of terms in z expansion used in calculating field components
Definition at line 240 of file MultipoleTBase.h.
Referenced by getMaxOrder(), setFringeField(), and setMaxOrder().
|
private |
Definition at line 263 of file MultipoleTBase.h.
Referenced by getRotation(), rotateFrame(), rotateFrameInverse(), and setRotation().
|
private |
Highest power in given mid-plane field
Definition at line 242 of file MultipoleTBase.h.
Referenced by getTransDeriv(), getTransMaxOrder(), setDipoleConstant(), setTransMaxOrder(), and setTransProfile().
|
private |
List of transverse profile coefficients
Definition at line 244 of file MultipoleTBase.h.
Referenced by bends(), getDipoleConstant(), getTransProfile(), setDipoleConstant(), setTransMaxOrder(), and setTransProfile().
|
private |
Assume rectangular aperture with these dimensions
Definition at line 282 of file MultipoleTBase.h.
Referenced by getAperture(), insideAperture(), and setAperture().