OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
OpalTrimCoil.h
Go to the documentation of this file.
1//
2// Class OpalTrimCoil
3// A TRIMCOIL definition is used to define a trim coil which can be applied
4// to a Cyclotron.
5//
6// Copyright (c) 2018 - 2019, Matthias Frey and Jochem Snuverink,
7// Paul Scherrer Institut, Villigen PSI, Switzerland
8// All rights reserved
9//
10// Implemented as part of the PhD thesis
11// "Precise Simulations of Multibunches in High Intensity Cyclotrons"
12// and the paper
13// "Matching of turn pattern measurements for cyclotrons using multiobjective optimization"
14// (https://doi.org/10.1103/PhysRevAccelBeams.22.064602)
15//
16// This file is part of OPAL.
17//
18// OPAL is free software: you can redistribute it and/or modify
19// it under the terms of the GNU General Public License as published by
20// the Free Software Foundation, either version 3 of the License, or
21// (at your option) any later version.
22//
23// You should have received a copy of the GNU General Public License
24// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
25//
26#ifndef OPAL_TRIM_COIL_H
27#define OPAL_TRIM_COIL_H
28
30
31#include <memory>
32#include <string>
33
34class Attribute;
35class Inform;
36class TrimCoil;
37
38class OpalTrimCoil: public Definition {
39
40public:
43
44 virtual ~OpalTrimCoil();
45
47 // Can replace only by another OpalTrimCoil
48 virtual bool canReplaceBy(Object* object);
49
51 virtual OpalTrimCoil* clone(const std::string& name);
52
54 virtual void execute();
55
57 static OpalTrimCoil* find(const std::string& name);
58
60 virtual void update();
61
64 Inform& print(Inform& os) const;
65
67 void initOpalTrimCoil();
68
70 std::unique_ptr<TrimCoil> trimcoil_m;
71
72private:
73 enum class TrimCoilType: unsigned short {
77 };
78
80 OpalTrimCoil (const OpalTrimCoil&) = delete;
81 void operator=(const OpalTrimCoil&) = delete;
84 OpalTrimCoil(const std::string &name, OpalTrimCoil* parent);
85
87 void printPolynom(Inform& os, const Attribute& attr) const;
88
90};
91
92inline Inform& operator<<(Inform& os, const OpalTrimCoil& b) {
93 return b.print(os);
94}
95
96#endif // OPAL_TRIM_COIL_H
Inform & operator<<(Inform &os, const OpalTrimCoil &b)
const std::string name
A representation of an Object attribute.
Definition Attribute.h:52
Definition(int size, const char *name, const char *help)
Constructor for exemplars.
virtual void print(std::ostream &) const
Print the object.
Definition Object.cpp:161
Object(int size, const char *name, const char *help)
Constructor for exemplars.
Definition Object.cpp:356
Inform & print(Inform &os) const
OpalTrimCoil()
Exemplar constructor.
static OpalTrimCoil * find(const std::string &name)
Find named trim coil.
void operator=(const OpalTrimCoil &)=delete
std::unique_ptr< TrimCoil > trimcoil_m
Actual implementation.
virtual ~OpalTrimCoil()
virtual void update()
Update the OpalTrimCoil data.
OpalTrimCoil(const OpalTrimCoil &)=delete
Not implemented.
void initOpalTrimCoil()
Initialise implementation.
void printPolynom(Inform &os, const Attribute &attr) const
Helper method for printing.
virtual void execute()
Check the OpalTrimCoil data.
TrimCoilType getTrimCoilType() const
virtual OpalTrimCoil * clone(const std::string &name)
Make clone.
virtual bool canReplaceBy(Object *object)
Test if replacement is allowed.