31 #include "gsl/gsl_sf_pow_int.h"
40 varRadiusGeometry_m(1.0, 1.0, 1.0, 1.0, 1.0),
47 maxOrderX_m(right.maxOrderX_m),
48 recursion_m(right.recursion_m),
49 varRadiusGeometry_m(right.varRadiusGeometry_m),
50 angle_m(right.angle_m) {
78 double prefactor = (length /
angle_m) *
79 (
tanh((length / 2) / fringeLength[0])
80 +
tanh((length / 2) / fringeLength[1]));
81 double theta = fringeLength[0] *
log(
cosh((
R[2]
82 + (length / 2)) / fringeLength[0]))
84 - (length / 2)) / fringeLength[1]));
86 double Bx = B[0], Bs = B[2];
87 B[0] = Bx *
cos(theta) - Bs *
sin(theta);
88 B[2] = Bx *
sin(theta) + Bs *
cos(theta);
94 while (maxOrder >= N) {
127 std::vector<double> fringeDerivatives;
128 for (std::size_t j = 0;
133 for (std::size_t i = 0;
137 for (std::size_t j = 0;
141 .evaluatePolynomial(x, y, i, j, fringeDerivatives)
142 * fringeDerivatives.at(j);
146 func *= gsl_sf_pow_int(-1.0,
n) * S_0 * rho;
Tps< T > log(const Tps< T > &x)
Natural logarithm.
Tps< T > cos(const Tps< T > &x)
Cosine.
Tps< T > cosh(const Tps< T > &x)
Hyperbolic cosine.
Tps< T > tanh(const Tps< T > &x)
Hyperbolic tangent.
Tps< T > sin(const Tps< T > &x)
Sine.
PartBunchBase< double, 3 > * RefPartBunch_m
std::size_t getTransMaxOrder() const
std::vector< double > getFringeLength() const
virtual void setMaxOrder(const std::size_t &maxOrder)
double getTransDeriv(const std::size_t &n, const double &x)
double getFringeDeriv(const std::size_t &n, const double &s)
std::vector< polynomial::RecursionRelationTwo > recursion_m
virtual double getScaleFactor(const double &x, const double &s) override
~MultipoleTCurvedVarRadius()
virtual void transformBField(Vector_t &B, const Vector_t &R) override
virtual double getRadius(const double &s) override
virtual void setMaxOrder(const std::size_t &maxOrder) override
virtual ElementBase * clone() const override
virtual void transformCoords(Vector_t &R) override
virtual double getFn(const std::size_t &n, const double &x, const double &s) override
MultipoleTCurvedVarRadius(const std::string &name)
std::vector< double > getTransformation() const
void truncate(std::size_t highestXorder)
void resizeX(const std::size_t &xDerivatives)