OPAL (Object Oriented Parallel Accelerator Library)
2022.1
OPAL
src
src
OpalConfigure
Configure.cpp
Go to the documentation of this file.
1
//
2
// Namespace Configure
3
// The OPAL configurator.
4
// This class must be modified to configure the commands to be contained
5
// in an executable OPAL program. For each command an exemplar object
6
// is constructed and linked to the main directory. This exemplar is then
7
// available to the OPAL parser for cloning.
8
// This class could be part of the class OpalData. It is separated from
9
// that class and opale into a special module in order to reduce
10
// dependencies between modules.
11
//
12
// Copyright (c) 200x - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
13
// All rights reserved
14
//
15
// This file is part of OPAL.
16
//
17
// OPAL is free software: you can redistribute it and/or modify
18
// it under the terms of the GNU General Public License as published by
19
// the Free Software Foundation, either version 3 of the License, or
20
// (at your option) any later version.
21
//
22
// You should have received a copy of the GNU General Public License
23
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
24
//
25
#include "
OpalConfigure/Configure.h
"
26
#include "
AbstractObjects/OpalData.h
"
27
28
#include "
Distribution/Distribution.h
"
29
30
// Basic action commands.
31
#include "
BasicActions/Call.h
"
32
#include "
BasicActions/DumpFields.h
"
33
#include "
BasicActions/DumpEMFields.h
"
34
#include "
BasicActions/Echo.h
"
35
#include "
BasicActions/Help.h
"
36
#include "
BasicActions/Option.h
"
37
#include "
BasicActions/Select.h
"
38
#include "
BasicActions/Stop.h
"
39
#include "
BasicActions/Quit.h
"
40
#include "
BasicActions/System.h
"
41
#include "
BasicActions/PSystem.h
"
42
#include "
BasicActions/Title.h
"
43
#include "
BasicActions/Value.h
"
44
45
// Macro command.
46
#include "
OpalParser/MacroCmd.h
"
47
48
// Commands introducing a special mode.
49
#include "
Track/TrackCmd.h
"
50
51
// Table-related commands.
52
#include "
Structure/Beam.h
"
53
#include "
Structure/FieldSolver.h
"
54
#include "
Structure/BoundaryGeometry.h
"
55
#include "
Structure/OpalWake.h
"
56
#include "
Structure/ParticleMatterInteraction.h
"
57
#include "
Utilities/OpalFilter.h
"
58
#include "
TrimCoils/OpalTrimCoil.h
"
59
#include "
Tables/List.h
"
60
61
// Value definitions commands.
62
#include "
ValueDefinitions/BoolConstant.h
"
63
#include "
ValueDefinitions/RealConstant.h
"
64
#include "
ValueDefinitions/RealVariable.h
"
65
#include "
ValueDefinitions/RealVector.h
"
66
#include "
ValueDefinitions/StringConstant.h
"
67
68
// Element commands.
69
#include "
Elements/OpalAsymmetricEnge.h
"
70
#include "
Elements/OpalCavity.h
"
71
#include "
Elements/OpalCCollimator.h
"
72
#include "
Elements/OpalCyclotron.h
"
73
#include "
Elements/OpalDegrader.h
"
74
#include "
Elements/OpalDrift.h
"
75
#include "
Elements/OpalECollimator.h
"
76
#include "
Elements/OpalEnge.h
"
77
#include "
Elements/OpalFlexibleCollimator.h
"
78
#include "
Elements/OpalHKicker.h
"
79
#include "
Elements/OpalKicker.h
"
80
#include "
Elements/OpalMarker.h
"
81
#include "
Elements/OpalMonitor.h
"
82
#include "
Elements/OpalMultipole.h
"
83
#include "
Elements/OpalMultipoleT.h
"
84
#include "
Elements/OpalMultipoleTStraight.h
"
85
#include "
Elements/OpalMultipoleTCurvedConstRadius.h
"
86
#include "
Elements/OpalMultipoleTCurvedVarRadius.h
"
87
#include "
Elements/OpalOctupole.h
"
88
#include "
Elements/OpalOffset/OpalLocalCartesianOffset.h
"
89
#include "
Elements/OpalOffset/OpalLocalCylindricalOffset.h
"
90
#include "
Elements/OpalOffset/OpalGlobalCartesianOffset.h
"
91
#include "
Elements/OpalOffset/OpalGlobalCylindricalOffset.h
"
92
#include "
Elements/OpalPepperPot.h
"
93
#include "
Elements/OpalPolynomialTimeDependence.h
"
94
#include "
Elements/OpalProbe.h
"
95
#include "
Elements/OpalQuadrupole.h
"
96
#include "
Elements/OpalRBend.h
"
97
#include "
Elements/OpalRBend3D.h
"
98
#include "
Elements/OpalRCollimator.h
"
99
#include "
Elements/OpalRingDefinition.h
"
100
#include "
Elements/OpalSBend.h
"
101
#include "
Elements/OpalSBend3D.h
"
102
#include "
Elements/OpalScalingFFAMagnet.h
"
103
#include "
Elements/OpalSeptum.h
"
104
#include "
Elements/OpalSextupole.h
"
105
#include "
Elements/OpalSlit.h
"
106
#include "
Elements/OpalSolenoid.h
"
107
#include "
Elements/OpalSource.h
"
108
#include "
Elements/OpalStripper.h
"
109
#include "
Elements/OpalTravelingWave.h
"
110
#include "
Elements/OpalVacuum.h
"
111
#include "
Elements/OpalVariableRFCavity.h
"
112
#include "
Elements/OpalVariableRFCavityFringeField.h
"
113
#include "
Elements/OpalVerticalFFAMagnet.h
"
114
#include "
Elements/OpalVKicker.h
"
115
116
#ifdef ENABLE_OPAL_FEL
117
#include "
Elements/OpalUndulator.h
"
118
#endif
119
120
// Structure-related commands.
121
#include "
Lines/Line.h
"
122
#include "
Lines/Sequence.h
"
123
124
// Optimize command
125
#include "
Optimize/OptimizeCmd.h
"
126
#include "
Optimize/DVar.h
"
127
#include "
Optimize/Objective.h
"
128
#include "
Optimize/Constraint.h
"
129
130
// Sample command
131
#include "
Sample/SampleCmd.h
"
132
#include "
Sample/OpalSample.h
"
133
134
#include "
changes.h
"
135
136
// Modify these methods to add new commands.
137
// ------------------------------------------------------------------------
138
139
namespace
{
140
141
void
makeActions() {
142
OpalData
*opal =
OpalData::getInstance
();
143
opal->
create
(
new
Call
());
144
opal->
create
(
new
DumpFields
());
145
opal->
create
(
new
DumpEMFields
());
146
opal->
create
(
new
Echo
());
147
opal->
create
(
new
Help
());
148
opal->
create
(
new
List
());
149
opal->
create
(
new
Option
());
150
opal->
create
(
new
OptimizeCmd
());
151
opal->
create
(
new
SampleCmd
());
152
opal->
create
(
new
Select
());
153
opal->
create
(
new
Stop
());
154
opal->
create
(
new
Quit
());
155
opal->
create
(
new
PSystem
());
156
opal->
create
(
new
System
());
157
opal->
create
(
new
Title
());
158
opal->
create
(
new
TrackCmd
());
159
opal->
create
(
new
Value
());
160
}
161
162
void
makeDefinitions() {
163
OpalData
*opal =
OpalData::getInstance
();
164
// Must create the value definitions first.
165
opal->
create
(
new
BoolConstant
());
166
opal->
create
(
new
RealConstant
());
167
opal->
create
(
new
RealVariable
());
168
opal->
create
(
new
RealVector
());
169
opal->
create
(
new
StringConstant
());
170
171
opal->
create
(
new
Beam
());
172
opal->
create
(
new
FieldSolver
());
173
opal->
create
(
new
BoundaryGeometry
());
174
opal->
create
(
new
OpalWake
());
175
opal->
create
(
new
ParticleMatterInteraction
());
176
177
opal->
create
(
new
OpalFilter
());
178
opal->
create
(
new
OpalTrimCoil
());
179
180
opal->
create
(
new
Distribution
());
181
182
opal->
create
(
new
MacroCmd
());
183
184
opal->
create
(
new
DVar
());
185
opal->
create
(
new
Objective
());
186
opal->
create
(
new
Constraint
());
187
188
opal->
create
(
new
OpalSample
());
189
}
190
191
void
makeElements() {
192
OpalData
*opal =
OpalData::getInstance
();
193
opal->
create
(
new
OpalAsymmetricEnge
());
194
opal->
create
(
new
OpalCavity
());
195
opal->
create
(
new
OpalCCollimator
());
196
opal->
create
(
new
OpalCyclotron
());
197
opal->
create
(
new
OpalDegrader
());
198
opal->
create
(
new
OpalDrift
());
199
opal->
create
(
new
OpalECollimator
());
200
opal->
create
(
new
OpalFlexibleCollimator
());
201
opal->
create
(
new
OpalHKicker
());
202
opal->
create
(
new
OpalKicker
());
203
opal->
create
(
new
OpalMarker
());
204
opal->
create
(
new
OpalMonitor
());
205
opal->
create
(
new
OpalMultipole
());
206
opal->
create
(
new
OpalMultipoleT
());
207
opal->
create
(
new
OpalMultipoleTStraight
());
208
opal->
create
(
new
OpalMultipoleTCurvedConstRadius
());
209
opal->
create
(
new
OpalMultipoleTCurvedVarRadius
());
210
opal->
create
(
new
OpalOctupole
());
211
opal->
create
(
new
OpalOffset::OpalLocalCartesianOffset
());
212
// opal->create(new OpalOffset::OpalLocalCylindricalOffset());
213
// opal->create(new OpalOffset::OpalGlobalCartesianOffset());
214
// opal->create(new OpalOffset::OpalGlobalCylindricalOffset());
215
opal->
create
(
new
OpalPepperPot
());
216
opal->
create
(
new
OpalPolynomialTimeDependence
());
217
opal->
create
(
new
OpalProbe
());
218
opal->
create
(
new
OpalQuadrupole
());
219
opal->
create
(
new
OpalRBend
());
220
opal->
create
(
new
OpalRBend3D
());
221
opal->
create
(
new
OpalRCollimator
());
222
opal->
create
(
new
OpalRingDefinition
());
223
opal->
create
(
new
OpalSBend
());
224
opal->
create
(
new
OpalSBend3D
());
225
opal->
create
(
new
OpalScalingFFAMagnet
());
226
opal->
create
(
new
OpalSeptum
());
227
opal->
create
(
new
OpalSextupole
());
228
opal->
create
(
new
OpalSlit
());
229
opal->
create
(
new
OpalSolenoid
());
230
opal->
create
(
new
OpalSource
());
231
opal->
create
(
new
OpalStripper
());
232
opal->
create
(
new
OpalTravelingWave
());
233
#ifdef ENABLE_OPAL_FEL
234
opal->
create
(
new
OpalUndulator
());
235
#endif
236
opal->
create
(
new
OpalVacuum
());
237
opal->
create
(
new
OpalVariableRFCavity
());
238
opal->
create
(
new
OpalVariableRFCavityFringeField
());
239
opal->
create
(
new
OpalVerticalFFAMagnet
());
240
opal->
create
(
new
OpalVKicker
());
241
242
opal->
create
(
new
Line
());
243
opal->
create
(
new
Sequence
());
244
}
245
};
246
247
namespace
Configure
{
248
void
configure
() {
249
makeDefinitions();
250
makeElements();
251
makeActions();
252
Versions::fillChanges
();
253
}
254
};
List.h
TrackCmd.h
DVar.h
Objective.h
Constraint.h
OptimizeCmd.h
Help.h
Quit.h
Stop.h
DumpEMFields.h
Title.h
Echo.h
Call.h
Value.h
DumpFields.h
Option.h
System.h
PSystem.h
Select.h
OpalTrimCoil.h
Distribution.h
StringConstant.h
RealVector.h
RealVariable.h
RealConstant.h
BoolConstant.h
OpalFilter.h
OpalSolenoid.h
OpalMonitor.h
OpalKicker.h
OpalStripper.h
OpalQuadrupole.h
OpalMarker.h
OpalVariableRFCavity.h
OpalSource.h
OpalCCollimator.h
OpalVacuum.h
OpalHKicker.h
OpalPolynomialTimeDependence.h
OpalGlobalCylindricalOffset.h
OpalLocalCylindricalOffset.h
OpalLocalCartesianOffset.h
OpalGlobalCartesianOffset.h
OpalEnge.h
OpalRBend3D.h
OpalVKicker.h
OpalRingDefinition.h
OpalMultipoleTCurvedVarRadius.h
OpalSextupole.h
OpalMultipoleTStraight.h
OpalDegrader.h
OpalDrift.h
OpalOctupole.h
OpalAsymmetricEnge.h
OpalECollimator.h
OpalSBend3D.h
OpalSlit.h
OpalProbe.h
OpalSeptum.h
OpalMultipoleT.h
OpalMultipoleTCurvedConstRadius.h
OpalRBend.h
OpalTravelingWave.h
OpalUndulator.h
OpalCyclotron.h
OpalVerticalFFAMagnet.h
OpalRCollimator.h
OpalVariableRFCavityFringeField.h
OpalSBend.h
OpalPepperPot.h
OpalMultipole.h
OpalScalingFFAMagnet.h
OpalFlexibleCollimator.h
OpalCavity.h
Configure.h
changes.h
OpalSample.h
SampleCmd.h
MacroCmd.h
OpalData.h
Beam.h
FieldSolver.h
OpalWake.h
BoundaryGeometry.h
ParticleMatterInteraction.h
Sequence.h
Line.h
Versions::fillChanges
void fillChanges()
Definition:
changes.cpp:9
Configure
Definition:
Configure.cpp:247
Configure::configure
void configure()
Configure all commands.
Definition:
Configure.cpp:248
OpalData
The global OPAL structure.
Definition:
OpalData.h:49
OpalData::create
void create(Object *newObject)
Create new object.
Definition:
OpalData.cpp:476
OpalData::getInstance
static OpalData * getInstance()
Definition:
OpalData.cpp:196
Call
Definition:
Call.h:24
DumpEMFields
Definition:
DumpEMFields.h:54
DumpFields
Definition:
DumpFields.h:54
Echo
Definition:
Echo.h:24
Help
Definition:
Help.h:24
Option
Definition:
Option.h:30
PSystem
Definition:
PSystem.h:24
Quit
Definition:
Quit.h:24
Select
Definition:
Select.h:26
Stop
Definition:
Stop.h:24
System
Definition:
System.h:24
Title
Definition:
Title.h:24
Value
Definition:
Value.h:24
OpalTrimCoil
Definition:
OpalTrimCoil.h:37
Distribution
Definition:
Distribution.h:188
OpalAsymmetricEnge
Definition:
OpalAsymmetricEnge.h:9
OpalCavity
Definition:
OpalCavity.h:26
OpalCCollimator
Definition:
OpalCCollimator.h:25
OpalCyclotron
Definition:
OpalCyclotron.h:25
OpalDegrader
Definition:
OpalDegrader.h:25
OpalDrift
Definition:
OpalDrift.h:28
OpalECollimator
Definition:
OpalECollimator.h:25
OpalFlexibleCollimator
Definition:
OpalFlexibleCollimator.h:25
OpalHKicker
Definition:
OpalHKicker.h:24
OpalKicker
Definition:
OpalKicker.h:26
OpalMarker
The MARKER element.
Definition:
OpalMarker.h:28
OpalMonitor
Definition:
OpalMonitor.h:23
OpalMultipole
Definition:
OpalMultipole.h:24
OpalMultipoleT
Definition:
OpalMultipoleT.h:39
OpalMultipoleTCurvedConstRadius
Definition:
OpalMultipoleTCurvedConstRadius.h:40
OpalMultipoleTCurvedVarRadius
Definition:
OpalMultipoleTCurvedVarRadius.h:40
OpalMultipoleTStraight
Definition:
OpalMultipoleTStraight.h:40
OpalOctupole
Definition:
OpalOctupole.h:25
OpalOffset::OpalLocalCartesianOffset
Definition:
OpalLocalCartesianOffset.h:44
OpalPepperPot
Definition:
OpalPepperPot.h:26
OpalPolynomialTimeDependence
Definition:
OpalPolynomialTimeDependence.h:37
OpalProbe
Definition:
OpalProbe.h:25
OpalQuadrupole
Definition:
OpalQuadrupole.h:25
OpalRBend
Definition:
OpalRBend.h:26
OpalRBend3D
Definition:
OpalRBend3D.h:26
OpalRCollimator
Definition:
OpalRCollimator.h:25
OpalRingDefinition
Definition:
OpalRingDefinition.h:41
OpalSBend
Definition:
OpalSBend.h:26
OpalSBend3D
Definition:
OpalSBend3D.h:37
OpalScalingFFAMagnet
Definition:
OpalScalingFFAMagnet.h:37
OpalSeptum
Definition:
OpalSeptum.h:25
OpalSextupole
Definition:
OpalSextupole.h:24
OpalSlit
Definition:
OpalSlit.h:25
OpalSolenoid
Definition:
OpalSolenoid.h:24
OpalSource
Definition:
OpalSource.h:24
OpalStripper
Definition:
OpalStripper.h:31
OpalTravelingWave
Definition:
OpalTravelingWave.h:25
OpalUndulator
Definition:
OpalUndulator.h:26
OpalVacuum
Definition:
OpalVacuum.h:29
OpalVariableRFCavity
Definition:
OpalVariableRFCavity.h:35
OpalVariableRFCavityFringeField
Definition:
OpalVariableRFCavityFringeField.h:35
OpalVerticalFFAMagnet
Definition:
OpalVerticalFFAMagnet.h:23
OpalVKicker
Definition:
OpalVKicker.h:25
Line
Definition:
Line.h:32
Sequence
Definition:
Sequence.h:33
MacroCmd
Definition:
MacroCmd.h:35
Constraint
Definition:
Constraint.h:6
DVar
Definition:
DVar.h:6
Objective
Definition:
Objective.h:6
OptimizeCmd
The OPTIMIZE command.
Definition:
OptimizeCmd.h:16
OpalSample
Definition:
OpalSample.h:31
SampleCmd
Definition:
SampleCmd.h:28
Beam
Definition:
Beam.h:31
BoundaryGeometry
Definition:
BoundaryGeometry.h:58
FieldSolver
Definition:
FieldSolver.h:52
OpalWake
Definition:
OpalWake.h:26
ParticleMatterInteraction
Definition:
ParticleMatterInteraction.h:34
List
The LIST command.
Definition:
List.h:32
TrackCmd
Definition:
TrackCmd.h:27
OpalFilter
Definition:
OpalFilter.h:30
BoolConstant
Definition:
BoolConstant.h:24
RealConstant
Definition:
RealConstant.h:24
RealVariable
Definition:
RealVariable.h:24
RealVector
Definition:
RealVector.h:24
StringConstant
Definition:
StringConstant.h:24
Generated on Thu Oct 20 2022 17:40:11 for OPAL (Object Oriented Parallel Accelerator Library) by
1.9.3