OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
BDipoleField.cpp
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2// $RCSfile: BDipoleField.cpp,v $
3// ------------------------------------------------------------------------
4// $Revision: 1.1.1.1 $
5// ------------------------------------------------------------------------
6// Copyright: see Copyright.readme
7// ------------------------------------------------------------------------
8//
9// Class: BDipoleField
10// An electrostatic dipole field in the (x,y)-plane.
11//
12// ------------------------------------------------------------------------
13// Class category: Fields
14// ------------------------------------------------------------------------
15//
16// $Date: 2000/03/27 09:32:35 $
17// $Author: fci $
18//
19// ------------------------------------------------------------------------
20
21#include "Fields/BDipoleField.h"
22
23// Class BDipoleField
24// ------------------------------------------------------------------------
25
26BDipoleField::BDipoleField() : Bx(0.0), By(0.0) {}
27
29
30BVector BDipoleField::Bfield(const Point3D&) const { return BVector(Bx, By, 0.0); }
31
32BVector BDipoleField::Bfield(const Point3D& /*X*/, double) const { return BVector(Bx, By, 0.0); }
33
34double BDipoleField::getBx() const { return Bx; }
35
36double BDipoleField::getBy() const { return By; }
37
38void BDipoleField::setBx(double value) { Bx = value; }
39
40void BDipoleField::setBy(double value) { By = value; }
41
43 Bx += field.Bx;
44 By += field.By;
45 return *this;
46}
47
49 Bx -= field.Bx;
50 By -= field.By;
51 return *this;
52}
53
54void BDipoleField::scale(double scalar) {
55 Bx *= scalar;
56 By *= scalar;
57}
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 point in 3 dimensions.
Definition EMField.h:32