OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
MultipoleTBase Class Referenceabstract

#include <MultipoleTBase.h>

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

Public Member Functions

 MultipoleTBase ()
 
 MultipoleTBase (const std::string &name)
 
 MultipoleTBase (const MultipoleTBase &right)
 
 ~MultipoleTBase ()
 
EMFieldgetField ()
 
const EMFieldgetField () 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 initialise (PartBunchBase< double, 3 > *, double &startField, double &endField)
 
void finalise ()
 
bool bends () const
 
double getDipoleConstant () const
 
void setDipoleConstant (const double &B0)
 
std::size_t getMaxOrder () const
 
virtual void setMaxOrder (const std::size_t &maxOrder)
 
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)
 
virtual void setBendAngle (const double &angle)
 
virtual double getBendAngle () const
 
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 void addKR (int i, double t, Vector_t &K)
 
virtual void addKT (int i, double t, Vector_t &K)
 
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 &R, const double &t, Vector_t &A, double &phi)
 
virtual double getDesignEnergy () const
 
virtual void setDesignEnergy (const double &energy, bool changeable)
 
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 ElementBasegetDesign () 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 BGeometryBasegetGeometry ()=0
 Get geometry. More...
 
virtual const BGeometryBasegetGeometry () const =0
 Get geometry. More...
 
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 ChannelgetChannel (const std::string &aKey, bool create=false)
 Construct a read/write channel. More...
 
virtual const ConstChannelgetConstChannel (const std::string &aKey) const
 Construct a read-only channel. More...
 
virtual ElementImagegetImage () const
 Construct an image. More...
 
virtual void accept (BeamlineVisitor &visitor) const =0
 Apply visitor. More...
 
virtual ElementBaseclone () const =0
 Return clone. More...
 
virtual ElementBasecopyStructure ()
 Make a structural copy. More...
 
bool isSharable () const
 Test if the element can be shared. More...
 
virtual void makeSharable ()
 Set sharable flag. More...
 
virtual ElementBasemakeAlignWrapper ()
 Allow misalignment. More...
 
virtual ElementBasemakeFieldWrapper ()
 Allow field errors. More...
 
virtual ElementBasemakeWrappers ()
 Allow errors. More...
 
virtual ElementBaseremoveAlignWrapper ()
 Remove align wrapper. More...
 
virtual const ElementBaseremoveAlignWrapper () const
 Remove align wrapper. More...
 
virtual ElementBaseremoveFieldWrapper ()
 Remove field wrapper. More...
 
virtual const ElementBaseremoveFieldWrapper () const
 Remove field wrapper. More...
 
virtual ElementBaseremoveWrappers ()
 Return the design element. More...
 
virtual const ElementBaseremoveWrappers () const
 Return the design element. More...
 
bool update (const AttributeSet &)
 Update element. More...
 
virtual void setBoundaryGeometry (BoundaryGeometry *geo)
 
virtual BoundaryGeometrygetBoundaryGeometry () 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 WakeFunctiongetWake () 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
 
ElemType getElType () const
 returns element type as enumeration needed in the envelope tracker More...
 
void setElType (ElemType elt)
 set the element type as enumeration needed in the envelope tracker More...
 
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 (double x, double y, double s)
 
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
 
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...
 

Protected Member Functions

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, double f=1) const
 
- Protected Member Functions inherited from RCObject
 RCObject ()
 Default constructor. More...
 
 RCObject (const RCObject &)
 Copy constructor. More...
 
virtual ~RCObject ()=0
 
RCObjectoperator= (const RCObject &right)
 

Private Member Functions

Vector_t rotateFrame (const Vector_t &R)
 
Vector_t rotateFrameInverse (Vector_t &B)
 
virtual void transformCoords (Vector_t &R)=0
 
virtual void transformBField (Vector_t &B, const Vector_t &R)=0
 
virtual double getBx (const Vector_t &R)
 
double getBz (const Vector_t &R)
 
virtual double getBs (const Vector_t &R)
 
bool insideAperture (const Vector_t &R)
 
virtual double getRadius (const double &s)=0
 
virtual double getScaleFactor (const double &x, const double &s)=0
 
double getFnDerivX (const std::size_t &n, const double &x, const double &s)
 
double getFnDerivS (const std::size_t &n, const double &x, const double &s)
 
virtual double getFn (const std::size_t &n, const double &x, const double &s)=0
 

Private Attributes

endfieldmodel::Tanh fringeField_l
 
endfieldmodel::Tanh fringeField_r
 
std::size_t maxOrder_m
 
std::size_t transMaxOrder_m = 0
 
std::vector< double > transProfile_m
 
double length_m
 
double entranceAngle_m
 
double rotation_m
 
double boundingBoxLength_m
 
double verticalApert_m
 
double horizontalApert_m
 
BMultipoleField dummy
 

Additional Inherited Members

- Public Types inherited from ElementBase
enum  ApertureType { RECTANGULAR, ELLIPTICAL, CONIC_RECTANGULAR, CONIC_ELLIPTICAL }
 
enum  ElementType {
  ALIGNWRAPPER, BEAMBEAM, BEAMBEAM3D, BEAMLINE,
  BEAMSTRIPPING, CCOLLIMATOR, CORRECTOR, CORRECTORWRAPPER,
  CYCLOTRON, CYCLOTRONWRAPPER, CYCLOTRONVALLEY, DEGRADER,
  DIAGNOSTIC, DRIFT, FLEXIBLECOLLIMATOR, INTEGRATOR,
  LAMBERTSON, MARKER, MONITOR, MPSPLITINTEGRATOR,
  MULTIPOLE, MULTIPOLET, MULTIPOLEWRAPPER, OFFSET,
  PARALLELPLATE, PATCH, PROBE, RBEND,
  RBEND3D, RBENDWRAPPER, RFCAVITY, RFQUADRUPOLE,
  RING, SBEND3D, SBEND, SBENDWRAPPER,
  SEPARATOR, SEPTUM, SOLENOID, SOURCE,
  STRIPPER, TRAVELINGWAVE, VARIABLERFCAVITY, ANY
}
 
- Static Public Member Functions inherited from ElementBase
static std::string getTypeString (ElementType type)
 
- 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
 

Detailed Description


MultipoleTBase is a base class for a straight or curved 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 86 of file MultipoleTBase.h.

Constructor & Destructor Documentation

MultipoleTBase::MultipoleTBase ( )

Default constructor

Definition at line 36 of file MultipoleTBase.cpp.

MultipoleTBase::MultipoleTBase ( const std::string &  name)
explicit

Constructor

Parameters
name-> User-defined name

Definition at line 40 of file MultipoleTBase.cpp.

MultipoleTBase::MultipoleTBase ( const MultipoleTBase right)

Copy constructor

Definition at line 54 of file MultipoleTBase.cpp.

References Component::RefPartBunch_m.

MultipoleTBase::~MultipoleTBase ( )

Destructor

Definition at line 71 of file MultipoleTBase.cpp.

Member Function Documentation

bool MultipoleTBase::apply ( const Vector_t R,
const Vector_t P,
const double &  t,
Vector_t E,
Vector_t B 
)
virtual

Calculate the field at some arbitrary position
If particle is outside field map true is returned, otherwise false is returned

Parameters
R-> Position in the lab coordinate system of the multipole
P-> Not used
t-> Time at which the field is to be calculated
E-> Calculated electric field - always 0 (no E-field)
B-> Calculated magnetic field

Rotate coordinates around the central axis of the magnet

Go to local Frenet-Serret coordinates

Calculate B-field in the local Frenet-Serret frame

Transform B-field from local to lab coordinates

Reimplemented from Component.

Definition at line 74 of file MultipoleTBase.cpp.

References getBs(), getBx(), getBz(), insideAperture(), rotateFrame(), transformBField(), and transformCoords().

Referenced by apply().

Here is the call graph for this function:

bool MultipoleTBase::apply ( const size_t &  i,
const double &  t,
Vector_t E,
Vector_t B 
)
inlinevirtual

Calculate the field at the position of the ith particle

Parameters
i-> Index of the particle event; field is calculated at this position If particle is outside field map true is returned, otherwise false is returned
t-> Time at which the field is to be calculated
E-> Calculated electric field - always 0 (no E-field)
B-> Calculated magnetic field

Reimplemented from Component.

Definition at line 335 of file MultipoleTBase.h.

References apply(), PartBunchBase< T, Dim >::P, PartBunchBase< T, Dim >::R, and Component::RefPartBunch_m.

Here is the call graph for this function:

bool MultipoleTBase::bends ( ) const
inlinevirtual

Return true if dipole component not zero

Implements Component.

Definition at line 454 of file MultipoleTBase.h.

References transProfile_m.

void MultipoleTBase::finalise ( )
inlinevirtual

Finalise the MultipoleT - sets bunch to NULL

Implements Component.

Definition at line 331 of file MultipoleTBase.h.

References Component::RefPartBunch_m.

std::vector< double > MultipoleTBase::getAperture ( ) const
inline
double MultipoleTBase::getBendAngle ( ) const
inlinevirtual

Get the bending angle of the magnet

Reimplemented in MultipoleTCurvedVarRadius, and MultipoleTCurvedConstRadius.

Definition at line 343 of file MultipoleTBase.h.

double MultipoleTBase::getBoundingBoxLength ( ) const
inline
double MultipoleTBase::getBs ( const Vector_t R)
privatevirtual

Returns the component of the field along the central axis
Returns zero far outside fringe field \( Bs = sum_n z^(2n+1) / (2n+1)! \partial_s f_n / h_s \)

Reimplemented in MultipoleTStraight.

Definition at line 171 of file MultipoleTBase.cpp.

References Physics::e, fabs(), getFnDerivS(), getFringeDeriv(), getMaxOrder(), getScaleFactor(), and Hypervolume::n.

Referenced by apply().

Here is the call graph for this function:

double MultipoleTBase::getBx ( const Vector_t R)
privatevirtual

Returns the radial component of the field
Returns zero far outside fringe field \( Bx = sum_n z^(2n+1) / (2n+1)! * \partial_x f_n \)

Reimplemented in MultipoleTStraight.

Definition at line 156 of file MultipoleTBase.cpp.

References Physics::e, fabs(), getFnDerivX(), getFringeDeriv(), getMaxOrder(), and Hypervolume::n.

Referenced by apply().

Here is the call graph for this function:

double MultipoleTBase::getBz ( const Vector_t R)
private

Returns the vertical field component
Returns zero far outside fringe field \( Bz = sum_n f_n * z^(2n) / (2n)! \)

Definition at line 142 of file MultipoleTBase.cpp.

References Physics::e, fabs(), getFn(), getFringeDeriv(), getMaxOrder(), and Hypervolume::n.

Referenced by apply().

Here is the call graph for this function:

void MultipoleTBase::getDimensions ( double &  zBegin,
double &  zEnd 
) const
inlinevirtual

Not implemented

Implements Component.

Definition at line 466 of file MultipoleTBase.h.

double MultipoleTBase::getDipoleConstant ( ) const
inline

Get the dipole constant B_0

Definition at line 368 of file MultipoleTBase.h.

References transProfile_m.

double MultipoleTBase::getEntranceAngle ( ) const
inline
EMField & MultipoleTBase::getField ( )
inlinevirtual

Return a dummy field value

Implements Component.

Definition at line 458 of file MultipoleTBase.h.

References dummy.

const EMField & MultipoleTBase::getField ( ) const
inlinevirtual

Return a dummy field value

Implements Component.

Definition at line 462 of file MultipoleTBase.h.

References dummy.

virtual double MultipoleTBase::getFn ( const std::size_t &  n,
const double &  x,
const double &  s 
)
privatepure virtual

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

Implemented in MultipoleTCurvedVarRadius, MultipoleTCurvedConstRadius, and MultipoleTStraight.

Referenced by getBz(), getFnDerivS(), and getFnDerivX().

double MultipoleTBase::getFnDerivS ( const std::size_t &  n,
const double &  x,
const double &  s 
)
private

Calculate partial derivative of fn wrt s using a 5-point finite difference formula Error of order stepSize^4

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

Definition at line 239 of file MultipoleTBase.cpp.

References Physics::e, getFn(), getFringeDeriv(), and getTransDeriv().

Referenced by getBs().

Here is the call graph for this function:

double MultipoleTBase::getFnDerivX ( const std::size_t &  n,
const double &  x,
const double &  s 
)
private

Calculate partial derivative of fn wrt x using a 5-point finite difference formula Error of order stepSize^4

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

Definition at line 223 of file MultipoleTBase.cpp.

References Physics::e, getFn(), getFringeDeriv(), and getTransDeriv().

Referenced by getBx().

Here is the call graph for this function:

double MultipoleTBase::getFringeDeriv ( const std::size_t &  n,
const double &  s 
)
protected
std::vector< double > MultipoleTBase::getFringeLength ( ) const
inline
double MultipoleTBase::getLength ( ) const
inline
std::size_t MultipoleTBase::getMaxOrder ( ) const
inline
virtual double MultipoleTBase::getRadius ( const double &  s)
privatepure virtual

Radius of curvature

Parameters
s-> Coordinate s

Implemented in MultipoleTCurvedVarRadius, MultipoleTCurvedConstRadius, and MultipoleTStraight.

double MultipoleTBase::getRotation ( ) const
inline
virtual double MultipoleTBase::getScaleFactor ( const double &  x,
const double &  s 
)
privatepure virtual

Returns the scale factor \( h_s = 1 + x / \rho(s) \)

Parameters
x-> Coordinate x
s-> Coordinate s

Implemented in MultipoleTCurvedVarRadius, MultipoleTCurvedConstRadius, and MultipoleTStraight.

Referenced by getBs().

double MultipoleTBase::getTransDeriv ( const std::size_t &  n,
const double &  x 
)
protected

Returns the value of the transverse field n-th derivative at x
Transverse field is a polynomial in x, differentiation follows usual polynomial rules of differentiation

Parameters
n-> nth derivative
x-> Coordinate x

Definition at line 199 of file MultipoleTBase.cpp.

References getTransMaxOrder(), getTransProfile(), Hypervolume::n, and transMaxOrder_m.

Referenced by MultipoleTStraight::getBs(), MultipoleTStraight::getBx(), MultipoleTStraight::getFn(), MultipoleTCurvedConstRadius::getFn(), MultipoleTCurvedVarRadius::getFn(), getFnDerivS(), and getFnDerivX().

Here is the call graph for this function:

std::size_t MultipoleTBase::getTransMaxOrder ( ) const
inline
double MultipoleTBase::getTransProfile ( const std::size_t &  n) const
inline
std::vector< double > MultipoleTBase::getTransProfile ( ) const
inline

Get all terms of transverse profile

Definition at line 364 of file MultipoleTBase.h.

References transProfile_m.

Referenced by getTransDeriv().

void MultipoleTBase::initialise ( PartBunchBase< double, 3 > *  bunch,
double &  startField,
double &  endField 
)
inlinevirtual

Initialise the MultipoleT

Parameters
bunch-> Bunch the global bunch object
startField-> Not used
endField-> Not used

Implements Component.

Reimplemented in MultipoleTCurvedVarRadius, MultipoleTCurvedConstRadius, and MultipoleTStraight.

Definition at line 449 of file MultipoleTBase.h.

bool MultipoleTBase::insideAperture ( const Vector_t R)
inlineprivate

Tests if inside the magnet

Parameters
R-> Coordinate vector

Definition at line 351 of file MultipoleTBase.h.

References fabs(), horizontalApert_m, and verticalApert_m.

Referenced by apply().

Here is the call graph for this function:

Vector_t MultipoleTBase::rotateFrame ( const Vector_t R)
private

Rotate frame for skew elements
Consecutive rotations: 1st -> about central axis 2nd -> azimuthal rotation

Parameters
R-> Vector to be rotated

Apply two 2D rotation matrices to coordinate vector Rotate around central axis => skew fields Rotate azymuthaly => entrance angle

Definition at line 98 of file MultipoleTBase.cpp.

References cos(), entranceAngle_m, rotation_m, and sin().

Referenced by apply().

Here is the call graph for this function:

Vector_t MultipoleTBase::rotateFrameInverse ( Vector_t B)
private

Inverse of the 1st rotation in rotateFrame() method
Used to rotate B field back to global coordinate system

This function represents the inverse of the rotation around the central axis performed by rotateFrame() method Used to rotate B field back to global coordinate system

Definition at line 118 of file MultipoleTBase.cpp.

References cos(), rotation_m, and sin().

Here is the call graph for this function:

void MultipoleTBase::setAperture ( const double &  vertAp,
const double &  horizAp 
)
inline

Set the aperture dimensions
This element only supports a rectangular aperture

Parameters
vertAp-> Vertical aperture length
horizAp-> Horisontal aperture length

Definition at line 429 of file MultipoleTBase.h.

References horizontalApert_m, and verticalApert_m.

Referenced by OpalMultipoleTStraight::update(), OpalMultipoleTCurvedConstRadius::update(), and OpalMultipoleTCurvedVarRadius::update().

void MultipoleTBase::setBendAngle ( const double &  angle)
inlinevirtual

Set the bending angle of the magnet

Reimplemented in MultipoleTCurvedVarRadius, and MultipoleTCurvedConstRadius.

Definition at line 340 of file MultipoleTBase.h.

void MultipoleTBase::setBoundingBoxLength ( const double &  boundingBoxLength)
inline

Set distance between centre of magnet and enctrance

Parameters
boundingBoxLength-> Distance between centre and entrance

Definition at line 409 of file MultipoleTBase.h.

References boundingBoxLength_m.

Referenced by OpalMultipoleTStraight::update(), OpalMultipoleTCurvedConstRadius::update(), and OpalMultipoleTCurvedVarRadius::update().

void MultipoleTBase::setDipoleConstant ( const double &  B0)
inline

Set the dipole constant B_0

Definition at line 422 of file MultipoleTBase.h.

References transMaxOrder_m, and transProfile_m.

void MultipoleTBase::setEntranceAngle ( const double &  entranceAngle)
inline

Set the entrance angle

Parameters
entranceAngle-> Entrance angle

Definition at line 347 of file MultipoleTBase.h.

References entranceAngle_m.

Referenced by OpalMultipoleTStraight::update(), OpalMultipoleTCurvedConstRadius::update(), and OpalMultipoleTCurvedVarRadius::update().

bool MultipoleTBase::setFringeField ( const double &  s0,
const double &  lambda_left,
const double &  lambda_right 
)

Set fringe field model
Tanh model used here

\[ 1/2 * \left [tanh \left( \frac{s + s_0}{\lambda_{left}} \right) - tanh \left( \frac{s - s_0}{\lambda_{right}} \right) \right] \]

Parameters
s0-> Centre field length and {left} -> Left end field length {right} -> Right end field length

Definition at line 130 of file MultipoleTBase.cpp.

References fringeField_l, fringeField_r, and maxOrder_m.

Referenced by OpalMultipoleTStraight::update(), OpalMultipoleTCurvedConstRadius::update(), and OpalMultipoleTCurvedVarRadius::update().

void MultipoleTBase::setLength ( const double &  length)
inline

Set the length of the magnet If straight-> Actual length If curved -> Arc length

Definition at line 397 of file MultipoleTBase.h.

References abs(), and length_m.

Referenced by OpalMultipoleTStraight::update(), OpalMultipoleTCurvedConstRadius::update(), and OpalMultipoleTCurvedVarRadius::update().

Here is the call graph for this function:

void MultipoleTBase::setMaxOrder ( const std::size_t &  maxOrder)
inlinevirtual

Set the number of terms used in calculation of field components
Maximum power of z in Bz is 2 * maxOrder_m

Parameters
maxOrder-> Number of terms in expansion in z

Reimplemented in MultipoleTCurvedVarRadius, MultipoleTCurvedConstRadius, and MultipoleTStraight.

Definition at line 372 of file MultipoleTBase.h.

References maxOrder_m.

Referenced by MultipoleTStraight::setMaxOrder(), MultipoleTCurvedConstRadius::setMaxOrder(), and MultipoleTCurvedVarRadius::setMaxOrder().

void MultipoleTBase::setRotation ( const double &  rot)
inline

Set the angle of rotation of the magnet around its axis
To make skew components

Parameters
rot-> Angle of rotation

Definition at line 393 of file MultipoleTBase.h.

References rotation_m.

Referenced by OpalMultipoleTStraight::update(), OpalMultipoleTCurvedConstRadius::update(), and OpalMultipoleTCurvedVarRadius::update().

void MultipoleTBase::setTransMaxOrder ( const std::size_t &  transMaxOrder)
inline

Set the maximum order in the given transverse profile

Parameters
transMaxOrder-> Highest power of x in field expansion

Definition at line 384 of file MultipoleTBase.h.

References transMaxOrder_m, and transProfile_m.

Referenced by OpalMultipoleTStraight::update(), OpalMultipoleTCurvedConstRadius::update(), and OpalMultipoleTCurvedVarRadius::update().

void MultipoleTBase::setTransProfile ( const std::size_t &  n,
const double &  Bn 
)
inline

Set transverse profile T(x) T(x) = B_0 + B1 x + B2 x^2 + B3 x^3 + ...

Parameters
n-> Order of the term (d^n/dx^n) to be set
Bn-> Value of transverse profile coefficient

Definition at line 413 of file MultipoleTBase.h.

References Hypervolume::n, transMaxOrder_m, and transProfile_m.

Referenced by OpalMultipoleTStraight::update(), OpalMultipoleTCurvedConstRadius::update(), and OpalMultipoleTCurvedVarRadius::update().

virtual void MultipoleTBase::transformBField ( Vector_t B,
const Vector_t R 
)
privatepure virtual

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

Implemented in MultipoleTCurvedVarRadius, MultipoleTCurvedConstRadius, and MultipoleTStraight.

Referenced by apply().

virtual void MultipoleTBase::transformCoords ( Vector_t R)
privatepure virtual

Transform to Frenet-Serret coordinates for sector magnets

Implemented in MultipoleTCurvedVarRadius, MultipoleTCurvedConstRadius, and MultipoleTStraight.

Referenced by apply().

Member Data Documentation

double MultipoleTBase::boundingBoxLength_m
private

Distance between centre of magnet and entrance

Definition at line 265 of file MultipoleTBase.h.

Referenced by getBoundingBoxLength(), and setBoundingBoxLength().

BMultipoleField MultipoleTBase::dummy
private

Not implemented

Definition at line 285 of file MultipoleTBase.h.

Referenced by getField().

double MultipoleTBase::entranceAngle_m
private

Definition at line 262 of file MultipoleTBase.h.

Referenced by getEntranceAngle(), rotateFrame(), and setEntranceAngle().

endfieldmodel::Tanh MultipoleTBase::fringeField_l
private

Definition at line 237 of file MultipoleTBase.h.

Referenced by getFringeDeriv(), getFringeLength(), and setFringeField().

endfieldmodel::Tanh MultipoleTBase::fringeField_r
private

Definition at line 238 of file MultipoleTBase.h.

Referenced by getFringeDeriv(), getFringeLength(), and setFringeField().

double MultipoleTBase::horizontalApert_m
private

Definition at line 283 of file MultipoleTBase.h.

Referenced by getAperture(), insideAperture(), and setAperture().

double MultipoleTBase::length_m
private

Magnet parameters

Definition at line 261 of file MultipoleTBase.h.

Referenced by getLength(), and setLength().

std::size_t MultipoleTBase::maxOrder_m
private

Number of terms in z expansion used in calculating field components

Definition at line 240 of file MultipoleTBase.h.

Referenced by getMaxOrder(), setFringeField(), and setMaxOrder().

double MultipoleTBase::rotation_m
private

Definition at line 263 of file MultipoleTBase.h.

Referenced by getRotation(), rotateFrame(), rotateFrameInverse(), and setRotation().

std::size_t MultipoleTBase::transMaxOrder_m = 0
private

Highest power in given mid-plane field

Definition at line 242 of file MultipoleTBase.h.

Referenced by getTransDeriv(), getTransMaxOrder(), setDipoleConstant(), setTransMaxOrder(), and setTransProfile().

std::vector<double> MultipoleTBase::transProfile_m
private

List of transverse profile coefficients

Definition at line 244 of file MultipoleTBase.h.

Referenced by bends(), getDipoleConstant(), getTransProfile(), setDipoleConstant(), setTransMaxOrder(), and setTransProfile().

double MultipoleTBase::verticalApert_m
private

Assume rectangular aperture with these dimensions

Definition at line 282 of file MultipoleTBase.h.

Referenced by getAperture(), insideAperture(), and setAperture().


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