OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
PyBeam.cpp
Go to the documentation of this file.
2#include "PyOpal/PyBeam.h"
3
4#include "Structure/Beam.h"
5
6namespace PyOpal {
7namespace PyBeamNS {
8
9std::string track_run_docstring = std::string();
10
11
12const char* module_docstring = "build a tracking object";
13
14// DOUBLE, STRING, BOOL, INT
15template <>
16std::vector<PyOpalObjectNS::AttributeDef> PyOpalObjectNS::PyOpalObject<Beam>::attributes = {
17 {"PARTICLE", "particle", "", PyOpalObjectNS::STRING},
18 {"MASS", "mass", "", PyOpalObjectNS::DOUBLE},
19 {"CHARGE", "charge", "", PyOpalObjectNS::DOUBLE},
20 {"ENERGY", "energy", "", PyOpalObjectNS::DOUBLE},
21 {"PC", "momentum", "", PyOpalObjectNS::DOUBLE},
22 {"GAMMA", "gamma", "", PyOpalObjectNS::DOUBLE},
23 {"BCURRENT", "beam_current", "", PyOpalObjectNS::DOUBLE},
24 {"EX", "ex", "", PyOpalObjectNS::DOUBLE},
25 {"EY", "ey", "", PyOpalObjectNS::DOUBLE},
26 {"ET", "et", "", PyOpalObjectNS::DOUBLE},
27 {"BFREQ", "beam_frequency", "", PyOpalObjectNS::DOUBLE},
28 {"NPART", "number_of_particles", "", PyOpalObjectNS::DOUBLE},
29 {"NSLICE", "number_of_slices", "", PyOpalObjectNS::DOUBLE},
30};
31
32template <>
34
38 auto beamClass = aBeam.make_class("Beam");
39 aBeam.addRegister(beamClass);
40}
41
42} // PyBeamNS
43} // PyOpal
44
std::string track_run_docstring
Definition: PyBeam.cpp:9
BOOST_PYTHON_MODULE(beam)
Definition: PyBeam.cpp:35
const char * module_docstring
Definition: PyBeam.cpp:12
void addRegister(PYCLASS &pyclass)
Definition: PyOpalObject.h:456
boost::python::class_< PyC > make_class(const char *className)
Definition: PyOpalObject.h:439