OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
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"
38#include "BasicActions/Quit.h"
39#include "BasicActions/Select.h"
40#include "BasicActions/Stop.h"
41#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"
54// #include "Tables/List.h"
55
56// Value definitions commands.
62
63// Element commands.
64#include "Elements/OpalCavity.h"
65#include "Elements/OpalDrift.h"
66#include "Elements/OpalMarker.h"
68#include "Elements/OpalProbe.h"
72
73// Structure-related commands.
74#include "Lines/Line.h"
75
76#include "changes.h"
77
78// Modify these methods to add new commands.
79// ------------------------------------------------------------------------
80
81namespace {
82
83 void makeActions() {
85 opal->create(new Call());
86 opal->create(new DumpFields());
87 opal->create(new DumpEMFields());
88 opal->create(new Echo());
89 opal->create(new Help());
90 opal->create(new Option());
91 opal->create(new Select());
92 opal->create(new Stop());
93 opal->create(new Quit());
94 opal->create(new PSystem());
95 opal->create(new System());
96 opal->create(new Title());
97 opal->create(new TrackCmd());
98 opal->create(new Value());
99 }
100
101 void makeDefinitions() {
103 // Must create the value definitions first.
104 opal->create(new BoolConstant());
105 opal->create(new RealConstant());
106 opal->create(new RealVariable());
107 opal->create(new RealVector());
108 opal->create(new StringConstant());
109
110 opal->create(new MacroCmd());
111
112 opal->create(new Beam());
113 opal->create(new FieldSolverCmd());
114 opal->create(new Distribution());
115 }
116
117 void makeElements() {
119 opal->create(new OpalCavity());
120 opal->create(new OpalDrift());
121 opal->create(new OpalMarker());
122 opal->create(new OpalProbe());
123 opal->create(new OpalSolenoid());
124 opal->create(new OpalRingDefinition());
125 opal->create(new Line());
127 opal->create(new OpalVerticalFFAMagnet());
128 }
129}; // namespace
130
131namespace Configure {
132 void configure() {
133 makeDefinitions();
134 makeElements();
135 makeActions();
137 }
138}; // namespace Configure
void fillChanges()
Definition changes.cpp:12
void configure()
Configure all commands.
The global OPAL structure.
Definition OpalData.h:45
void create(Object *newObject)
Create new object.
Definition OpalData.cpp:473
static OpalData * getInstance()
Definition OpalData.cpp:195
Definition Call.h:24
Definition Echo.h:24
Definition Help.h:24
Definition Quit.h:24
Definition Stop.h:24
Definition Title.h:24
Definition Value.h:24
The MARKER element.
Definition OpalMarker.h:28
Definition Line.h:30
Definition Beam.h:31