23 "The \"SPLINE_TIME_DEPENDENCE\" element defines "
24 "an array of times and corresponding values for time lookup, "
25 "for use in time-dependent elements. Lookup is supported at "
26 "first order or third order with quadratic smoothing.";
31 :
OpalElement(static_cast<int>(
SIZE),
"SPLINE_TIME_DEPENDENCE", doc_string.c_str()) {
34 "Order of the lookup - either 1 for linear interpolation, "
35 "or 3 for cubic interpolation with quadratic smoothing. "
36 "Other values make an error.",
41 "Array of real times in ns. There must be at least \"ORDER\"+1 "
42 "elements in the array and they must be strictly monotically "
47 "Array of real values. The length of \"VALUES\" must be the "
48 "same as the length of \"TIMES\".");
68 "OpalSplineTimeDependence::update",
69 "SPLINE_TIME_DEPENDENCE \"ORDER\" should be 1 or 3.");
72 std::vector<double> times;
78 std::vector<double> values;
85 std::make_shared<SplineTimeDependence>(
static_cast<size_t>(order), times, values);
static void setTimeDependence(const std::string &name, std::shared_ptr< AbstractTimeDependence > time_dep)
const std::string & getOpalName() const
Return object name.
std::vector< Attribute > itsAttr
The object attributes.
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()
static constexpr size_t CubicInterpolation
static constexpr size_t LinearInterpolation
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.