OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
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/OpalCavity.h
"
70
#include "
Elements/OpalCCollimator.h
"
71
#include "
Elements/OpalCyclotron.h
"
72
#include "
Elements/OpalDegrader.h
"
73
#include "
Elements/OpalDrift.h
"
74
#include "
Elements/OpalECollimator.h
"
75
#include "
Elements/OpalFlexibleCollimator.h
"
76
#include "
Elements/OpalHKicker.h
"
77
#include "
Elements/OpalKicker.h
"
78
#include "
Elements/OpalMarker.h
"
79
#include "
Elements/OpalMonitor.h
"
80
#include "
Elements/OpalMultipole.h
"
81
#include "
Elements/OpalMultipoleT.h
"
82
#include "
Elements/OpalMultipoleTStraight.h
"
83
#include "
Elements/OpalMultipoleTCurvedConstRadius.h
"
84
#include "
Elements/OpalMultipoleTCurvedVarRadius.h
"
85
#include "
Elements/OpalOctupole.h
"
86
#include "
Elements/OpalOffset/OpalLocalCartesianOffset.h
"
87
#include "
Elements/OpalOffset/OpalLocalCylindricalOffset.h
"
88
#include "
Elements/OpalOffset/OpalGlobalCartesianOffset.h
"
89
#include "
Elements/OpalOffset/OpalGlobalCylindricalOffset.h
"
90
#include "
Elements/OpalPepperPot.h
"
91
#include "
Elements/OpalPolynomialTimeDependence.h
"
92
#include "
Elements/OpalProbe.h
"
93
#include "
Elements/OpalQuadrupole.h
"
94
#include "
Elements/OpalRBend.h
"
95
#include "
Elements/OpalRBend3D.h
"
96
#include "
Elements/OpalRCollimator.h
"
97
#include "
Elements/OpalRingDefinition.h
"
98
#include "
Elements/OpalSBend.h
"
99
#include "
Elements/OpalSBend3D.h
"
100
#include "
Elements/OpalScalingFFAMagnet.h
"
101
#include "
Elements/OpalSeptum.h
"
102
#include "
Elements/OpalSextupole.h
"
103
#include "
Elements/OpalSlit.h
"
104
#include "
Elements/OpalSolenoid.h
"
105
#include "
Elements/OpalSource.h
"
106
#include "
Elements/OpalStripper.h
"
107
#include "
Elements/OpalTravelingWave.h
"
108
#include "
Elements/OpalVacuum.h
"
109
#include "
Elements/OpalVariableRFCavity.h
"
110
#include "
Elements/OpalVariableRFCavityFringeField.h
"
111
#include "
Elements/OpalVerticalFFAMagnet.h
"
112
#include "
Elements/OpalVKicker.h
"
113
114
#ifdef ENABLE_OPAL_FEL
115
#include "
Elements/OpalUndulator.h
"
116
#endif
117
118
// Structure-related commands.
119
#include "
Lines/Line.h
"
120
#include "
Lines/Sequence.h
"
121
122
// Optimize command
123
#include "
Optimize/OptimizeCmd.h
"
124
#include "
Optimize/DVar.h
"
125
#include "
Optimize/Objective.h
"
126
#include "
Optimize/Constraint.h
"
127
128
// Sample command
129
#include "
Sample/SampleCmd.h
"
130
#include "
Sample/OpalSample.h
"
131
132
#include "
changes.h
"
133
134
// Modify these methods to add new commands.
135
// ------------------------------------------------------------------------
136
137
namespace
{
138
139
void
makeActions() {
140
OpalData
*opal =
OpalData::getInstance
();
141
opal->
create
(
new
Call
());
142
opal->
create
(
new
DumpFields
());
143
opal->
create
(
new
DumpEMFields
());
144
opal->
create
(
new
Echo
());
145
opal->
create
(
new
Help
());
146
opal->
create
(
new
List
());
147
opal->
create
(
new
Option
());
148
opal->
create
(
new
OptimizeCmd
());
149
opal->
create
(
new
SampleCmd
());
150
opal->
create
(
new
Select
());
151
opal->
create
(
new
Stop
());
152
opal->
create
(
new
Quit
());
153
opal->
create
(
new
PSystem
());
154
opal->
create
(
new
System
());
155
opal->
create
(
new
Title
());
156
opal->
create
(
new
TrackCmd
());
157
opal->
create
(
new
Value
());
158
}
159
160
void
makeDefinitions() {
161
OpalData
*opal =
OpalData::getInstance
();
162
// Must create the value definitions first.
163
opal->
create
(
new
BoolConstant
());
164
opal->
create
(
new
RealConstant
());
165
opal->
create
(
new
RealVariable
());
166
opal->
create
(
new
RealVector
());
167
opal->
create
(
new
StringConstant
());
168
169
opal->
create
(
new
Beam
());
170
opal->
create
(
new
FieldSolver
());
171
opal->
create
(
new
BoundaryGeometry
());
172
opal->
create
(
new
OpalWake
());
173
opal->
create
(
new
ParticleMatterInteraction
());
174
175
opal->
create
(
new
OpalFilter
());
176
opal->
create
(
new
OpalTrimCoil
());
177
178
opal->
create
(
new
Distribution
());
179
180
opal->
create
(
new
MacroCmd
());
181
182
opal->
create
(
new
DVar
());
183
opal->
create
(
new
Objective
());
184
opal->
create
(
new
Constraint
());
185
186
opal->
create
(
new
OpalSample
());
187
}
188
189
void
makeElements() {
190
OpalData
*opal =
OpalData::getInstance
();
191
opal->
create
(
new
OpalCavity
());
192
opal->
create
(
new
OpalCCollimator
());
193
opal->
create
(
new
OpalCyclotron
());
194
opal->
create
(
new
OpalDegrader
());
195
opal->
create
(
new
OpalDrift
());
196
opal->
create
(
new
OpalECollimator
());
197
opal->
create
(
new
OpalFlexibleCollimator
());
198
opal->
create
(
new
OpalHKicker
());
199
opal->
create
(
new
OpalKicker
());
200
opal->
create
(
new
OpalMarker
());
201
opal->
create
(
new
OpalMonitor
());
202
opal->
create
(
new
OpalMultipole
());
203
opal->
create
(
new
OpalMultipoleT
());
204
opal->
create
(
new
OpalMultipoleTStraight
());
205
opal->
create
(
new
OpalMultipoleTCurvedConstRadius
());
206
opal->
create
(
new
OpalMultipoleTCurvedVarRadius
());
207
opal->
create
(
new
OpalOctupole
());
208
opal->
create
(
new
OpalOffset::OpalLocalCartesianOffset
());
209
// opal->create(new OpalOffset::OpalLocalCylindricalOffset());
210
// opal->create(new OpalOffset::OpalGlobalCartesianOffset());
211
// opal->create(new OpalOffset::OpalGlobalCylindricalOffset());
212
opal->
create
(
new
OpalPepperPot
());
213
opal->
create
(
new
OpalPolynomialTimeDependence
());
214
opal->
create
(
new
OpalProbe
());
215
opal->
create
(
new
OpalQuadrupole
());
216
opal->
create
(
new
OpalRBend
());
217
opal->
create
(
new
OpalRBend3D
());
218
opal->
create
(
new
OpalRCollimator
());
219
opal->
create
(
new
OpalRingDefinition
());
220
opal->
create
(
new
OpalSBend
());
221
opal->
create
(
new
OpalSBend3D
());
222
opal->
create
(
new
OpalScalingFFAMagnet
());
223
opal->
create
(
new
OpalSeptum
());
224
opal->
create
(
new
OpalSextupole
());
225
opal->
create
(
new
OpalSlit
());
226
opal->
create
(
new
OpalSolenoid
());
227
opal->
create
(
new
OpalSource
());
228
opal->
create
(
new
OpalStripper
());
229
opal->
create
(
new
OpalTravelingWave
());
230
#ifdef ENABLE_OPAL_FEL
231
opal->
create
(
new
OpalUndulator
());
232
#endif
233
opal->
create
(
new
OpalVacuum
());
234
opal->
create
(
new
OpalVariableRFCavity
());
235
opal->
create
(
new
OpalVariableRFCavityFringeField
());
236
opal->
create
(
new
OpalVerticalFFAMagnet
());
237
opal->
create
(
new
OpalVKicker
());
238
239
opal->
create
(
new
Line
());
240
opal->
create
(
new
Sequence
());
241
}
242
};
243
244
namespace
Configure
{
245
void
configure
() {
246
makeDefinitions();
247
makeElements();
248
makeActions();
249
Versions::fillChanges
();
250
}
251
};
OpalData.h
Call.h
DumpEMFields.h
DumpFields.h
Echo.h
Help.h
Option.h
PSystem.h
Quit.h
Select.h
Stop.h
System.h
Title.h
Value.h
changes.h
OpalTrimCoil.h
Distribution.h
OpalCavity.h
OpalCCollimator.h
OpalCyclotron.h
OpalDegrader.h
OpalDrift.h
OpalECollimator.h
OpalFlexibleCollimator.h
OpalHKicker.h
OpalKicker.h
OpalMarker.h
OpalMonitor.h
OpalMultipole.h
OpalMultipoleT.h
OpalMultipoleTCurvedConstRadius.h
OpalMultipoleTCurvedVarRadius.h
OpalMultipoleTStraight.h
OpalOctupole.h
OpalGlobalCartesianOffset.h
OpalGlobalCylindricalOffset.h
OpalLocalCartesianOffset.h
OpalLocalCylindricalOffset.h
OpalPepperPot.h
OpalPolynomialTimeDependence.h
OpalProbe.h
OpalQuadrupole.h
OpalRBend.h
OpalRBend3D.h
OpalRCollimator.h
OpalRingDefinition.h
OpalSBend.h
OpalSBend3D.h
OpalScalingFFAMagnet.h
OpalSeptum.h
OpalSextupole.h
OpalSlit.h
OpalSolenoid.h
OpalSource.h
OpalStripper.h
OpalTravelingWave.h
OpalUndulator.h
OpalVacuum.h
OpalVariableRFCavity.h
OpalVariableRFCavityFringeField.h
OpalVerticalFFAMagnet.h
OpalVKicker.h
Line.h
Sequence.h
Configure.h
MacroCmd.h
Constraint.h
DVar.h
Objective.h
OptimizeCmd.h
OpalSample.h
SampleCmd.h
Beam.h
BoundaryGeometry.h
FieldSolver.h
OpalWake.h
ParticleMatterInteraction.h
List.h
TrackCmd.h
OpalFilter.h
BoolConstant.h
RealConstant.h
RealVariable.h
RealVector.h
StringConstant.h
Versions::fillChanges
void fillChanges()
Definition:
changes.cpp:9
Configure
Definition:
Configure.cpp:244
Configure::configure
void configure()
Configure all commands.
Definition:
Configure.cpp:245
OpalData
The global OPAL structure.
Definition:
OpalData.h:49
OpalData::create
void create(Object *newObject)
Create new object.
Definition:
OpalData.cpp:475
OpalData::getInstance
static OpalData * getInstance()
Definition:
OpalData.cpp:195
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:25
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:206
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:32
BoundaryGeometry
Definition:
BoundaryGeometry.h:52
FieldSolver
The FieldSolver definition.
Definition:
FieldSolver.h:43
OpalWake
Definition:
OpalWake.h:26
ParticleMatterInteraction
Definition:
ParticleMatterInteraction.h:34
List
The LIST command.
Definition:
List.h:32
TrackCmd
The TRACK command.
Definition:
TrackCmd.h:28
OpalFilter
The FILTER definition.
Definition:
OpalFilter.h:32
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 Wed Aug 25 2021 16:41:04 for OPAL (Object Oriented Parallel Accelerator Library) by
1.9.1