|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|
#include <MultipoleTCurvedConstRadius.h>


Public Member Functions | |
| MultipoleTCurvedConstRadius (MultipoleT *element) | |
| void | initialise () override |
| BGeometryBase * | getGeometry () override |
| void | getField (Kokkos::View< Vector_t< double, 3 > * > R, Kokkos::View< Vector_t< double, 3 > * > E, Kokkos::View< Vector_t< double, 3 > * > B, double scaling, size_t count) override |
| bool | getField (const Vector_t< double, 3 > &R, Vector_t< double, 3 > &E, Vector_t< double, 3 > &B, double scaling) override |
| void | generateTanhCoefficients (unsigned int numDerivatives) |
Static Public Member Functions | |
| static KOKKOS_INLINE_FUNCTION double | factorial (unsigned int n) |
| static KOKKOS_INLINE_FUNCTION double | powerInteger (double x, unsigned int n) |
| static KOKKOS_INLINE_FUNCTION void | calcTransverseDerivatives (const Kokkos::Array< double, MultipoleTConfig::NumPoles > &poles, unsigned int numDerivatives, double x, Kokkos::Array< double, MaxDerivatives > &derivatives) |
| template<class ViewType > | |
| static KOKKOS_INLINE_FUNCTION void | calcFringeDerivatives (const double &s0, const double &lambdaLeft, const double &lambdaRight, double s, const ViewType &tanhCoefficients, Kokkos::Array< double, MaxDerivatives > &derivatives) |
| static KOKKOS_INLINE_FUNCTION Vector_t< double, 3 > | rotateFrame (const Vector_t< double, 3 > &R, const MultipoleTConfig &config) |
| static KOKKOS_INLINE_FUNCTION void | calcPowers (double value, unsigned int maxPower, Kokkos::Array< double, MaxPowerInteger > &powers) |
Static Public Attributes | |
| static constexpr size_t | MaxFactorial = 20 |
| static constexpr size_t | MaxPowerInteger = 20 |
| static constexpr unsigned int | MaxDerivatives = 20 |
Protected Attributes | |
| MultipoleT * | element_m |
| Kokkos::View< double ** > | tanhCoefficientsGpu_m |
| Kokkos::View< double ** >::host_mirror_type | tanhCoefficientsHost_m |
Static Private Member Functions | |
| static KOKKOS_INLINE_FUNCTION Vector_t< double, 3 > | toMagnetCoords (const Vector_t< double, 3 > &R, const MultipoleTConfig &config) |
| template<class ViewType > | |
| static KOKKOS_INLINE_FUNCTION bool | computeBField (const Vector_t< double, 3 > &R, Vector_t< double, 3 > &B, double scaling, const MultipoleTConfig &config, const ViewType &tanhCoefficients) |
Private Attributes | |
| PlanarArcGeometry | planarArcGeometry_m |
MultipoleT defines a curved combined function magnet with constant radius
of curvature, (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 69 of file MultipoleTCurvedConstRadius.h.
|
explicit |
Constructor
Definition at line 21 of file MultipoleTCurvedConstRadius.cpp.
|
staticinherited |
Definition at line 186 of file MultipoleTBase.h.
Referenced by computeBField(), and MultipoleTStraight::computeBField().
|
staticinherited |
Definition at line 235 of file MultipoleTBase.h.
Referenced by computeBField().
|
staticinherited |
Helper function that calculates transverse derivatives for multipole fields
Definition at line 166 of file MultipoleTBase.h.
References MultipoleTConfig::NumPoles, and MultipoleTBase::powerInteger().
Referenced by computeBField(), and MultipoleTStraight::computeBField().

|
staticprivate |
Definition at line 117 of file MultipoleTCurvedConstRadius.h.
References MultipoleTConfig::bendAngle_m, MultipoleTConfig::boundingBoxLength_m, MultipoleTBase::calcFringeDerivatives(), MultipoleTBase::calcPowers(), MultipoleTBase::calcTransverseDerivatives(), MultipoleTBase::factorial(), MultipoleTConfig::fringeLambdaLeft_m, MultipoleTConfig::fringeLambdaRight_m, MultipoleTConfig::fringeS0_m, MultipoleTConfig::horizontalAperture_m, MultipoleTConfig::length_m, MultipoleTConfig::maxFOrder_m, MultipoleTBase::powerInteger(), toMagnetCoords(), MultipoleTConfig::transverseProfile_m, and MultipoleTConfig::verticalAperture_m.
Referenced by getField().

|
staticinherited |
Helper function that returns factorial of n for n<=20 on both host and GPU
Definition at line 126 of file MultipoleTBase.h.
References MultipoleTBase::MaxFactorial.
Referenced by computeBField(), and MultipoleTStraight::computeBField().
|
inherited |
Definition at line 23 of file MultipoleTBase.cpp.
References MultipoleTBase::tanhCoefficientsGpu_m, and MultipoleTBase::tanhCoefficientsHost_m.
Referenced by initialise(), and MultipoleTStraight::initialise().
|
overridevirtual |
Return the field for a single point
Implements MultipoleTBase.
Definition at line 43 of file MultipoleTCurvedConstRadius.cpp.
References computeBField(), MultipoleTBase::element_m, MultipoleT::getConfig(), and MultipoleTBase::tanhCoefficientsHost_m.

|
overridevirtual |
Return the field for an array of points
Implements MultipoleTBase.
|
inlineoverridevirtual |
Return the cell geometry
Implements MultipoleTBase.
Definition at line 76 of file MultipoleTCurvedConstRadius.h.
References planarArcGeometry_m.
|
overridevirtual |
Initialise the element
Implements MultipoleTBase.
Definition at line 24 of file MultipoleTCurvedConstRadius.cpp.
References MultipoleTBase::element_m, MultipoleTBase::generateTanhCoefficients(), MultipoleT::getBendAngle(), MultipoleT::getLength(), MultipoleT::getMaxFOrder(), planarArcGeometry_m, PlanarArcGeometry::setCurvature(), and PlanarArcGeometry::setElementLength().

|
staticinherited |
Helper function that returns x^n for 0<=n<=20 on both host and GPU
Definition at line 153 of file MultipoleTBase.h.
Referenced by MultipoleTBase::calcTransverseDerivatives(), computeBField(), and MultipoleTStraight::computeBField().
|
staticinherited |
Apply two 2D rotation matrices to coordinate vector Rotate around central axis => skew fields Rotate azimuthally => entrance angle
Definition at line 217 of file MultipoleTBase.h.
References MultipoleTConfig::entranceAngle_m, and MultipoleTConfig::rotation_m.
Referenced by toMagnetCoords(), and MultipoleTStraight::toMagnetCoords().
|
staticprivate |
Definition at line 99 of file MultipoleTCurvedConstRadius.h.
References MultipoleTConfig::bendAngle_m, MultipoleTConfig::length_m, and MultipoleTBase::rotateFrame().
Referenced by computeBField().

|
protectedinherited |
Definition at line 81 of file MultipoleTBase.h.
Referenced by getField(), MultipoleTStraight::getField(), initialise(), and MultipoleTStraight::initialise().
|
staticconstexprinherited |
Definition at line 103 of file MultipoleTBase.h.
Referenced by MultipoleT::validateConfiguration().
|
staticconstexprinherited |
Definition at line 101 of file MultipoleTBase.h.
Referenced by MultipoleTBase::factorial().
|
staticconstexprinherited |
Definition at line 102 of file MultipoleTBase.h.
|
private |
Geometry
Definition at line 88 of file MultipoleTCurvedConstRadius.h.
Referenced by getGeometry(), and initialise().
|
protectedinherited |
Definition at line 82 of file MultipoleTBase.h.
Referenced by MultipoleTBase::generateTanhCoefficients().
|
protectedinherited |
Definition at line 83 of file MultipoleTBase.h.
Referenced by MultipoleTBase::generateTanhCoefficients(), getField(), MultipoleTStraight::getField(), and MultipoleTBaseTest::tanhCoefficients().