OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
MultipoleTStraight Class Reference

#include <MultipoleTStraight.h>

Inheritance diagram for MultipoleTStraight:
Collaboration diagram for MultipoleTStraight:

Public Member Functions

 MultipoleTStraight (MultipoleT *element)
void initialise () override
BGeometryBasegetGeometry () override
const BGeometryBasegetGeometry () 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

MultipoleTelement_m

Private Attributes

StraightGeometry straightGeometry_m

Detailed Description


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.

Constructor & Destructor Documentation

◆ MultipoleTStraight()

MultipoleTStraight::MultipoleTStraight ( MultipoleT * element)
explicit

Constructor

Definition at line 33 of file MultipoleTStraight.cpp.

References MultipoleTBase::MultipoleTBase().

Here is the call graph for this function:

Member Function Documentation

◆ getBs()

double MultipoleTStraight::getBs ( const Vector_t & R)
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.

◆ getBx()

double MultipoleTStraight::getBx ( const Vector_t & 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.

◆ getBz()

double MultipoleTBase::getBz ( const Vector_t & 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 element_m, and getFn().

Here is the call graph for this function:

◆ getFn()

double MultipoleTStraight::getFn ( size_t n,
double x,
double s )
overridevirtual

Calculate fn(x, s) by expanding the differential operator (from Laplacian and scalar potential) in terms of polynomials

Parameters
n-> nth derivative
x-> Coordinate x
s-> Coordinate s

Implements MultipoleTBase.

Definition at line 69 of file MultipoleTStraight.cpp.

References MultipoleTBase::element_m.

◆ getGeometry() [1/2]

const BGeometryBase & MultipoleTStraight::getGeometry ( ) const
inlineoverridevirtual

Return the cell geometry

Implements MultipoleTBase.

Definition at line 91 of file MultipoleTStraight.h.

References straightGeometry_m.

◆ getGeometry() [2/2]

BGeometryBase & MultipoleTStraight::getGeometry ( )
inlineoverridevirtual

Return the cell geometry

Implements MultipoleTBase.

Definition at line 89 of file MultipoleTStraight.h.

References straightGeometry_m.

◆ getScaleFactor()

double MultipoleTStraight::getScaleFactor ( double ,
double  )
inlineoverridevirtual

Returns the scale factor \( h_s = 1\)

Parameters
x-> Coordinate x
s-> Coordinate s

Implements MultipoleTBase.

Definition at line 100 of file MultipoleTStraight.h.

◆ initialise()

void MultipoleTStraight::initialise ( )
overridevirtual

Initialise the element

Implements MultipoleTBase.

Definition at line 37 of file MultipoleTStraight.cpp.

References MultipoleTBase::element_m, and straightGeometry_m.

◆ localCartesianRotation()

virtual double MultipoleTBase::localCartesianRotation ( )
inlinevirtualinherited

Reimplemented in MultipoleTCurvedVarRadius.

Definition at line 136 of file MultipoleTBase.h.

◆ localCartesianToOpalCartesian()

Vector_t MultipoleTStraight::localCartesianToOpalCartesian ( const Vector_t & r)
overridevirtual

Implements MultipoleTBase.

Definition at line 82 of file MultipoleTStraight.cpp.

References MultipoleTBase::element_m.

◆ setMaxOrder()

virtual void MultipoleTBase::setMaxOrder ( size_t ,
size_t  )
inlinevirtualinherited

Set the number of terms used in calculation of field components

Parameters
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.

◆ transformBField()

void MultipoleTStraight::transformBField ( Vector_t & ,
const Vector_t &  )
inlineoverridevirtual

Transform B-field from Frenet-Serret coordinates to lab coordinates

Implements MultipoleTBase.

Definition at line 95 of file MultipoleTStraight.h.

◆ transformCoords()

void MultipoleTStraight::transformCoords ( Vector_t & R)
overridevirtual

Transform to Frenet-Serret coordinates for sector magnets

Implements MultipoleTBase.

Definition at line 86 of file MultipoleTStraight.cpp.

References MultipoleTBase::element_m.

Member Data Documentation

◆ element_m

◆ straightGeometry_m

StraightGeometry MultipoleTStraight::straightGeometry_m
private

Geometry

Definition at line 122 of file MultipoleTStraight.h.

Referenced by getGeometry(), getGeometry(), and initialise().


The documentation for this class was generated from the following files: