#include <BCyl.h>
Public Member Functions | |
BCycl (BCylParam< T > const &ipar) | |
void | compute (T r2, T z, T &Br, T &Bz) const |
void | operator() (T r2, T z, T &Br, T &Bz) const |
Private Attributes | |
BCylParam< T > | pars |
magfieldparam::BCycl< T >::BCycl | ( | BCylParam< T > const & | ipar | ) | [inline] |
void magfieldparam::BCycl< T >::compute | ( | T | r2, |
T | z, | ||
T & | Br, | ||
T & | Bz | ||
) | const [inline] |
Definition at line 79 of file BCyl.h.
{ using namespace bcylDetails; // if (r<1.15&&fabs(z)<2.8) // NOTE: check omitted, is done already by the wrapper! (NA) z-=pars.prm[3]; // max Bz point is shifted in z T az=std::abs(z); T zainv=z*pars.ainv; T u=pars.hlova-zainv; T v=pars.hlova+zainv; T fu[4],gv[4]; ffunkti(u,fu); ffunkti(v,gv); T rat=T(0.5)*pars.ainv; T rat2=rat*rat*r2; Br=pars.hb0*rat*(fu[1]-gv[1]-(fu[3]-gv[3])*rat2*T(0.5)); Bz=pars.hb0*(fu[0]+gv[0]-(fu[2]+gv[2])*rat2); T corBr= pars.prm[4]*z*(az-pars.prm[5])*(az-pars.prm[5]); T corBz=-pars.prm[6]*( myExp(-(z-pars.prm[7])*(z-pars.prm[7])*pars.coeff) + myExp(-(z+pars.prm[7])*(z+pars.prm[7])*pars.coeff) ); // double Gaussian Br+=corBr; Bz+=corBz; }