OPAL (Object Oriented Parallel Accelerator Library)  2024.1
OPAL
PyMultipoleT.cpp
Go to the documentation of this file.
1 //
2 // Python API for OpalMultipoleT
3 //
4 // Copyright (c) 2023, Chris Rogers, STFC Rutherford Appleton Laboratory, Didcot, UK
5 //
6 // This file is part of OPAL.
7 //
8 // OPAL is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
15 //
18 #include "PyOpal/PyCore/Globals.h"
19 
21 
22 namespace PyOpal {
23 
24 namespace PyMultipoleT {
25 
26 const char* module_docstring =
27  "multipolet contains the MultipoleT class\n";
28 
29 template <>
30 std::vector<PyOpalObjectNS::AttributeDef> PyOpalObjectNS::PyOpalObject<OpalMultipoleT>::attributes = {
31  {"TP", "t_p", "", PyOpalObjectNS::FLOAT_LIST},
32  {"LFRINGE", "left_fringe", "", PyOpalObjectNS::DOUBLE},
33  {"RFRINGE", "right_fringe", "", PyOpalObjectNS::DOUBLE},
34  {"HAPERT", "horizontal_aperture", "", PyOpalObjectNS::DOUBLE},
35  {"VAPERT", "vertical_aperture", "", PyOpalObjectNS::DOUBLE},
36  {"ANGLE", "angle", "", PyOpalObjectNS::DOUBLE},
37  {"EANGLE", "entrance_angle", "", PyOpalObjectNS::DOUBLE},
38  {"MAXFORDER", "maximum_f_order", "", PyOpalObjectNS::DOUBLE},
39  {"MAXXORDER", "maximum_x_order", "", PyOpalObjectNS::DOUBLE},
40  {"ROTATION", "rotation", "", PyOpalObjectNS::DOUBLE},
41  {"VARRADIUS", "variable_radius", "", PyOpalObjectNS::BOOL},
42  {"BBLENGTH", "bounding_box_length", "", PyOpalObjectNS::DOUBLE},
43  {"L", "length", "", PyOpalObjectNS::DOUBLE},
44  {"DELETEONTRANSVERSEEXIT", "delete_on_transverse_exit", "", PyOpalObjectNS::BOOL}
45 };
46 
47 template <>
49 "MultipoleT class is a field element that models a Multipole with maxwellian\n"
50 "fringe fields. Placement is about the centre of the field object.\n";
51 
52 BOOST_PYTHON_MODULE(multipolet) {
56  auto elementClass = element.make_element_class("MultipoleT");
57  element.addGetFieldValue(elementClass, 1.0, 1.0, 1.0, 1e-1);
58 }
59 }
60 }
void Initialise()
Definition: Globals.cpp:50
BOOST_PYTHON_MODULE(multipolet)
boost::python::class_< PyC > make_element_class(const char *className)
Definition: PyOpalObject.h:752
const char * module_docstring
void addGetFieldValue(PYCLASS &pyclass, double distanceUnits, double timeUnits, double bfieldUnits, double efieldUnits)
Definition: PyOpalObject.h:805
constexpr double e
The value of .
Definition: Physics.h:39