|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
|
#include <MultipoleTStraight.h>


Public Member Functions | |
| MultipoleTStraight (MultipoleT *element) | |
| Constructor. More... | |
| void | initialise () override |
| Initialise the element. More... | |
| BGeometryBase & | getGeometry () override |
| Return the cell geometry. More... | |
| const BGeometryBase & | getGeometry () const override |
| Return the cell geometry. More... | |
| void | transformCoords (Vector_t &R) override |
| Transform to Frenet-Serret coordinates for sector magnets. More... | |
| void | transformBField (Vector_t &, const Vector_t &) override |
| Transform B-field from Frenet-Serret coordinates to lab coordinates. More... | |
| double | getScaleFactor (double, double) override |
| Returns the scale factor \( h_s = 1\). More... | |
| double | getBx (const Vector_t &R) override |
| Get x-component of the B-field This function has been overloaded because calculating the B-field directly is quicker and more accurate. More... | |
| double | getBs (const Vector_t &R) override |
| Get s-component of the B-field This function has been overloaded because calculating the B-field directly is quicker and more accurate. More... | |
| double | getFn (size_t n, double x, double s) override |
| Calculate fn(x, s) by expanding the differential operator (from Laplacian and scalar potential) in terms of polynomials. More... | |
| Vector_t | localCartesianToOpalCartesian (const Vector_t &r) override |
| double | getBz (const Vector_t &R) |
| Returns the vertical field component Returns zero far outside fringe field \( Bz = sum_n f_n * z^(2n) / (2n)! \). More... | |
| virtual void | setMaxOrder (size_t, size_t) |
| Set the number of terms used in calculation of field components . More... | |
| virtual double | localCartesianRotation () |
Protected Attributes | |
| MultipoleT * | element_m |
Private Attributes | |
| StraightGeometry | straightGeometry_m |
| Geometry. More... | |
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.
|
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, MultipoleT::getFringeDeriv(), MultipoleT::getMaxFOrder(), MultipoleT::getTransDeriv(), Hypervolume::n, and Attrib::Distribution::R.

|
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, MultipoleT::getFringeDeriv(), MultipoleT::getMaxFOrder(), MultipoleT::getTransDeriv(), Hypervolume::n, and Attrib::Distribution::R.

|
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 MultipoleTBase::element_m, MultipoleTBase::getFn(), MultipoleT::getMaxFOrder(), Hypervolume::n, and Attrib::Distribution::R.

|
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, MultipoleT::getFringeDeriv(), MultipoleT::getTransDeriv(), and Hypervolume::n.

|
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, MultipoleT::getLength(), StraightGeometry::setElementLength(), 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, and MultipoleT::getLength().

|
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, MultipoleT::getLength(), and Attrib::Distribution::R.

|
protectedinherited |
Definition at line 91 of file MultipoleTBase.h.
Referenced by MultipoleTBase::getBs(), getBs(), MultipoleTBase::getBx(), getBx(), MultipoleTBase::getBz(), MultipoleTCurvedConstRadius::getFn(), MultipoleTCurvedVarRadius::getFn(), getFn(), MultipoleTCurvedConstRadius::getScaleFactor(), MultipoleTCurvedVarRadius::getScaleFactor(), MultipoleTCurvedConstRadius::initialise(), MultipoleTCurvedVarRadius::initialise(), initialise(), MultipoleTCurvedVarRadius::localCartesianToCurvilinear(), MultipoleTCurvedConstRadius::localCartesianToOpalCartesian(), localCartesianToOpalCartesian(), MultipoleTCurvedConstRadius::setMaxOrder(), MultipoleTCurvedVarRadius::setMaxOrder(), MultipoleTCurvedConstRadius::transformBField(), MultipoleTCurvedVarRadius::transformBField(), MultipoleTCurvedConstRadius::transformCoords(), and transformCoords().
|
private |
Geometry.
Definition at line 122 of file MultipoleTStraight.h.
Referenced by getGeometry(), and initialise().