OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
RBendRep.cpp
Go to the documentation of this file.
2
4
5namespace {
6 struct Entry {
7 const char* name;
8 double (RBendRep::*get)() const;
9 void (RBendRep::*set)(double);
10 };
11
12 const Entry entries[] = {
19 {nullptr, nullptr, nullptr}};
20} // namespace
21
22RBendRep::RBendRep() : RBend(), geometry_m(0.0, 0.0), field_m() {}
23
25 : RBend(right), geometry_m(right.geometry_m), field_m(right.field_m) {}
26
27RBendRep::RBendRep(const std::string& name) : RBend(name), geometry_m(0.0, 0.0), field_m() {}
28
29RBendRep::~RBendRep() = default;
30
31ElementBase* RBendRep::clone() const { return new RBendRep(*this); }
32
33Channel* RBendRep::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<RBendRep>(*this, entry->get, entry->set);
37 }
38 }
39
40 return ElementBase::getChannel(aKey, create);
41}
42
44
45const BMultipoleField& RBendRep::getField() const { return field_m; }
46
48
50
51void RBendRep::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.
The geometry for a RBend element.
Concrete OPALX representation of an analytic rectangular bend.
Definition RBendRep.h:13
BMultipoleField field_m
Definition RBendRep.h:33
BMultipoleField & getField() override
Return field.
Definition RBendRep.cpp:43
ElementBase * clone() const override
Return clone.
Definition RBendRep.cpp:31
RBendGeometry & getGeometry() override
Get geometry.
Definition RBendRep.cpp:47
void setField(const BMultipoleField &field)
Definition RBendRep.cpp:51
Channel * getChannel(const std::string &aKey, bool create=false) override
Construct a read/write channel.
Definition RBendRep.cpp:33
~RBendRep() override
RBendGeometry geometry_m
Definition RBendRep.h:32
Abstract rectangular bend with straight body and curved reference path.
Definition RBend.h:16