1 #ifndef ParametrizedEngine_BCyl_h
2 #define ParametrizedEngine_BCyl_h
23 namespace magfieldparam {
27 template <
typename... Args>
29 :
prm{std::forward<Args>(
init)...},
35 coeff(1 / (prm[8] * prm[8])) {}
41 namespace bcylDetails {
51 a =
T(1) / (
T(1) +
u2);
57 ff[3] = a2 * ff[1] * (
T(1) - 4 *
u2);
61 inline float myExp(
float x) {
return unsafe_expf<3>(x); }
74 using namespace bcylDetails;
78 T zainv = z * pars.ainv;
79 T u = pars.hlova - zainv;
80 T v = pars.hlova + zainv;
84 T rat =
T(0.5) * pars.ainv;
85 T rat2 = rat * rat *
r2;
86 Br = pars.hb0 * rat * (fu[1] - gv[1] - (fu[3] - gv[3]) * rat2 *
T(0.5));
87 Bz = pars.hb0 * (fu[0] + gv[0] - (fu[2] + gv[2]) * rat2);
89 T corBr = pars.prm[4] * z * (az - pars.prm[5]) * (az - pars.prm[5]);
90 T corBz = -pars.prm[6] * (
myExp(-(z - pars.prm[7]) * (z - pars.prm[7]) * pars.coeff) +
91 myExp(-(z + pars.prm[7]) * (z + pars.prm[7]) * pars.coeff));
Exp< T >::type exp(const T &t)
constexpr BCylParam(Args...init)
void operator()(T r2, T z, T &Br, T &Bz) const
float __attribute__((vector_size(8))) cms_float32x2_t
Abs< T >::type abs(const T &t)
void compute(T r2, T z, T &Br, T &Bz) const
void ffunkti(T u, T *__restrict__ ff) __attribute__((always_inline))
BCycl(BCylParam< T > const &ipar)