15#ifndef dealii_polynomial_space_h
16#define dealii_polynomial_space_h
119 template <
typename StreamType>
145 std::vector<double> &values,
236 virtual std::unique_ptr<ScalarPolynomialsBase<dim>>
237 clone()
const override;
248 std::array<unsigned int, dim>
272std::array<unsigned int, 1>
275std::array<unsigned int, 2>
278std::array<unsigned int, 3>
289 , polynomials(pols.begin(), pols.end())
290 , index_map(n_polynomials(pols.size()))
291 , index_map_inverse(n_polynomials(pols.size()))
297 for (
unsigned int i = 0; i < this->
n(); ++i)
310 return "PolynomialSpace";
315template <
typename StreamType>
319 for (
unsigned int i = 0; i < this->n(); ++i)
321 const std::array<unsigned int, dim> ix = compute_index(i);
323 for (
unsigned int d = 0; d < dim; ++d)
335 const std::array<unsigned int, dim> indices = compute_index(i);
339 std::vector<double> tmp(order + 1);
340 for (
unsigned int d = 0; d < dim; ++d)
342 polynomials[indices[d]].value(p[d], tmp);
343 for (
unsigned int j = 0; j < order + 1; ++j)
355 for (
unsigned int d = 0; d < dim; ++d)
357 derivative_1[d] = 1.;
358 for (
unsigned int x = 0; x < dim; ++x)
360 unsigned int x_order = 0;
364 derivative_1[d] *= v[x][x_order];
374 for (
unsigned int d1 = 0; d1 < dim; ++d1)
375 for (
unsigned int d2 = 0; d2 < dim; ++d2)
377 derivative_2[d1][d2] = 1.;
378 for (
unsigned int x = 0; x < dim; ++x)
380 unsigned int x_order = 0;
386 derivative_2[d1][d2] *= v[x][x_order];
396 for (
unsigned int d1 = 0; d1 < dim; ++d1)
397 for (
unsigned int d2 = 0; d2 < dim; ++d2)
398 for (
unsigned int d3 = 0; d3 < dim; ++d3)
400 derivative_3[d1][d2][d3] = 1.;
401 for (
unsigned int x = 0; x < dim; ++x)
403 unsigned int x_order = 0;
411 derivative_3[d1][d2][d3] *= v[x][x_order];
421 for (
unsigned int d1 = 0; d1 < dim; ++d1)
422 for (
unsigned int d2 = 0; d2 < dim; ++d2)
423 for (
unsigned int d3 = 0; d3 < dim; ++d3)
424 for (
unsigned int d4 = 0; d4 < dim; ++d4)
426 derivative_4[d1][d2][d3][d4] = 1.;
427 for (
unsigned int x = 0; x < dim; ++x)
429 unsigned int x_order = 0;
439 derivative_4[d1][d2][d3][d4] *= v[x][x_order];
460 return compute_derivative<1>(i, p);
470 return compute_derivative<2>(i, p);
480 return compute_derivative<3>(i, p);
490 return compute_derivative<4>(i, p);
const std::vector< Polynomials::Polynomial< double > > polynomials
void output_indices(StreamType &out) const
Tensor< order, dim > compute_derivative(const unsigned int i, const Point< dim > &p) const
PolynomialSpace(const std::vector< Pol > &pols)
double compute_value(const unsigned int i, const Point< dim > &p) const override
static constexpr unsigned int dimension
Tensor< 1, dim > compute_grad(const unsigned int i, const Point< dim > &p) const override
void set_numbering(const std::vector< unsigned int > &renumber)
static unsigned int n_polynomials(const unsigned int n)
std::array< unsigned int, dim > compute_index(const unsigned int n) const
std::string name() const override
virtual Tensor< 2, dim > compute_2nd_derivative(const unsigned int i, const Point< dim > &p) const override
virtual Tensor< 1, dim > compute_1st_derivative(const unsigned int i, const Point< dim > &p) const override
Tensor< 2, dim > compute_grad_grad(const unsigned int i, const Point< dim > &p) const override
virtual Tensor< 3, dim > compute_3rd_derivative(const unsigned int i, const Point< dim > &p) const override
std::vector< unsigned int > index_map
virtual std::unique_ptr< ScalarPolynomialsBase< dim > > clone() const override
void evaluate(const Point< dim > &unit_point, std::vector< double > &values, std::vector< Tensor< 1, dim > > &grads, std::vector< Tensor< 2, dim > > &grad_grads, std::vector< Tensor< 3, dim > > &third_derivatives, std::vector< Tensor< 4, dim > > &fourth_derivatives) const override
std::vector< unsigned int > index_map_inverse
virtual Tensor< 4, dim > compute_4th_derivative(const unsigned int i, const Point< dim > &p) const override
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NOT_IMPLEMENTED()
typename internal::ndarray::HelperArray< T, Ns... >::type ndarray