36 { B =
normal; A = skewed; }
40 { B = rhs.
B; A = rhs.
A; }
48 { B = rhs.
B; A = rhs.
A; }
53 {
return Pair(B + rhs.
B, A + rhs.
A); }
58 {
return Pair(B - rhs.
B, A - rhs.
A); }
67 { B += rhs.
B; A += rhs.
A; }
71 { B -= rhs.
B; A -= rhs.
A; }
79 {
return Pair(- B, - A); }
93 itsOrder(rhs.itsOrder) {
127 std::complex<double>
X(point.
getX(), point.
getY());
129 std::complex<double> B(
pairs[i].B,
pairs[i].A);
132 B =
X * B / double(i + 1) + std::complex<double>(
pairs[i].B,
pairs[i].A);
146 throw LogicalError(
"BMultipoleField::setNormalComponent()",
147 "Field order should be > 0.");
157 throw LogicalError(
"BMultipoleField::setSkewComponent()",
158 "Field order should be > 0.");
FLieGenerator< T, N > imag(const FLieGenerator< std::complex< T >, N > &)
Take imaginary part of a complex generator.
FLieGenerator< T, N > real(const FLieGenerator< std::complex< T >, N > &)
Take real part of a complex generator.
The magnetic field of a multipole.
BMultipoleField & addField(const BMultipoleField &field)
Add to field.
virtual BVector Bfield(const Point3D &P) const
Get field.
BMultipoleField & operator=(const BMultipoleField &)
BMultipoleField & subtractField(const BMultipoleField &field)
Subtract from field.
BMultipoleField()
Default constructor.
void scale(double scalar)
Scale the field.
virtual ~BMultipoleField()
void setNormalComponent(int n, double Bn)
Set component.
void setSkewComponent(int n, double Bn)
Set component.
double normal(int) const
Get component.
Pair operator+(const Pair &) const
void operator*=(double scale)
void operator-=(const Pair &)
void operator=(const Pair &)
void operator+=(const Pair &)
Pair operator*(double scale) const
double getX() const
Return coordinate.
double getY() const
Return coordinate.