15#ifndef dealii_polynomials_piecewise_h
16#define dealii_polynomials_piecewise_h
62 template <
typename number>
80 const bool spans_next_interval);
89 const unsigned int index);
98 value(
const number x)
const;
115 value(
const number x, std::vector<number> &values)
const;
133 value(
const number x,
134 const unsigned int n_derivatives,
135 number *values)
const;
149 template <
class Archive>
151 serialize(Archive &ar,
const unsigned int version);
210 std::vector<PiecewisePolynomial<double>>
212 const unsigned int n_subdivisions,
213 const unsigned int base_degree);
219 std::vector<PiecewisePolynomial<double>>
221 const std::vector<
Point<1>> &points);
232 template <
typename number>
236 if (points.size() > 0)
238 return polynomial.degree();
243 template <
typename number>
247 if (points.size() > 0)
249 if (x > points[index])
250 return std::max<number>(0.0,
251 1.0 - (x - points[index]) *
252 one_over_lengths[index]);
253 else if (x < points[index])
254 return std::max<number>(0.0,
255 0.0 + (x - points[index - 1]) *
256 one_over_lengths[index - 1]);
266 const number step = 1. / n_intervals;
269 if (spans_two_intervals ==
true)
271 const number offset = step * interval;
274 else if (x > offset + step + step)
276 else if (x < offset + step)
279 y = offset + step + step - x;
283 const number offset = step * interval;
284 if (x < offset || x > offset + step)
290 return polynomial.value(y);
293 return polynomial.value(x);
298 template <
typename number>
299 template <
class Archive>
308 ar &spans_two_intervals;
310 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)