|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
|
#include <MultipoleTStraight.h>
Public Member Functions | |
| MultipoleTStraight (MultipoleT *element) | |
| void | initialise () override |
| BGeometryBase & | getGeometry () override |
| const BGeometryBase & | getGeometry () const override |
| void | transformCoords (Vector_t &R) override |
| void | transformBField (Vector_t &, const Vector_t &) override |
| double | getScaleFactor (double, double) override |
| double | getBx (const Vector_t &R) override |
| double | getBs (const Vector_t &R) override |
| double | getFn (size_t n, double x, double s) override |
| Vector_t | localCartesianToOpalCartesian (const Vector_t &r) override |
| double | getBz (const Vector_t &R) |
| virtual void | setMaxOrder (size_t, size_t) |
| virtual double | localCartesianRotation () |
Protected Attributes | |
| MultipoleT * | element_m |
Private Attributes | |
| StraightGeometry | straightGeometry_m |
MultipoleTiStraight defines a straight 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 82 of file MultipoleTStraight.h.
|
explicit |
Constructor
Definition at line 33 of file MultipoleTStraight.cpp.
References MultipoleTBase::MultipoleTBase().
|
overridevirtual |
Get s-component of the B-field
This function has been overloaded because calculating
the B-field directly is quicker and more accurate
Reimplemented from MultipoleTBase.
Definition at line 55 of file MultipoleTStraight.cpp.
References MultipoleTBase::element_m.
|
overridevirtual |
Get x-component of the B-field
This function has been overloaded because calculating
the B-field directly is quicker and more accurate
Reimplemented from MultipoleTBase.
Definition at line 41 of file MultipoleTStraight.cpp.
References MultipoleTBase::element_m.
|
inherited |
Returns the vertical field component
Returns zero far outside fringe field \( Bz = sum_n f_n * z^(2n) / (2n)! \)
Definition at line 37 of file MultipoleTBase.cpp.
References element_m, and getFn().
|
overridevirtual |
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 69 of file MultipoleTStraight.cpp.
References MultipoleTBase::element_m.
|
inlineoverridevirtual |
Return the cell geometry
Implements MultipoleTBase.
Definition at line 91 of file MultipoleTStraight.h.
References straightGeometry_m.
|
inlineoverridevirtual |
Return the cell geometry
Implements MultipoleTBase.
Definition at line 89 of file MultipoleTStraight.h.
References straightGeometry_m.
|
inlineoverridevirtual |
Returns the scale factor \( h_s = 1\)
| x | -> Coordinate x |
| s | -> Coordinate s |
Implements MultipoleTBase.
Definition at line 100 of file MultipoleTStraight.h.
|
overridevirtual |
Initialise the element
Implements MultipoleTBase.
Definition at line 37 of file MultipoleTStraight.cpp.
References MultipoleTBase::element_m, and straightGeometry_m.
|
inlinevirtualinherited |
Reimplemented in MultipoleTCurvedVarRadius.
Definition at line 136 of file MultipoleTBase.h.
Implements MultipoleTBase.
Definition at line 82 of file MultipoleTStraight.cpp.
References MultipoleTBase::element_m.
|
inlinevirtualinherited |
Set the number of terms used in calculation of field components
| orderZ | -> Number of terms in expansion in z |
| orderX | -> Number of terms in expansion in x |
Reimplemented in MultipoleTCurvedConstRadius, and MultipoleTCurvedVarRadius.
Definition at line 134 of file MultipoleTBase.h.
Transform B-field from Frenet-Serret coordinates to lab coordinates
Implements MultipoleTBase.
Definition at line 95 of file MultipoleTStraight.h.
|
overridevirtual |
Transform to Frenet-Serret coordinates for sector magnets
Implements MultipoleTBase.
Definition at line 86 of file MultipoleTStraight.cpp.
References MultipoleTBase::element_m.
|
protectedinherited |
Definition at line 91 of file MultipoleTBase.h.
Referenced by getBs(), MultipoleTStraight::getBs(), getBx(), MultipoleTStraight::getBx(), getBz(), MultipoleTCurvedConstRadius::getFn(), MultipoleTCurvedVarRadius::getFn(), MultipoleTStraight::getFn(), MultipoleTCurvedConstRadius::getScaleFactor(), MultipoleTCurvedVarRadius::getScaleFactor(), MultipoleTCurvedConstRadius::initialise(), MultipoleTCurvedVarRadius::initialise(), MultipoleTStraight::initialise(), MultipoleTCurvedVarRadius::localCartesianToCurvilinear(), MultipoleTCurvedConstRadius::localCartesianToOpalCartesian(), MultipoleTStraight::localCartesianToOpalCartesian(), MultipoleTBase(), MultipoleTCurvedConstRadius::setMaxOrder(), MultipoleTCurvedVarRadius::setMaxOrder(), MultipoleTCurvedConstRadius::transformBField(), MultipoleTCurvedVarRadius::transformBField(), MultipoleTCurvedConstRadius::transformCoords(), and MultipoleTStraight::transformCoords().
|
private |
Geometry
Definition at line 122 of file MultipoleTStraight.h.
Referenced by getGeometry(), getGeometry(), and initialise().