34 std::array<unsigned int, dim> ix;
35 for (
unsigned int i = 0; i < tensor_polys.n(); ++i)
37 tensor_polys.compute_index(i, ix);
39 for (
unsigned int d = 0; d < dim; ++d)
50 const std::vector<unsigned int> &renumber)
52 Assert(renumber.size() == index_map.size(),
56 for (
unsigned int i = 0; i < index_map.size(); ++i)
57 index_map_inverse[index_map[i]] = i;
59 std::vector<unsigned int> renumber_base;
60 for (
unsigned int i = 0; i < tensor_polys.n(); ++i)
61 renumber_base.push_back(renumber[i]);
63 tensor_polys.set_numbering(renumber_base);
72 const unsigned int max_indices = tensor_polys.n();
77 return tensor_polys.compute_value(i, p);
100 const unsigned int max_indices = tensor_polys.n();
105 return tensor_polys.compute_grad(i, p);
116 const unsigned int max_indices = tensor_polys.n();
121 return tensor_polys.compute_grad_grad(i, p);
131 std::vector<double> & values,
137 Assert(values.size() == tensor_polys.n() + 1 || values.size() == 0,
139 Assert(grads.size() == tensor_polys.n() + 1 || grads.size() == 0,
141 Assert(grad_grads.size() == tensor_polys.n() + 1 || grad_grads.size() == 0,
143 Assert(third_derivatives.size() == tensor_polys.n() + 1 ||
144 third_derivatives.size() == 0,
146 tensor_polys.n() + 1,
148 Assert(fourth_derivatives.size() == tensor_polys.n() + 1 ||
149 fourth_derivatives.size() == 0,
151 tensor_polys.n() + 1,
156 bool do_values =
false, do_grads =
false, do_grad_grads =
false;
157 bool do_3rd_derivatives =
false, do_4th_derivatives =
false;
158 if (values.empty() ==
false)
163 if (grads.empty() ==
false)
168 if (grad_grads.empty() ==
false)
170 grad_grads.pop_back();
171 do_grad_grads =
true;
173 if (third_derivatives.empty() ==
false)
175 third_derivatives.resize(tensor_polys.n());
176 do_3rd_derivatives =
true;
178 if (fourth_derivatives.empty() ==
false)
180 fourth_derivatives.resize(tensor_polys.n());
181 do_4th_derivatives =
true;
184 tensor_polys.evaluate(
185 p, values, grads, grad_grads, third_derivatives, fourth_derivatives);
190 values.push_back(1.);
192 grads.emplace_back();
194 grad_grads.emplace_back();
195 if (do_3rd_derivatives)
196 third_derivatives.emplace_back();
197 if (do_4th_derivatives)
198 fourth_derivatives.emplace_back();
204std::unique_ptr<ScalarPolynomialsBase<dim>>
207 return std::make_unique<TensorProductPolynomialsConst<dim>>(*this);
void output_indices(std::ostream &out) const
double compute_value(const unsigned int i, const Point< dim > &p) const override
Tensor< 1, dim > compute_grad(const unsigned int i, const Point< dim > &p) const override
virtual std::unique_ptr< ScalarPolynomialsBase< dim > > clone() const override
void set_numbering(const std::vector< unsigned int > &renumber)
Tensor< 2, dim > compute_grad_grad(const unsigned int i, const Point< dim > &p) 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
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch2(std::size_t arg1, std::size_t arg2, std::size_t arg3)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)