File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ class Spline : public ScalarFieldBase<1, Spline> {
5252 template <typename InputType_>
5353 requires (internals::is_subscriptable<InputType_, int > || std::is_floating_point_v<InputType_>)
5454 constexpr Scalar operator ()(const InputType_& p_) const {
55+ if (n_ > order_) { return 0.0 ; } // derivative order higher than spline order
5556 double p;
5657 if constexpr (internals::is_subscriptable<InputType_, int >) {
5758 p = p_[0 ];
@@ -117,7 +118,7 @@ class Spline : public ScalarFieldBase<1, Spline> {
117118 })
118119 Spline (KnotsVectorType&& knots, int i, int order) : i_(i), order_(order) {
119120 fdapde_assert (
120- i >= 0 && order > 0 && std::cmp_greater_equal (knots.size (), order_ + 1 ) && std::cmp_less (i_, knots.size ()));
121+ i >= 0 && order >= 0 && std::cmp_greater_equal (knots.size (), order + 1 ) && std::cmp_less (i_, knots.size ()));
121122 knots_.reserve (knots.size ());
122123 for (std::size_t i = 0 ; i < knots.size (); ++i) { knots_.push_back (knots[i]); }
123124 };
You can’t perform that action at this time.
0 commit comments