OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
PyAbstractTimeDependence.h
Go to the documentation of this file.
1#ifndef PYELEMENTS_PYABSTRACTTIMEDEPENDENCE_H
2#define PYELEMENTS_PYABSTRACTTIMEDEPENDENCE_H
3
6
7namespace PyOpal {
9
10std::string functionDocstring =
11"Update the TimeDependence and then calculate the value at a give time\n"
12"- t [float]: time at which to evaluate the function\n"
13"Returns the function value.\n";
14
15template <class C>
16double function(PyOpalObjectNS::PyOpalObject<C> pyobject, double t) {
17 std::shared_ptr<C> objectPtr = pyobject.getOpalShared();
18 objectPtr->update();
19 std::string name = objectPtr->getOpalName();
20 std::shared_ptr<AbstractTimeDependence> model =
22 double value = model->getValue(t);
23 return value;
24}
25
26}
27}
28
29#endif // PYELEMENTS_PYABSTRACTTIMEDEPENDENCE_H
const std::string name
double function(PyOpalObjectNS::PyOpalObject< C > pyobject, double t)
static std::shared_ptr< AbstractTimeDependence > getTimeDependence(std::string name)
std::shared_ptr< C > getOpalShared()