16 #ifndef dealii_polynomials_piecewise_h 17 #define dealii_polynomials_piecewise_h 21 #include <deal.II/base/config.h> 23 #include <deal.II/base/exceptions.h> 24 #include <deal.II/base/point.h> 25 #include <deal.II/base/polynomial.h> 26 #include <deal.II/base/subscriptor.h> 30 DEAL_II_NAMESPACE_OPEN
54 template <
typename number>
72 const bool spans_next_interval);
81 value(
const number x)
const;
98 value(
const number x, std::vector<number> &values)
const;
116 value(
const number x,
117 const unsigned int n_derivatives,
118 number * values)
const;
131 template <
class Archive>
133 serialize(Archive &ar,
const unsigned int version);
168 std::vector<PiecewisePolynomial<double>>
170 const unsigned int n_subdivisions,
171 const unsigned int base_degree);
182 template <
typename number>
186 return polynomial.degree();
191 template <
typename number>
200 const number step = 1. / n_intervals;
203 if (spans_two_intervals ==
true)
205 const number offset = step * interval;
208 else if (x > offset + step + step)
210 else if (x < offset + step)
213 y = offset + step + step - x;
217 const number offset = step * interval;
218 if (x < offset || x > offset + step)
224 return polynomial.value(y);
227 return polynomial.value(x);
232 template <
typename number>
233 template <
class Archive>
242 ar &spans_two_intervals;
247 DEAL_II_NAMESPACE_CLOSE
#define AssertIndexRange(index, range)
void serialize(Archive &ar, const unsigned int version)
number value(const number x) const
std::vector< PiecewisePolynomial< double > > generate_complete_Lagrange_basis_on_subdivisions(const unsigned int n_subdivisions, const unsigned int base_degree)
Polynomial< number > polynomial
unsigned int degree() const
PiecewisePolynomial(const Polynomial< number > &coefficients_on_interval, const unsigned int n_intervals, const unsigned int interval, const bool spans_next_interval)