30#include "gsl/gsl_sf_pow_int.h"
34 planarArcGeometry_m(1.0, 1.0) {
79 double ds = radius *
std::sin(theta);
80 double dx = radius * (1 -
std::cos(theta));
97 for (std::size_t j = 0;
101 for (std::size_t i = 0;
107 func += (
recursion_m.at(
n).evaluatePolynomial(x / rho, i, j)
109 / gsl_sf_pow_int(rho, 2 *
static_cast<int>(
n) -
static_cast<int>(i) -
110 2 *
static_cast<int>(j));
113 func *= gsl_sf_pow_int(-1.0,
static_cast<int>(
n));
Tps< T > cos(const Tps< T > &x)
Cosine.
Tps< T > sin(const Tps< T > &x)
Sine.
PETE_TUTree< FnArcTan, typename T::PETE_Expr_t > atan(const PETE_Expr< T > &l)
constexpr double alpha
The fine structure constant, no dimension.
std::size_t getTransMaxOrder() const
Get the maximum order in the given transverse profile.
size_t getMaxFOrder() const
Get the number of terms used in calculation of field components.
double getFringeDeriv(const std::size_t &n, const double &s)
Returns the value of the fringe field n-th derivative at s.
double getLength() const
Get the length of the magnet.
double getTransDeriv(const std::size_t &n, const double &x) const
Returns the value of the transverse field n-th derivative at x Transverse field is a polynomial in x...
size_t getMaxXOrder() const
double getBendAngle() const
Get the bending angle of the magnet.
std::vector< polynomial::RecursionRelation > recursion_m
Object for storing differential operator acting on Fn.
void setMaxOrder(size_t orderZ, size_t orderX) override
Set the number of terms used in calculation of field components Maximum power of z in Bz is 2 * maxO...
Vector_t localCartesianToOpalCartesian(const Vector_t &r) override
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 te...
double getScaleFactor(double x, double s) override
Returns the scale factor .
PlanarArcGeometry planarArcGeometry_m
Geometry.
MultipoleTCurvedConstRadius(MultipoleT *element)
Constructor.
void initialise() override
Initialise the element.
void transformBField(Vector_t &, const Vector_t &) override
Transform B-field from Frenet-Serret coordinates to lab coordinates.
void transformCoords(Vector_t &) override
Transform to Frenet-Serret coordinates for sector magnets.
void resizeX(const std::size_t &xDerivatives)
Change number of x-derivatives to xDerivatives.
void truncate(std::size_t highestXorder)
Truncate series in x at highestXorder.
void setCurvature(double)
Set curvature.
virtual void setElementLength(double)
Set length.