OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
UndulatorRep.cpp
Go to the documentation of this file.
1//
2// Class UndulatorRep
3// Defines a concrete undulator/wiggler representation.
4//
5// Copyright (c) 2020, Arnau AlbĂ , Paul Scherrer Institut, Villigen PSI, Switzerland
6// All rights reserved.
7//
8// Implemented as part of the MSc thesis
9// "Start-to-End Modelling of the AWA Micro-Bunched Electron Cooling POP-Experiment"
10//
11// This file is part of OPAL.
12//
13// OPAL is free software: you can redistribute it and/or modify
14// it under the terms of the GNU General Public License as published by
15// the Free Software Foundation, either version 3 of the License, or
16// (at your option) any later version.
17//
18// You should have received a copy of the GNU General Public License
19// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
20//
22
24
25// Attribute access table.
26namespace {
27 struct Entry {
28 const char* name;
29 double (UndulatorRep::*get)() const;
30 void (UndulatorRep::*set)(double);
31 };
32
33 const Entry entries[] = {
35} // namespace
36
39
42
44}
45
48
50 return new UndulatorRep(*this);
51}
52
53Channel* UndulatorRep::getChannel(const std::string& aKey, bool create) {
54 for (const Entry* entry = entries; entry->name != 0; ++entry) {
55 if (aKey == entry->name) {
56 return new IndirectChannel<UndulatorRep>(*this, entry->get, entry->set);
57 }
58 }
59
60 return ElementBase::getChannel(aKey, create);
61}
62
66
68 return field;
69}
70
74
76 return geometry;
77}
const SingleMultipole< 4 >::Entry SingleMultipole< 4 >::entries[]
Definition Octupole.cpp:33
const std::string name
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.
ElementBase(const std::string &name)
Constructor with given name.
Undulator(const std::string &name)
Constructor with given name.
Definition Undulator.cpp:60
UndulatorRep(const std::string &name)
Constructor with given name.
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
virtual ~UndulatorRep()
virtual ElementBase * clone() const
Return clone.
virtual NullField & getField()
Get field.
StraightGeometry geometry
The geometry.
virtual StraightGeometry & getGeometry()
Get geometry.
NullField field
The zero magnetic field.
A geometry representing a straight line.
Abstract interface for read/write access to variable.
Definition Channel.h:32
Access to a [b]double[/b] data member.
A zero electromagnetic field.
Definition NullField.h:30