OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
PySinusoidalTimeDependence.cpp
Go to the documentation of this file.
1//
2// Class PySinusoidalTimeDependence
3// Python interface for the time dependence class that generates sine waves
4//
5// Copyright (c) 2025, Jon Thompson, Isis, RAL, UK
6//
7// This file is part of OPAL.
8//
9// OPAL is free software: you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation, either version 3 of the License, or
12// (at your option) any later version.
13//
14// You should have received a copy of the GNU General Public License
15// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
16//
17
21
24
25namespace PyOpal {
26 template <>
27 std::vector<PyOpalObjectNS::AttributeDef>
29 {"FREQUENCIES", "frequencies", "", FLOAT_LIST},
30 {"AMPLITUDES", "amplitudes", "", FLOAT_LIST},
31 {"PHASE_OFFSETS", "phase_offsets", "", FLOAT_LIST},
32 {"DC_OFFSETS", "dc_offsets", "", FLOAT_LIST},
33 };
34
35 template <>
37 "SinusoidalTimeDependence class enables modelling time dependent behaviour.\n"
38 "\n"
39 "SinsoidalTimeDependence class enables modelling lattice parameters that are\n"
40 "changing in time, for example RF voltages, frequencies, etc. The dependence\n"
41 "is referenced and set to field elements by use of the OPAL name (note not\n"
42 "any python name). The OPAL name is set/retrieved using 'set_opal_name' and\n"
43 "'get_opal_name' respectively.\n";
44
46
47 const char* module_docstring =
48 "sinusoidal_time_dependence module holds a SinusoidalTimeDependence class";
49
50 BOOST_PYTHON_MODULE(sinusoidal_time_dependence) {
54 auto elementClass = element.make_class("SinusoidalTimeDependence");
55 elementClass.def(
56 "function",
59 }
60
61 } // namespace PyOpalSinusoidalTimeDependence
62} // namespace PyOpal
void Initialise()
Definition Globals.cpp:50
void update(PyOpalObjectNS::PyOpalObject< C > pyelement)
double function(PyOpalObjectNS::PyOpalObject< C > pyobject, double t)
static std::vector< AttributeDef > attributes
boost::python::class_< PyC > make_class(const char *className)