OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
PyTrackCmd.cpp
Go to the documentation of this file.
2#include "PyOpal/PyTrackRun.h"
3
4#include "Track/TrackCmd.h"
5
6namespace PyOpal {
7namespace PyTrackRunNS {
8
9const char* module_docstring = "build a tracking object";
10
11template <>
12std::vector<PyOpalObjectNS::AttributeDef> PyOpalObjectNS::PyOpalObject<TrackCmd>::attributes = {
13 {"LINE", "line", "", PyOpalObjectNS::STRING},
14 {"BEAM", "beam", "", PyOpalObjectNS::STRING},
15 {"DT", "time_steps", "", PyOpalObjectNS::DOUBLE}, // array
16 {"DTSCINIT", "dt_space_charge", "", PyOpalObjectNS::DOUBLE},
17 {"DTAU", "dtau", "", PyOpalObjectNS::DOUBLE},
18 {"T0", "t0", "", PyOpalObjectNS::DOUBLE},
19 {"MAXSTEPS", "max_steps", "", PyOpalObjectNS::DOUBLE},
20 {"STEPSPERTURN", "steps_per_turn", "", PyOpalObjectNS::DOUBLE},
21 {"ZSTART", "z_start", "", PyOpalObjectNS::DOUBLE},
22 {"ZSTOP", "z_stop", "", PyOpalObjectNS::DOUBLE},
23 {"TIMEINTEGRATOR", "time_integrator", "", PyOpalObjectNS::STRING},
24 {"MAP_ORDER", "map_order", "", PyOpalObjectNS::DOUBLE},
25};
26
27template <>
29
31 std::shared_ptr<TrackCmd> objectPtr = cmd.getOpalShared();
32 objectPtr->setIsParseable(false);
33 objectPtr->execute();
34}
35
40 auto trackClass = trackCmd.make_class("Track");
41 trackClass.def("execute", &executeWrapper);
42}
43
44} // PyTrackRun
45} // PyOpal
46
void Initialise()
Definition: Globals.cpp:78
void executeWrapper(PyOpalObjectNS::PyOpalObject< TrackCmd > &cmd)
Definition: PyTrackCmd.cpp:30
const char * module_docstring
Definition: PyTrackCmd.cpp:9
std::shared_ptr< C > getOpalShared()
Definition: PyOpalObject.h:190
boost::python::class_< PyC > make_class(const char *className)
Definition: PyOpalObject.h:439