OPAL (Object Oriented Parallel Accelerator Library)  2024.1
OPAL
PyEnge.cpp
Go to the documentation of this file.
5 
7 #include "Elements/OpalEnge.h"
8 
9 namespace PyOpal {
10 namespace PyEnge {
11 
12 const char* module_docstring =
13 "enge module holds an Enge end field 'plugin' class for use with field models\n";
14 
15 template <>
16 std::vector<PyOpalObjectNS::AttributeDef> PyOpalObjectNS::PyOpalObject<OpalEnge>::attributes = {
17  {"X0", "x0", "", PyOpalObjectNS::DOUBLE},
18  {"LAMBDA", "enge_lambda", "", PyOpalObjectNS::DOUBLE}, // lambda is a python reserved word
19  {"COEFFICIENTS", "coefficients", "", PyOpalObjectNS::FLOAT_LIST},
20 };
21 
22 template <>
24 "Enge class is a field element that models a Enge function.\n"
25 "\n"
26 "It is referenced and set to field elements by use of the OPAL name (note not\n"
27 "any python name). The OPAL name is set/retrieved using 'set_opal_name' and\n"
28 "'get_opal_name' respectively.\n";
29 
34  auto elementClass = element.make_class("Enge");
35  elementClass.def("function", &PyOpal::PyEndFieldModel::function<OpalEnge>);
36  elementClass.def("update", &PyOpalObjectNS::update<OpalEnge>);
37 }
38 
39 }
40 }
void Initialise()
Definition: Globals.cpp:50
BOOST_PYTHON_MODULE(enge)
Definition: PyEnge.cpp:30
const char * module_docstring
Definition: PyEnge.cpp:12
boost::python::class_< PyC > make_class(const char *className)
Definition: PyOpalObject.h:745