36 std::string(
"The \"SPLINE_TIME_DEPENDENCE\" element defines ")+\
37 std::string(
"an array of times and corresponding values for time lookup, ")+\
38 std::string(
"for use in time-dependent elements. Lookup is supported at ")+\
39 std::string(
"first order or third order with quadratic smoothing.");
45 "SPLINE_TIME_DEPENDENCE",
48 "Order of the lookup - either 1 for linear interpolation, "
49 "or 3 for cubic interpolation with quadratic smoothing. "
50 "Other values make an error.", 1);
53 "Array of real times in ns. There must be at least \"ORDER\"+1 "
54 "elements in the array and they must be strictly monotically "
58 "Array of real values. The length of \"VALUES\" must be the "
59 "same as the length of \"TIMES\".");
79 if (order != 1.0 && order != 3.0) {
81 "SPLINE_TIME_DEPENDENCE \"ORDER\" should be 1 or 3.");
84 std::vector<double> times;
90 std::vector<double> values;
96 const auto spline = std::make_shared<SplineTimeDependence>(
static_cast<size_t>(order),
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.
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
OpalSplineTimeDependence * clone(const std::string &name) override
void print(std::ostream &) const override
OpalSplineTimeDependence()
The base class for all OPAL exceptions.