31#include <gsl/gsl_sf_gamma.h>
54 / gsl_sf_fact(2 *
n + 1);
66 / gsl_sf_fact(2 *
n + 1);
size_t getMaxFOrder() const
Get the number of terms used in calculation of field components.
double getFnDerivS(const std::size_t &n, const double &x, const double &s)
Calculate partial derivative of fn wrt s using a 5-point finite difference formula Error of order ste...
double getFnDerivX(const std::size_t &n, const double &x, const double &s)
Calculate partial derivative of fn wrt x using a 5-point finite difference formula Error of order ste...
double getBz(const Vector_t &R)
Returns the vertical field component Returns zero far outside fringe field .
virtual double getScaleFactor(double x, double s)=0
Returns the scale factor .
virtual double getBx(const Vector_t &R)
Returns the radial component of the field Returns zero far outside fringe field .
MultipoleTBase(MultipoleT *element)
Constructor.
virtual double getBs(const Vector_t &R)
Returns the component of the field along the central axis Returns zero far outside fringe field .
virtual double getFn(size_t n, double x, double s)=0
Calculate fn(x, s) by expanding the differential operator (from Laplacian and scalar potential) in te...