OPAL (Object Oriented Parallel Accelerator Library)  2024.1
OPAL
PyVariableRFCavityFringeField.cpp
Go to the documentation of this file.
1 //
2 // Python API for OpalVariableRFCavityFringeField
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 //
17 #include "PyOpal/PyCore/Globals.h"
19 
22 #include "Physics/Units.h"
23 
24 
25 namespace PyOpal {
26 
34 template <>
36  object_m->update();
38  dynamic_cast<VariableRFCavityFringeField*>(object_m->getElement());
39  rf->initialise();
40 }
41 
42 namespace PyVariableRFCavityFringeField {
43 
44 const char* module_docstring =
45  "variable_rf_cavity contains the VariableRFCavityFringeField class";
46 
47 template <>
48 std::vector<PyOpalObjectNS::AttributeDef> PyOpalObjectNS::PyOpalObject<OpalVariableRFCavityFringeField>::attributes = {
49  {"PHASE_MODEL", "phase_model", "", PyOpalObjectNS::STRING},
50  {"AMPLITUDE_MODEL", "amplitude_model", "", PyOpalObjectNS::STRING},
51  {"FREQUENCY_MODEL", "frequency_model", "", PyOpalObjectNS::STRING},
52  {"WIDTH", "width", "", PyOpalObjectNS::DOUBLE},
53  {"HEIGHT", "height", "", PyOpalObjectNS::DOUBLE},
54  {"CENTRE_LENGTH", "centre_length", "", PyOpalObjectNS::DOUBLE},
55  {"END_LENGTH", "end_length", "", PyOpalObjectNS::DOUBLE},
56  {"CAVITY_CENTRE", "cavity_centre", "", PyOpalObjectNS::DOUBLE},
57  {"MAX_ORDER", "max_order", "", PyOpalObjectNS::DOUBLE},
58  {"L", "length", "", PyOpalObjectNS::DOUBLE},
59 };
60 
61 template <>
63 "VariableRFCavityFringeField class is a field element that models a rectangular RF cavity.";
64 
65 BOOST_PYTHON_MODULE(variable_rf_cavity_fringe_field) {
69  auto elementClass = element.make_element_class("VariableRFCavityFringeField");
70  element.addGetFieldValue(elementClass, 1.0, Units::s2ns, 1.0, 1e-1);
71  elementClass.def("update_time_dependence",
73 }
74 }
75 }
void Initialise()
Definition: Globals.cpp:50
boost::python::class_< PyC > make_element_class(const char *className)
Definition: PyOpalObject.h:752
constexpr double s2ns
Definition: Units.h:44
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
BOOST_PYTHON_MODULE(variable_rf_cavity_fringe_field)