1 #ifndef PYELEMENTS_PYENDFIELDMODEL_H
2 #define PYELEMENTS_PYENDFIELDMODEL_H
8 namespace PyEndFieldModel {
11 "update the Enge object and then calculate the enge function or derivative\n"
12 "- x [float]: position at which to evaluate the function\n"
13 "- n [int]: derivative to calculate; 0 will return the enge function, 1 will\n"
14 " return the 1st derivative, etc. Note that floating point precision\n"
15 " becomes increasingly limiting for n > 10 or so.\n"
16 "Returns the function value or derivative.\n";
21 throw OpalException(
"n must be positive as it indexes the derivative",
22 "PyEndFieldModel::function");
24 std::shared_ptr<C> objectPtr = pyobject.getOpalShared();
26 std::string
name = objectPtr->getOpalName();
28 model->setMaximumDerivative(
n);
29 double value = model->function(x,
n);
36 #endif // PYELEMENTS_PYENDFIELDMODEL_H
The base class for all OPAL exceptions.
std::string functionDocstring
static std::shared_ptr< EndFieldModel > getEndFieldModel(std::string name)