OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Public Member Functions | Private Attributes | List of all members
MultipoleTStraight Class Reference

#include <MultipoleTStraight.h>

Inheritance diagram for MultipoleTStraight:
Inheritance graph
[legend]
Collaboration diagram for MultipoleTStraight:
Collaboration graph
[legend]

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
 
- Public Member Functions inherited from MultipoleTBase
 MultipoleTBase (MultipoleT *element)
 
virtual ~MultipoleTBase ()=default
 
double getBz (const Vector_t &R)
 
virtual void setMaxOrder (size_t, size_t)
 
virtual double localCartesianRotation ()
 

Private Attributes

StraightGeometry straightGeometry_m
 

Additional Inherited Members

- Protected Attributes inherited from MultipoleTBase
MultipoleTelement_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.

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

Here is the call graph for this function:

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

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

Here is the call graph for this function:

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

Here is the call graph for this function:

◆ localCartesianToOpalCartesian()

Vector_t MultipoleTStraight::localCartesianToOpalCartesian ( const Vector_t r)
overridevirtual

Implements MultipoleTBase.

Definition at line 82 of file MultipoleTStraight.cpp.

References MultipoleTBase::element_m, and MultipoleT::getLength().

Here is the call graph for this function:

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

Here is the call graph for this function:

Member Data Documentation

◆ 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: