1#ifndef PYELEMENTS_PYENDFIELDMODEL_H
2#define PYELEMENTS_PYENDFIELDMODEL_H
8namespace 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");
26 std::string
name = objectPtr->getOpalName();
28 model->setMaximumDerivative(
n);
29 double value = model->function(x,
n);
double function(PyOpalObjectNS::PyOpalObject< C > pyobject, double x, int n)
std::string functionDocstring
static std::shared_ptr< EndFieldModel > getEndFieldModel(std::string name)
Look up the EndFieldModel that has a given name.
PyOpalObject<C> is the basic wrapper class for Opal Objects.
std::shared_ptr< C > getOpalShared()
Returns the Opal Object from the PyOpalObject.
The base class for all OPAL exceptions.