16#ifndef dealii_polynomials_piecewise_h
17#define dealii_polynomials_piecewise_h
63 template <
typename number>
81 const bool spans_next_interval);
90 const unsigned int index);
99 value(
const number x)
const;
116 value(
const number x, std::vector<number> &values)
const;
134 value(
const number x,
135 const unsigned int n_derivatives,
136 number * values)
const;
150 template <
class Archive>
152 serialize(Archive &ar,
const unsigned int version);
211 std::vector<PiecewisePolynomial<double>>
213 const unsigned int n_subdivisions,
214 const unsigned int base_degree);
220 std::vector<PiecewisePolynomial<double>>
222 const std::vector<
Point<1>> &points);
233 template <
typename number>
237 if (points.size() > 0)
239 return polynomial.degree();
244 template <
typename number>
248 if (points.size() > 0)
250 if (x > points[index])
251 return std::max<number>(0.0,
252 1.0 - (x - points[index]) *
253 one_over_lengths[index]);
254 else if (x < points[index])
255 return std::max<number>(0.0,
256 0.0 + (x - points[index - 1]) *
257 one_over_lengths[index - 1]);
267 const number step = 1. / n_intervals;
270 if (spans_two_intervals ==
true)
272 const number offset = step * interval;
275 else if (x > offset + step + step)
277 else if (x < offset + step)
280 y = offset + step + step - x;
284 const number offset = step * interval;
285 if (x < offset || x > offset + step)
291 return polynomial.value(y);
294 return polynomial.value(x);
299 template <
typename number>
300 template <
class Archive>
309 ar &spans_two_intervals;
311 ar &one_over_lengths;
Polynomial< number > polynomial
unsigned int degree() const
void serialize(Archive &ar, const unsigned int version)
std::vector< number > one_over_lengths
number value(const number x) const
virtual std::size_t memory_consumption() const
std::vector< number > points
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define AssertIndexRange(index, range)
std::vector< PiecewisePolynomial< double > > generate_complete_linear_basis_on_subdivisions(const std::vector< Point< 1 > > &points)
std::vector< PiecewisePolynomial< double > > generate_complete_Lagrange_basis_on_subdivisions(const unsigned int n_subdivisions, const unsigned int base_degree)