OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
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  virtual ElementBase::ElementType getType() const override;
158 
159 private:
160 
161  // Not implemented.
162  void operator=(const SBend &);
163 
164  virtual bool findChordLength(double &chordLength) override;
165 
166 };
167 
168 #endif // CLASSIC_SBend_HH
const std::string name
Definition: Bend2D.h:51
Definition: SBend.h:68
virtual ElementBase::ElementType getType() const override
Get element type std::string.
Definition: SBend.cpp:86
virtual double getExitFaceCurvature() const =0
Get exit pole face curvature.
virtual double getB() const =0
Get dipole field of SBend.
virtual PlanarArcGeometry & getGeometry() override=0
Get SBend geometry.
virtual double getEntryFaceRotation() const =0
Get pole entry face rotation.
SBend()
Definition: SBend.cpp:32
virtual double getStepsize() const =0
Get stepsize.
virtual double getSlices() const =0
Get number of slices.
virtual const BMultipoleField & getField() const override=0
Get multipole expansion of field.
virtual const PlanarArcGeometry & getGeometry() const override=0
Get SBend geometry.
void operator=(const SBend &)
void setSkewComponent(int, double)
Set skew component.
Definition: SBend.cpp:71
virtual double getEntryFaceCurvature() const =0
Get entry pole face curvature.
virtual ~SBend()
Definition: SBend.cpp:48
virtual void accept(BeamlineVisitor &) const override
Apply visitor to SBend.
Definition: SBend.cpp:51
double getSkewComponent(int) const
Get skew component.
Definition: SBend.cpp:63
virtual bool findChordLength(double &chordLength) override
Definition: SBend.cpp:91
double getNormalComponent(int) const
Get normal component.
Definition: SBend.cpp:59
virtual double getExitFaceRotation() const =0
Get exit pole face rotation.
virtual BMultipoleField & getField() override=0
Get multipole expansion of field.
void setNormalComponent(int, double)
Set normal component.
Definition: SBend.cpp:67
A simple arc in the XZ plane.
The magnetic field of a multipole.