OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
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//
27
29
30// Basic action commands.
31#include "BasicActions/Call.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"
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"
55#include "Structure/OpalWake.h"
59#include "Tables/List.h"
60
61// Value definitions commands.
67
68// Element commands.
70#include "Elements/OpalCavity.h"
74#include "Elements/OpalDrift.h"
76#include "Elements/OpalEnge.h"
79#include "Elements/OpalKicker.h"
80#include "Elements/OpalMarker.h"
94#include "Elements/OpalProbe.h"
96#include "Elements/OpalRBend.h"
100#include "Elements/OpalSBend.h"
101#include "Elements/OpalSBend3D.h"
103#include "Elements/OpalSeptum.h"
105#include "Elements/OpalSlit.h"
107#include "Elements/OpalSource.h"
110#include "Elements/OpalVacuum.h"
114#include "Elements/OpalVKicker.h"
115
116#ifdef ENABLE_OPAL_FEL
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
139namespace {
140
141 void makeActions() {
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() {
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());
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() {
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());
210 opal->create(new OpalOctupole());
212// opal->create(new OpalOffset::OpalLocalCylindricalOffset());
213// opal->create(new OpalOffset::OpalGlobalCartesianOffset());
214// opal->create(new OpalOffset::OpalGlobalCylindricalOffset());
215 opal->create(new OpalPepperPot());
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());
239 opal->create(new OpalVerticalFFAMagnet());
240 opal->create(new OpalVKicker());
241
242 opal->create(new Line());
243 opal->create(new Sequence());
244 }
245};
246
247namespace Configure {
248 void configure() {
249 makeDefinitions();
250 makeElements();
251 makeActions();
253 }
254};
void fillChanges()
Definition: changes.cpp:9
void configure()
Configure all commands.
Definition: Configure.cpp:248
The global OPAL structure.
Definition: OpalData.h:49
void create(Object *newObject)
Create new object.
Definition: OpalData.cpp:476
static OpalData * getInstance()
Definition: OpalData.cpp:196
Definition: Call.h:24
Definition: Echo.h:24
Definition: Help.h:24
Definition: Option.h:30
Definition: Quit.h:24
Definition: Select.h:26
Definition: Stop.h:24
Definition: System.h:24
Definition: Title.h:24
Definition: Value.h:24
The MARKER element.
Definition: OpalMarker.h:28
Definition: Line.h:32
Definition: DVar.h:6
The OPTIMIZE command.
Definition: OptimizeCmd.h:16
Definition: Beam.h:31
The LIST command.
Definition: List.h:32