OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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"
33#include "BasicActions/Echo.h"
34#include "BasicActions/Help.h"
35#include "BasicActions/Option.h"
37#include "BasicActions/Quit.h"
38#include "BasicActions/Select.h"
39#include "BasicActions/Stop.h"
40#include "BasicActions/System.h"
41#include "BasicActions/Title.h"
42#include "BasicActions/Value.h"
43
44// Macro command.
45#include "OpalParser/MacroCmd.h"
46
47// Commands introducing a special mode.
48#include "Track/TrackCmd.h"
49
50// Table-related commands.
51#include "Structure/Beam.h"
55// #include "Tables/List.h"
56
57// Value definitions commands.
63
64// Element commands.
65#include "Elements/OpalCavity.h"
67#include "Elements/OpalDrift.h"
68#include "Elements/OpalLaser.h"
69#include "Elements/OpalMarker.h"
74#include "Elements/OpalProbe.h"
76#include "Elements/OpalRBend.h"
78#include "Elements/OpalSBend.h"
85
86// Structure-related commands.
88#include "Lines/Line.h"
89
90#include "changes.h"
91
92// Modify these methods to add new commands.
93// ------------------------------------------------------------------------
94
95namespace {
96
97 void makeActions() {
99 opal->create(new Call());
100 opal->create(new DumpEMFields());
101 opal->create(new Echo());
102 opal->create(new Help());
103 opal->create(new Option());
104 opal->create(new Select());
105 opal->create(new Stop());
106 opal->create(new Quit());
107 opal->create(new PSystem());
108 opal->create(new System());
109 opal->create(new Title());
110 opal->create(new TrackCmd());
111 opal->create(new Value());
112 }
113
114 void makeDefinitions() {
116 // Must create the value definitions first.
117 opal->create(new BoolConstant());
118 opal->create(new RealConstant());
119 opal->create(new RealVariable());
120 opal->create(new RealVector());
121 opal->create(new StringConstant());
122
123 opal->create(new MacroCmd());
124
125 opal->create(new Beam());
126 opal->create(new EmissionSource());
127 opal->create(new FieldSolverCmd());
128 opal->create(new Distribution());
129 opal->create(new EmissionSourceList());
130 opal->create(new BinningCmd());
131 }
132
133 void makeElements() {
135 opal->create(new OpalCavity());
136 opal->create(new OpalTravelingWave());
137 opal->create(new OpalConstantEFieldCavity());
138 opal->create(new OpalDrift());
139 opal->create(new OpalLaser());
140 opal->create(new OpalMonitor());
141 opal->create(new OpalMarker());
142 opal->create(new OpalProbe());
143 opal->create(new OpalMultipole());
144 opal->create(new OpalQuadrupole());
145 opal->create(new OpalRBend());
146 opal->create(new OpalSBend());
147 opal->create(new OpalSolenoid());
148 opal->create(new OpalRingDefinition());
149 opal->create(new Line());
150 opal->create(new OpalVerticalFFAMagnet());
153 opal->create(new OpalSplineTimeDependence());
154 opal->create(new OpalMultipoleT());
155 opal->create(new OpalVariableRFCavity());
156 }
157}; // namespace
158
159namespace Configure {
160 void configure() {
161 makeDefinitions();
162 makeElements();
163 makeActions();
165 }
166}; // namespace Configure
Definition Beam.h:32
Definition Call.h:23
Definition Echo.h:23
Definition Help.h:23
Definition Line.h:30
The global OPAL structure.
Definition OpalData.h:45
void create(Object *newObject)
Create new object.
Definition OpalData.cpp:387
static OpalData * getInstance()
Definition OpalData.cpp:193
The MARKER element.
Definition OpalMarker.h:27
Definition Quit.h:23
Definition Stop.h:23
Definition Title.h:23
Definition Value.h:23
void configure()
Configure all commands.
void fillChanges()
Definition changes.cpp:12