OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
RBendRep.h
Go to the documentation of this file.
1 //
2 // Class RBendRep
3 // Representation for a rectangular bend magnet.
4 // A rectangular bend magnet has a rectilinear geometry about which its
5 // multipole components are specified.
6 //
7 // Copyright (c) 200x - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
8 // All rights reserved
9 //
10 // This file is part of OPAL.
11 //
12 // OPAL is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
19 //
20 #ifndef CLASSIC_RBendRep_HH
21 #define CLASSIC_RBendRep_HH
22 
23 #include "AbsBeamline/RBend.h"
25 #include "Fields/BMultipoleField.h"
26 
27 
28 class RBendRep: public RBend {
29 
30 public:
31 
33  explicit RBendRep(const std::string &name);
34 
35  RBendRep();
36  RBendRep(const RBendRep &);
37  virtual ~RBendRep();
38 
40  // Return an identical deep copy of the element.
41  virtual ElementBase *clone() const;
42 
44  // This method constructs a Channel permitting read/write access to
45  // the attribute [b]aKey[/b] and returns it.
46  // If the attribute does not exist, it returns NULL.
47  virtual Channel *getChannel(const std::string &aKey, bool = false);
48 
50  // Version for non-constant object.
51  virtual BMultipoleField &getField();
52 
54  // Version for constant object.
55  virtual const BMultipoleField &getField() const;
56 
58  // Version for non-constant object.
59  virtual RBendGeometry &getGeometry();
60 
62  // Version for constant object.
63  virtual const RBendGeometry &getGeometry() const;
64 
66  // Return the vertical component of the field in Teslas.
67  virtual double getB() const;
68 
70  // Assign the vertical component of the field in Teslas.
71  virtual void setB(double By);
72 
74  // Assign the multipole expansion.
75  virtual void setField(const BMultipoleField &field);
76 
78  // Return the rotation of the entry pole face with respect to the x-axis.
79  // A positive angle rotates the pole face normal away from the centre
80  // of the machine.
81  virtual double getEntryFaceRotation() const;
82 
84  // Return the rotation of the exit pole face with respect to the x-axis.
85  // A positive angle rotates the pole face normal away from the centre
86  // of the machine.
87  virtual double getExitFaceRotation() const;
88 
90  // Return the curvature of the entry pole face.
91  // A positive curvature creates a convex pole face.
92  virtual double getEntryFaceCurvature() const;
93 
95  // Return the curvature of the exit pole face.
96  // A positive curvature creates a convex pole face.
97  virtual double getExitFaceCurvature() const;
98 
100  // Return the rotation of the entry pole face with respect to the x-axis.
101  // A positive angle rotates the pole face normal away from the centre
102  // of the machine.
103  virtual void setEntryFaceRotation(double e1);
104 
106  // Return the rotation of the exit pole face with respect to the x-axis.
107  // A positive angle rotates the pole face normal away from the centre
108  // of the machine.
109  virtual void setExitFaceRotation(double e2);
110 
112  // Return the curvature of the entry pole face.
113  // A positive curvature creates a convex pole face.
114  virtual void setEntryFaceCurvature(double h1);
115 
117  // Return the curvature of the exit pole face.
118  // A positive curvature creates a convex pole face.
119  virtual void setExitFaceCurvature(double h2);
120 
122  virtual double getSlices() const;
123 
125  virtual double getStepsize() const;
126 
128  virtual void setSlices(double sl);
129 
131  virtual void setStepsize(double ds);
132 
133 private:
134 
135  // Not implemented.
136  void operator=(const RBendRep &);
137 
140 
143 
144  // The pole face angles and curvatures.
145  double rEntry;
146  double rExit;
147  double hEntry;
148  double hExit;
149 
150  // Parameters that determine integration step-size.
151  double slices;
152  double stepsize;
153 };
154 
155 #endif // CLASSIC_RBendRep_HH
const std::string name
Definition: RBend.h:58
double hExit
Definition: RBendRep.h:148
double stepsize
Definition: RBendRep.h:152
virtual void setB(double By)
Set vertical component.
Definition: RBendRep.cpp:89
virtual ElementBase * clone() const
Return clone.
Definition: RBendRep.cpp:57
virtual double getExitFaceCurvature() const
Get exit pole face curvature.
Definition: RBendRep.cpp:115
RBendRep()
Definition: RBendRep.cpp:26
virtual void setEntryFaceRotation(double e1)
Set pole entry face rotation.
Definition: RBendRep.cpp:103
double hEntry
Definition: RBendRep.h:147
virtual void setEntryFaceCurvature(double h1)
Set entry pole face curvature.
Definition: RBendRep.cpp:119
virtual double getEntryFaceCurvature() const
Get entry pole face curvature.
Definition: RBendRep.cpp:111
virtual void setSlices(double sl)
Set number of slices.
Definition: RBendRep.cpp:136
virtual void setStepsize(double ds)
Set stepsize.
Definition: RBendRep.cpp:140
double rExit
Definition: RBendRep.h:146
virtual void setField(const BMultipoleField &field)
Set field.
Definition: RBendRep.cpp:145
BMultipoleField field
The multipole expansion.
Definition: RBendRep.h:142
virtual RBendGeometry & getGeometry()
Get geometry.
Definition: RBendRep.cpp:76
virtual void setExitFaceRotation(double e2)
Set exit pole face rotation.
Definition: RBendRep.cpp:107
virtual double getSlices() const
Get number of slices.
Definition: RBendRep.cpp:128
RBendGeometry geometry
The bend geometry.
Definition: RBendRep.h:139
virtual double getStepsize() const
Get stepsize.
Definition: RBendRep.cpp:132
virtual ~RBendRep()
Definition: RBendRep.cpp:53
double slices
Definition: RBendRep.h:151
virtual BMultipoleField & getField()
Get field.
Definition: RBendRep.cpp:67
virtual double getExitFaceRotation() const
Get exit pole face rotation.
Definition: RBendRep.cpp:99
double rEntry
Definition: RBendRep.h:145
virtual double getB() const
Get field.
Definition: RBendRep.cpp:85
virtual void setExitFaceCurvature(double h2)
Set exit pole face curvature.
Definition: RBendRep.cpp:123
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
Definition: RBendRep.cpp:62
void operator=(const RBendRep &)
virtual double getEntryFaceRotation() const
Get pole entry face rotation.
Definition: RBendRep.cpp:94
The geometry for a RBend element.
Definition: RBendGeometry.h:41
Abstract interface for read/write access to variable.
Definition: Channel.h:32
The magnetic field of a multipole.