OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <MultipoleTCurvedConstRadius.h>
Public Member Functions | |
MultipoleTCurvedConstRadius (const std::string &name) | |
MultipoleTCurvedConstRadius (const MultipoleTCurvedConstRadius &right) | |
~MultipoleTCurvedConstRadius () | |
virtual ElementBase * | clone () const override |
void | accept (BeamlineVisitor &visitor) const override |
PlanarArcGeometry & | getGeometry () override |
const PlanarArcGeometry & | getGeometry () const override |
virtual void | setMaxOrder (const std::size_t &maxOrder) override |
std::size_t | getMaxXOrder () const |
void | setMaxXOrder (const std::size_t &maxXOrder) |
virtual void | setBendAngle (const double &angle) override |
virtual double | getBendAngle () const override |
virtual void | initialise (PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override |
Public Member Functions inherited from MultipoleTBase | |
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 | finalise () |
bool | bends () const |
double | getDipoleConstant () const |
void | setDipoleConstant (const double &B0) |
std::size_t | getMaxOrder () const |
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) |
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 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 * | 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... | |
Private Member Functions | |
MultipoleTCurvedConstRadius | operator= (const MultipoleTCurvedConstRadius &rhs) |
virtual void | transformCoords (Vector_t &R) override |
virtual void | transformBField (Vector_t &B, const Vector_t &R) override |
virtual double | getRadius (const double &s) override |
virtual double | getScaleFactor (const double &x, const double &s) override |
virtual double | getFn (const std::size_t &n, const double &x, const double &s) override |
Private Attributes | |
std::size_t | maxOrderX_m |
std::vector< polynomial::RecursionRelation > | recursion_m |
PlanarArcGeometry | planarArcGeometry_m |
double | angle_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 Member Functions inherited from MultipoleTBase | |
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) |
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 |
MultipoleT defines a curved combined function magnet with constant radius
of curvature, (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 83 of file MultipoleTCurvedConstRadius.h.
|
explicit |
Constructor
name | -> User-defined name |
Definition at line 35 of file MultipoleTCurvedConstRadius.cpp.
Referenced by clone().
MultipoleTCurvedConstRadius::MultipoleTCurvedConstRadius | ( | const MultipoleTCurvedConstRadius & | right | ) |
Copy constructor
Definition at line 43 of file MultipoleTCurvedConstRadius.cpp.
References Component::RefPartBunch_m.
MultipoleTCurvedConstRadius::~MultipoleTCurvedConstRadius | ( | ) |
Destructor
Definition at line 53 of file MultipoleTCurvedConstRadius.cpp.
|
inlineoverridevirtual |
Accept a beamline visitor
Implements ElementBase.
Definition at line 161 of file MultipoleTCurvedConstRadius.h.
References BeamlineVisitor::visitMultipoleTCurvedConstRadius().
|
overridevirtual |
Inheritable copy constructor
Implements ElementBase.
Definition at line 56 of file MultipoleTCurvedConstRadius.cpp.
References MultipoleTCurvedConstRadius().
Referenced by ParallelCyclotronTracker::visitMultipoleTCurvedConstRadius().
|
inlineoverridevirtual |
Get the bending angle of the magnet
Reimplemented from MultipoleTBase.
Definition at line 186 of file MultipoleTCurvedConstRadius.h.
References angle_m.
|
overrideprivatevirtual |
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 |
Implements MultipoleTBase.
Definition at line 105 of file MultipoleTCurvedConstRadius.cpp.
References angle_m, MultipoleTBase::getFringeDeriv(), MultipoleTBase::getLength(), MultipoleTBase::getTransDeriv(), Hypervolume::n, and recursion_m.
|
inlineoverridevirtual |
Return the cell geometry
Implements ElementBase.
Definition at line 178 of file MultipoleTCurvedConstRadius.h.
References planarArcGeometry_m.
|
inlineoverridevirtual |
Return the cell geometry
Implements ElementBase.
Definition at line 174 of file MultipoleTCurvedConstRadius.h.
References planarArcGeometry_m.
Referenced by OpalMultipoleTCurvedConstRadius::update().
|
inline |
Get highest power of x in polynomial expansions
Definition at line 170 of file MultipoleTCurvedConstRadius.h.
References maxOrderX_m.
|
overrideprivatevirtual |
Radius of curvature
If radius of curvature is infinite, -1 is returned
\( \rho(s) = length_m / angle_m \)
s | -> Coordinate s |
Implements MultipoleTBase.
Definition at line 92 of file MultipoleTCurvedConstRadius.cpp.
References angle_m, and MultipoleTBase::getLength().
|
overrideprivatevirtual |
Returns the scale factor \( h_s = 1 + x / \rho \)
x | -> Coordinate x |
s | -> Coordinate s |
Implements MultipoleTBase.
Definition at line 100 of file MultipoleTCurvedConstRadius.cpp.
References angle_m, and MultipoleTBase::getLength().
|
inlineoverridevirtual |
Initialise the MultipoleT
bunch | -> Bunch the global bunch object |
startField | -> Not used |
endField | -> Not used |
Reimplemented from MultipoleTBase.
Definition at line 190 of file MultipoleTCurvedConstRadius.h.
References angle_m, MultipoleTBase::getBoundingBoxLength(), MultipoleTBase::getLength(), planarArcGeometry_m, Component::RefPartBunch_m, PlanarArcGeometry::setCurvature(), and PlanarArcGeometry::setElementLength().
|
private |
|
inlineoverridevirtual |
Set the bending angle of the magnet
Reimplemented from MultipoleTBase.
Definition at line 182 of file MultipoleTCurvedConstRadius.h.
References angle_m.
Referenced by OpalMultipoleTCurvedConstRadius::update().
|
overridevirtual |
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 from MultipoleTBase.
Definition at line 80 of file MultipoleTCurvedConstRadius.cpp.
References MultipoleTBase::getTransMaxOrder(), maxOrderX_m, recursion_m, polynomial::RecursionRelation::resizeX(), MultipoleTBase::setMaxOrder(), and polynomial::RecursionRelation::truncate().
Referenced by OpalMultipoleTCurvedConstRadius::update().
|
inline |
Set the number of terms used in polynomial expansions
maxXOrder | -> Number of terms in expansion in z |
Definition at line 165 of file MultipoleTCurvedConstRadius.h.
References maxOrderX_m.
Referenced by OpalMultipoleTCurvedConstRadius::update().
|
overrideprivatevirtual |
Transform B-field from Frenet-Serret coordinates to lab coordinates
Implements MultipoleTBase.
Definition at line 71 of file MultipoleTCurvedConstRadius.cpp.
References angle_m, cos(), MultipoleTBase::getLength(), Attrib::Distribution::R, and sin().
|
overrideprivatevirtual |
Transform to Frenet-Serret coordinates for sector magnets
Implements MultipoleTBase.
Definition at line 60 of file MultipoleTCurvedConstRadius.cpp.
References Physics::alpha, angle_m, atan(), MultipoleTBase::getLength(), Attrib::Distribution::R, and sin().
|
private |
Definition at line 137 of file MultipoleTCurvedConstRadius.h.
Referenced by getBendAngle(), getFn(), getRadius(), getScaleFactor(), initialise(), setBendAngle(), transformBField(), and transformCoords().
|
private |
Highest order of polynomial expansions in x
Definition at line 128 of file MultipoleTCurvedConstRadius.h.
Referenced by getMaxXOrder(), setMaxOrder(), and setMaxXOrder().
|
private |
Geometry
Definition at line 132 of file MultipoleTCurvedConstRadius.h.
Referenced by getGeometry(), and initialise().
|
private |
Object for storing differential operator acting on Fn
Definition at line 130 of file MultipoleTCurvedConstRadius.h.
Referenced by getFn(), and setMaxOrder().