34 std::string(
"The \"SPLINE_TIME_DEPENDENCE\" element defines ")+\
35 std::string(
"an array of times and corresponding values for time lookup, ")+\
36 std::string(
"for use in time-dependent elements. Lookup is supported at ")+\
37 std::string(
"first order or third order with quadratic smoothing.");
43 "SPLINE_TIME_DEPENDENCE",
46 std::string(
"Order of the lookup - either 1 for linear interpolation, ")+
47 std::string(
"or 3 for cubic interpolation with quadratic smoothing. ")+
48 std::string(
"Other values make an error."));
51 std::string(
"Array of real times in ns. There must be at least \"ORDER\"+1 ")+
52 std::string(
"elements in the array and they must be strictly monotically ")+
53 std::string(
"increasing"));
56 std::string(
"Array of real values. The length of \"VALUES\" must be the ")+
57 std::string(
"same as the length of \"TIMES\"."));
80 if ((orderReal - 1.) > 1
e-9 && (orderReal - 3.) > 1
e-9) {
82 "SPLINE_TIME_DEPENDENCE \"ORDER\" should be 1 or 3.");
84 size_t order(
floor(orderReal));
87 std::shared_ptr<SplineTimeDependence> spline =
88 std::make_shared<SplineTimeDependence>(order,
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
double getReal(const Attribute &attr)
Return real value.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
Attribute makeRealArray(const std::string &name, const std::string &help)
Create real array attribute.
std::vector< double > getRealArray(const Attribute &attr)
Get array value.
constexpr double e
The value of.
const std::string & getOpalName() const
Return object name.
std::vector< Attribute > itsAttr
The object attributes.
static void setTimeDependence(std::string name, std::shared_ptr< AbstractTimeDependence > time_dep)
virtual void print(std::ostream &) const
Print the object.
void registerOwnership() const
static const std::string doc_string
virtual void print(std::ostream &) const
virtual OpalSplineTimeDependence * clone(const std::string &name)
virtual ~OpalSplineTimeDependence()
OpalSplineTimeDependence()
The base class for all OPAL exceptions.