OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
PyEnge.cpp
Go to the documentation of this file.
5
7#include "Elements/OpalEnge.h"
8
9namespace PyOpal {
10 template <>
11 std::vector<PyOpalObjectNS::AttributeDef> PyOpalObjectNS::PyOpalObject<OpalEnge>::attributes = {
12 {"X0", "x0", "", PyOpalObjectNS::DOUBLE},
13 {"LAMBDA", "enge_lambda", "", PyOpalObjectNS::DOUBLE}, // lambda is a python reserved word
14 {"COEFFICIENTS", "coefficients", "", PyOpalObjectNS::FLOAT_LIST},
15 };
16
17 template <>
19 "Enge class is a field element that models a Enge function.\n"
20 "\n"
21 "It is referenced and set to field elements by use of the OPAL name (note not\n"
22 "any python name). The OPAL name is set/retrieved using 'set_opal_name' and\n"
23 "'get_opal_name' respectively.\n";
24
25 namespace PyEnge {
26
27 const char* module_docstring =
28 "enge module holds an Enge end field 'plugin' class for use with field models\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 } // namespace PyEnge
40} // namespace PyOpal
void registerExceptions()
Register exception translations with boost.
void Initialise()
Globals namespace provides routines to initialise global objects:
Definition: Globals.cpp:50
const char * module_docstring
Definition: PyEnge.cpp:27
BOOST_PYTHON_MODULE(enge)
Definition: PyEnge.cpp:30
PyOpalObject<C> is the basic wrapper class for Opal Objects.
Definition: PyOpalObject.h:138
boost::python::class_< PyC > make_class(const char *className)
This is the basic method to make a class for OpalObjects.
Definition: PyOpalObject.h:745