OPAL (Object Oriented Parallel Accelerator Library) 2024.2
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//
19
22#include "Physics/Units.h"
23
24namespace PyOpal {
25
33 template <>
40
41 template <>
42 std::vector<PyOpalObjectNS::AttributeDef>
44 {"PHASE_MODEL", "phase_model", "", PyOpalObjectNS::STRING},
45 {"AMPLITUDE_MODEL", "amplitude_model", "", PyOpalObjectNS::STRING},
46 {"FREQUENCY_MODEL", "frequency_model", "", PyOpalObjectNS::STRING},
47 {"WIDTH", "width", "", PyOpalObjectNS::DOUBLE},
48 {"HEIGHT", "height", "", PyOpalObjectNS::DOUBLE},
49 {"CENTRE_LENGTH", "centre_length", "", PyOpalObjectNS::DOUBLE},
50 {"END_LENGTH", "end_length", "", PyOpalObjectNS::DOUBLE},
51 {"CAVITY_CENTRE", "cavity_centre", "", PyOpalObjectNS::DOUBLE},
52 {"MAX_ORDER", "max_order", "", PyOpalObjectNS::DOUBLE},
53 {"L", "length", "", PyOpalObjectNS::DOUBLE},
54 };
55
56 template <>
58 "VariableRFCavityFringeField class is a field element that models a rectangular RF cavity.";
59
61
62 const char* module_docstring =
63 "variable_rf_cavity contains the VariableRFCavityFringeField class";
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(
72 "update_time_dependence",
74 }
75 } // namespace PyVariableRFCavityFringeField
76} // namespace PyOpal
constexpr double s2ns
Definition Units.h:44
void Initialise()
Definition Globals.cpp:50
BOOST_PYTHON_MODULE(variable_rf_cavity_fringe_field)
static std::vector< AttributeDef > attributes
void addGetFieldValue(PYCLASS &pyclass, double distanceUnits, double timeUnits, double bfieldUnits, double efieldUnits)
boost::python::class_< PyC > make_element_class(const char *className)