OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
PyRingDefinition.cpp
Go to the documentation of this file.
3#include "PyOpal/Globals.h"
4
6
7//using namespace boost::python;
8namespace PyOpal {
9namespace PyRingDefinition {
10
11std::string ring_definition_docstring = std::string();
12
13
14const char* module_docstring = "build a ring_definition";
15
16template <>
17std::vector<PyOpalObjectNS::AttributeDef> PyOpalObjectNS::PyOpalObject<OpalRingDefinition>::attributes = {
18 {"LAT_RINIT", "lattice_initial_r", "", PyOpalObjectNS::DOUBLE},
19 {"LAT_PHIINIT", "lattice_initial_phi", "", PyOpalObjectNS::DOUBLE},
20 {"LAT_THETAINIT", "lattice_initial_theta", "", PyOpalObjectNS::DOUBLE},
21 {"BEAM_RINIT", "beam_initial_r", "", PyOpalObjectNS::DOUBLE},
22 {"BEAM_PHIINIT", "beam_initial_phi", "", PyOpalObjectNS::DOUBLE},
23 {"BEAM_PRINIT", "beam_initial_pr", "", PyOpalObjectNS::DOUBLE},
24 {"HARMONIC_NUMBER", "harmonic_number", "", PyOpalObjectNS::DOUBLE},
25 {"SYMMETRY", "symmetry", "", PyOpalObjectNS::INT},
26 {"SCALE", "scale", "", PyOpalObjectNS::DOUBLE},
27 {"RFFREQ", "rf_frequency", "", PyOpalObjectNS::DOUBLE},
28 {"IS_CLOSED", "is_closed", "", PyOpalObjectNS::STRING}, // BUG in underlying code
29 {"MIN_R", "minimum_r", "", PyOpalObjectNS::DOUBLE},
30 {"MAX_R", "maximum_r", "", PyOpalObjectNS::DOUBLE},
31};
32
33template <>
35
36BOOST_PYTHON_MODULE(ring_definition) {
40 auto elementClass = element.make_class("RingDefinition");
41 element.addGetOpalElement(elementClass);
42 elementClass.def("get_field_value", &PyOpalObjectNS::getFieldValue<OpalRingDefinition>);
43}
44
45}
46}
void Initialise()
Definition: Globals.cpp:78
BOOST_PYTHON_MODULE(ring_definition)
void addGetOpalElement(PYCLASS &pyclass)
Definition: PyOpalObject.h:462
boost::python::class_< PyC > make_class(const char *className)
Definition: PyOpalObject.h:439