OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
RBendRep.cpp
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 #include "BeamlineCore/RBendRep.h"
23 #include <cctype>
24 
25 
27  RBend(),
28  geometry(0.0, 0.0),
29  field() {
30  rEntry = rExit = hEntry = hExit = 0.0;
31 }
32 
33 
35  RBend(rhs),
36  geometry(rhs.geometry),
37  field(rhs.field) {
38  rEntry = rhs.rEntry;
39  rExit = rhs.hExit;
40  hEntry = rhs.rEntry;
41  hExit = rhs.hExit;
42 }
43 
44 
45 RBendRep::RBendRep(const std::string &name):
46  RBend(name),
47  geometry(0.0, 0.0),
48  field() {
49  rEntry = rExit = hEntry = hExit = 0.0;
50 }
51 
52 
54 {}
55 
56 
58  return new RBendRep(*this);
59 }
60 
61 
62 Channel *RBendRep::getChannel(const std::string &aKey, bool create) {
63  return ElementBase::getChannel(aKey, create);
64 }
65 
66 
68  return field;
69 }
70 
72  return field;
73 }
74 
75 
77  return geometry;
78 }
79 
81  return geometry;
82 }
83 
84 
85 double RBendRep::getB() const {
86  return field.getNormalComponent(1);
87 }
88 
89 void RBendRep::setB(double B) {
91 }
92 
93 
95  return rEntry;
96 }
97 
98 
100  return rExit;
101 }
102 
104  rEntry = e1;
105 }
106 
108  rExit = e2;
109 }
110 
112  return hEntry;
113 }
114 
116  return hExit;
117 }
118 
120  hEntry = h1;
121 }
122 
124  hExit = h2;
125 }
126 
127 
128 double RBendRep::getSlices() const {
129  return slices;
130 }
131 
132 double RBendRep::getStepsize() const {
133  return stepsize;
134 }
135 
136 void RBendRep::setSlices(double sl) {
137  slices = sl;
138 }
139 
140 void RBendRep::setStepsize(double ds) {
141  stepsize = ds;
142 }
143 
144 
146  field = f;
147 }
const std::string name
virtual Channel * getChannel(const std::string &aKey, bool create=false)
Construct a read/write channel.
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
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.
double getNormalComponent(int n) const
Get component.
void setNormalComponent(int n, double Bn)
Set component.