18#ifndef ABSBEAMLINE_MULTIPOLET_STRAIGHT_H
19#define ABSBEAMLINE_MULTIPOLET_STRAIGHT_H
85 double scaling)
override;
94 template <
class ViewType>
109template <
class ViewType>
118 if (insideAperture && insideBoundingBox) {
120 Kokkos::Array<double, MaxDerivatives> dt;
121 Kokkos::Array<double, MaxDerivatives> ds;
126 tanhCoefficients, ds);
127 for (
unsigned int n = 0; n <= config.
maxFOrder_m; n++) {
131 for (
unsigned int i = 0; i <= n; i++) {
133 innerSumX += k * dt[2 * i + 1] * ds[2 * n - 2 * i];
134 innerSumZ += k * dt[2 * i] * ds[2 * n - 2 * i];
135 innerSumS += k * dt[2 * i] * ds[2 * n - 2 * i + 1];
141 myB[0] += innerSumX * xszk;
142 myB[1] += innerSumZ * zzk;
143 myB[2] += innerSumS * xszk;
147 return !insideAperture;
ippl::Vector< T, Dim > Vector_t
Abstract base class for accelerator geometry classes.
static KOKKOS_INLINE_FUNCTION Vector_t< double, 3 > rotateFrame(const Vector_t< double, 3 > &R, const MultipoleTConfig &config)
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)
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 double factorial(unsigned int n)
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)
StraightGeometry straightGeometry_m
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
static KOKKOS_INLINE_FUNCTION Vector_t< double, 3 > toMagnetCoords(const Vector_t< double, 3 > &R, const MultipoleTConfig &config)
BGeometryBase * getGeometry() override
void initialise() override
A geometry representing a straight line.
double horizontalAperture_m
double fringeLambdaRight_m
double verticalAperture_m
Kokkos::Array< double, NumPoles > transverseProfile_m
double fringeLambdaLeft_m
double boundingBoxLength_m