OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
SBendRep.cpp
Go to the documentation of this file.
2
4
5namespace {
6 struct Entry {
7 const char* name;
8 double (SBendRep::*get)() const;
9 void (SBendRep::*set)(double);
10 };
11
12 const Entry entries[] = {
19 {nullptr, nullptr, nullptr}};
20} // namespace
21
22SBendRep::SBendRep() : SBend(), geometry_m(0.0, 0.0), field_m() {}
23
25 : SBend(right), geometry_m(right.geometry_m), field_m(right.field_m) {}
26
27SBendRep::SBendRep(const std::string& name) : SBend(name), geometry_m(0.0, 0.0), field_m() {}
28
29SBendRep::~SBendRep() = default;
30
31ElementBase* SBendRep::clone() const { return new SBendRep(*this); }
32
33Channel* SBendRep::getChannel(const std::string& aKey, bool create) {
34 for (const Entry* entry = entries; entry->name != nullptr; ++entry) {
35 if (aKey == entry->name) {
36 return new IndirectChannel<SBendRep>(*this, entry->get, entry->set);
37 }
38 }
39
40 return ElementBase::getChannel(aKey, create);
41}
42
44
45const BMultipoleField& SBendRep::getField() const { return field_m; }
46
48
50
51void SBendRep::setField(const BMultipoleField& field) { field_m = field; }
The magnetic field of a multipole.
double getEntryFaceCurvature() const
Definition BendBase.h:239
void setB(double B)
Definition BendBase.h:227
void setExitFaceCurvature(double curvature)
Definition BendBase.h:241
double getEntryFaceRotation() const
Definition BendBase.h:231
double getExitFaceRotation() const
Definition BendBase.h:235
double getB() const
Definition BendBase.h:225
void setExitFaceRotation(double rotation)
Definition BendBase.h:233
double getExitFaceCurvature() const
Definition BendBase.h:243
void setEntryFaceCurvature(double curvature)
Definition BendBase.h:237
void setEntryFaceRotation(double rotation)
Definition BendBase.h:229
Abstract interface for read/write access to variable.
Definition Channel.h:30
virtual Channel * getChannel(const std::string &aKey, bool create=false)
Construct a read/write channel.
virtual double getElementLength() const
Get design length.
virtual void setElementLength(double length)
Set design length.
Access to a [b]double[/b] data member.
A simple arc in the XZ plane.
Concrete OPALX representation of an analytic sector bend.
Definition SBendRep.h:13
PlanarArcGeometry geometry_m
Definition SBendRep.h:32
Channel * getChannel(const std::string &aKey, bool create=false) override
Construct a read/write channel.
Definition SBendRep.cpp:33
~SBendRep() override
ElementBase * clone() const override
Return clone.
Definition SBendRep.cpp:31
void setField(const BMultipoleField &field)
Definition SBendRep.cpp:51
BMultipoleField field_m
Definition SBendRep.h:33
PlanarArcGeometry & getGeometry() override
Get geometry.
Definition SBendRep.cpp:47
BMultipoleField & getField() override
Return field.
Definition SBendRep.cpp:43
Abstract sector bend with planar-arc body geometry.
Definition SBend.h:15