OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
BDipoleField.h
Go to the documentation of this file.
1#ifndef OPALX_BDipoleField_HH
2#define OPALX_BDipoleField_HH
3
4// ------------------------------------------------------------------------
5// $RCSfile: BDipoleField.h,v $
6// ------------------------------------------------------------------------
7// $Revision: 1.1.1.1 $
8// ------------------------------------------------------------------------
9// Copyright: see Copyright.readme
10// ------------------------------------------------------------------------
11//
12// Class: BDipoleField
13//
14// ------------------------------------------------------------------------
15// Class category: Fields
16// ------------------------------------------------------------------------
17//
18// $Date: 2000/03/27 09:32:35 $
19// $Author: fci $
20//
21// ------------------------------------------------------------------------
22
23#include "Fields/ConstBField.h"
24
25// Class BDipoleField
26// ------------------------------------------------------------------------
28// A static magnetic dipole field in the (x,y)-plane.
29
30class BDipoleField : public ConstBField {
31public:
33 // Constructs a null field.
35
36 virtual ~BDipoleField();
37
39 // Return the time-independent part of the magnetic field in point [b]P[/b].
40 // This override forces implementation in derived classes.
41 virtual BVector Bfield(const Point3D& P) const;
42
44 // Return the magnetic field at time [b]t[/b] in point [b]P[/b].
45 // This override forces implementation in derived classes.
46 virtual BVector Bfield(const Point3D& P, double t) const;
47
49 // Return the horizontal component of the field in Teslas.
50 virtual double getBx() const;
51
53 // Return the vertical component of the field in Teslas.
54 virtual double getBy() const;
55
57 // Assign the horizontal component of the field in Teslas.
58 virtual void setBx(double Bx);
59
61 // Assign the vertical component of the field in Teslas.
62 virtual void setBy(double By);
63
65 // Add [b]field[/b] to the old value; return new value.
66 BDipoleField& addField(const BDipoleField& field);
67
69 // Subtract [b]field[/b] from the old value; return new value.
71
73 // Multiply the field by [b]scalar[/b].
74 virtual void scale(double scalar);
75
76private:
77 // The field components.
78 double Bx, By;
79};
80
81#endif // OPALX_BDipoleField_HH
The field of a magnetic dipole.
BDipoleField & addField(const BDipoleField &field)
Add to field.
virtual BVector Bfield(const Point3D &P) const
Get field.
virtual ~BDipoleField()
virtual double getBy() const
Get vertical component.
virtual double getBx() const
Get horizontal component.
BDipoleField()
Default constructor.
virtual void setBy(double By)
Set vertical component.
BDipoleField & subtractField(const BDipoleField &field)
Subtract from field.
virtual void scale(double scalar)
Scale the field.
virtual void setBx(double Bx)
Set horizontal component.
A magnetic field vector.
Definition EMField.h:88
A homogenous magnetostatic field.
Definition ConstBField.h:30
A point in 3 dimensions.
Definition EMField.h:32