OPAL (Object Oriented Parallel Accelerator Library) 2022.1
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
29#include <string>
30#include <memory>
32
33class Attribute;
34class Inform;
35class TrimCoil;
36
37class OpalTrimCoil: public Definition {
38
39public:
42
43 virtual ~OpalTrimCoil();
44
46 // Can replace only by another OpalTrimCoil
47 virtual bool canReplaceBy(Object *object);
48
50 virtual OpalTrimCoil *clone(const std::string &name);
51
53 virtual void execute();
54
56 static OpalTrimCoil *find(const std::string &name);
57
59 virtual void update();
60
63 Inform& print(Inform& os) const;
64
66 void initOpalTrimCoil();
67
69 std::unique_ptr<TrimCoil> trimcoil_m;
70
71private:
72
74 OpalTrimCoil (const OpalTrimCoil &) = delete;
75 void operator=(const OpalTrimCoil &) = delete;
78 OpalTrimCoil(const std::string &name, OpalTrimCoil *parent);
79
81 void printPolynom(Inform& os, const Attribute& attr) const;
82};
83
84inline Inform &operator<<(Inform &os, const OpalTrimCoil &b) {
85 return b.print(os);
86}
87
88#endif // OPAL_TRIM_COIL_H
Inform & operator<<(Inform &os, const OpalTrimCoil &b)
Definition: OpalTrimCoil.h:84
const std::string name
A representation of an Object attribute.
Definition: Attribute.h:52
The base class for all OPAL definitions.
Definition: Definition.h:30
The base class for all OPAL objects.
Definition: Object.h:48
virtual void print(std::ostream &) const
Print the object.
Definition: Object.cpp:161
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.
Definition: OpalTrimCoil.h:69
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.
virtual OpalTrimCoil * clone(const std::string &name)
Make clone.
virtual bool canReplaceBy(Object *object)
Test if replacement is allowed.
Definition: Inform.h:42