OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
SBend.h
Go to the documentation of this file.
1 #ifndef CLASSIC_SBend_HH
2 #define CLASSIC_SBend_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: SBend.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1.2.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Definitions for class: SBend
13 // Defines the abstract interface for a sector bend magnet.
14 //
15 // ------------------------------------------------------------------------
16 // Class category: AbsBeamline
17 // ------------------------------------------------------------------------
18 //
19 // $Date: 2004/11/12 18:57:53 $
20 // $Author: adelmann $
21 //
22 // ------------------------------------------------------------------------
23 
24 #include "AbsBeamline/Bend2D.h"
26 #include "Fields/BMultipoleField.h"
27 #include <string>
28 
29 /*
30  * Class SBend
31  *
32  * Interface for sector bend magnet.
33  *
34  * A sector bend magnet has a curved geometry. A sector magnet with zero degree
35  * edge angles is simply a section of a circle when projected onto the y axis.
36  *
37  * The standard sector magnet, for purposes of definitions, has a field in the y
38  * direction. This produces a bend in the horizontal (x) plane. Bends in other
39  * planes can be accomplished by rotating the magnet about the axes.
40  *
41  * A positive bend angle is defined as one that bends a beam to the right when
42  * looking down (in the negative y direction) so that the beam is bent in the
43  * negative x direction. (This definition of a positive bend is the same whether
44  * the charge is positive or negative.)
45  *
46  * A zero degree entrance edge angle is parallel to the x direction in an x/y/s
47  * coordinate system. A positive entrance edge angle is defined as one that
48  * rotates the positive edge (in x) of the angle toward the positive s axis.
49  *
50  * A zero degree exit edge angle is parallel to the x direction in an x/y/s
51  * coordinate system. A positive exit edge angle is defined as one that rotates
52  * the positive edge (in x) of the angle toward the negative s axis.
53  *
54  * ------------------------------------------------------------------------
55  *
56  * This class defines two interfaces:
57  *
58  * 1) Interface for sector magnets for OPAL-MAP.
59  *
60  * Here we specify multipole components about the curved magnet trajectory.
61  *
62  *
63  * 2) Interface for sector magnets for OPAL-T.
64  *
65  * Here we defined the magnet as a field map.
66  */
67 
68 class SBend: public Bend2D {
69 
70 public:
71 
73  explicit SBend(const std::string &name);
74 
75  SBend();
76  SBend(const SBend &);
77  virtual ~SBend();
78 
80  virtual void accept(BeamlineVisitor &) const override;
81 
82 
83  /*
84  * Methods for OPAL-MAP
85  * ====================
86  */
87 
89  virtual double getB() const = 0;
90 
92  // Version for non-constant object.
93  virtual PlanarArcGeometry &getGeometry() override = 0;
94 
96  // Version for constant object.
97  virtual const PlanarArcGeometry &getGeometry() const override = 0;
98 
100  // Version for non-constant object.
101  virtual BMultipoleField &getField() override = 0;
102 
104  // Version for constant object.
105  virtual const BMultipoleField &getField() const override = 0;
106 
108  // Return the normal component of order [b]n[/b] in T/m**(n-1).
109  // If [b]n[/b] is larger than the maximum order, the return value is zero.
110  double getNormalComponent(int) const;
111 
113  // Return the skew component of order [b]n[/b] in T/m**(n-1).
114  // If [b]n[/b] is larger than the maximum order, the return value is zero.
115  double getSkewComponent(int) const;
116 
118  // Set the normal component of order [b]n[/b] in T/m**(n-1).
119  // If [b]n[/b] is larger than the maximum order, the component is created.
120  void setNormalComponent(int, double);
121 
123  // Set the skew component of order [b]n[/b] in T/m**(n-1).
124  // If [b]n[/b] is larger than the maximum order, the component is created.
125  void setSkewComponent(int, double);
126 
128  // Return the rotation of the entry pole face with respect to the x-axis.
129  // A positive angle rotates the pole face normal away from the centre
130  // of the machine.
131  virtual double getEntryFaceRotation() const = 0;
132 
134  // Return the rotation of the exit pole face with respect to the x-axis.
135  // A positive angle rotates the pole face normal away from the centre
136  // of the machine.
137  virtual double getExitFaceRotation() const = 0;
138 
140  // Return the curvature of the entry pole face.
141  // A positive curvature creates a convex pole face.
142  virtual double getEntryFaceCurvature() const = 0;
143 
145  // Return the curvature of the exit pole face.
146  // A positive curvature creates a convex pole face.
147  virtual double getExitFaceCurvature() const = 0;
148 
150  // Slices and stepsize used to determine integration step.
151  virtual double getSlices() const = 0;
152 
154  // Slices and stepsize used to determine integration step.
155  virtual double getStepsize() const = 0;
156 
157 
158  /*
159  * Methods for OPAL-SLICE.
160  */
161  virtual void addKR(int /* i */, double /* t */, Vector_t &/* K */) override { };
162  virtual void addKT(int /* i */, double /* t */, Vector_t &/* K */) override { };
163 
164 
165  virtual ElementBase::ElementType getType() const override;
166 
167 private:
168 
169  // Not implemented.
170  void operator=(const SBend &);
171 
172  virtual bool findChordLength(Inform &msg,
173  double &chordLength) override;
174 
175 };
176 
177 #endif // CLASSIC_SBend_HH
virtual double getExitFaceRotation() const =0
Get exit pole face rotation.
virtual double getB() const =0
Get dipole field of SBend.
void operator=(const SBend &)
virtual BMultipoleField & getField() override=0
Get multipole expansion of field.
virtual bool findChordLength(Inform &msg, double &chordLength) override
Definition: SBend.cpp:94
virtual ElementBase::ElementType getType() const override
Get element type std::string.
Definition: SBend.cpp:89
virtual double getSlices() const =0
Get number of slices.
A simple arc in the XZ plane.
virtual PlanarArcGeometry & getGeometry() override=0
Get SBend geometry.
void setNormalComponent(int, double)
Set normal component.
Definition: SBend.cpp:70
virtual double getStepsize() const =0
Get stepsize.
void setSkewComponent(int, double)
Set skew component.
Definition: SBend.cpp:74
Definition: Bend2D.h:51
Definition: SBend.h:68
virtual ~SBend()
Definition: SBend.cpp:51
virtual void accept(BeamlineVisitor &) const override
Apply visitor to SBend.
Definition: SBend.cpp:54
virtual double getEntryFaceCurvature() const =0
Get entry pole face curvature.
virtual double getEntryFaceRotation() const =0
Get pole entry face rotation.
The magnetic field of a multipole.
double getNormalComponent(int) const
Get normal component.
Definition: SBend.cpp:62
virtual double getExitFaceCurvature() const =0
Get exit pole face curvature.
const std::string name
Abstract algorithm.
Definition: Inform.h:41
virtual void addKT(int, double, Vector_t &) override
Definition: SBend.h:162
SBend()
Definition: SBend.cpp:35
virtual void addKR(int, double, Vector_t &) override
Definition: SBend.h:161
double getSkewComponent(int) const
Get skew component.
Definition: SBend.cpp:66