141 Assert(values.size() == this->n() || values.empty(),
143 Assert(grads.size() == this->n() || grads.empty(),
145 Assert(grad_grads.size() == this->n() || grad_grads.empty(),
147 Assert(third_derivatives.size() == this->n() || third_derivatives.empty(),
149 Assert(fourth_derivatives.size() == this->n() || fourth_derivatives.empty(),
152 std::vector<double> p_values;
153 std::vector<Tensor<1, dim>> p_grads;
154 std::vector<Tensor<2, dim>> p_grad_grads;
155 std::vector<Tensor<3, dim>> p_third_derivatives;
156 std::vector<Tensor<4, dim>> p_fourth_derivatives;
158 const unsigned int n_sub = polynomial_space.n();
159 p_values.resize((values.empty()) ? 0 : n_sub);
160 p_grads.resize((grads.empty()) ? 0 : n_sub);
161 p_grad_grads.resize((grad_grads.empty()) ? 0 : n_sub);
162 p_third_derivatives.resize((third_derivatives.empty()) ? 0 : n_sub);
163 p_fourth_derivatives.resize((fourth_derivatives.empty()) ? 0 : n_sub);
165 for (
unsigned int d = 0; d < dim; ++d)
173 for (
unsigned int c = 0; c < dim; ++c)
174 p[c] = unit_point[(c + d) % dim];
176 polynomial_space.evaluate(p,
181 p_fourth_derivatives);
183 for (
unsigned int i = 0; i < p_values.size(); ++i)
184 values[lexicographic_to_hierarchic[i + d * n_sub]][d] =
185 p_values[renumber_aniso[d][i]];
187 for (
unsigned int i = 0; i < p_grads.size(); ++i)
188 for (
unsigned int d1 = 0; d1 < dim; ++d1)
189 grads[lexicographic_to_hierarchic[i + d * n_sub]][d][(d1 + d) % dim] =
190 p_grads[renumber_aniso[d][i]][d1];
192 for (
unsigned int i = 0; i < p_grad_grads.size(); ++i)
193 for (
unsigned int d1 = 0; d1 < dim; ++d1)
194 for (
unsigned int d2 = 0; d2 < dim; ++d2)
195 grad_grads[lexicographic_to_hierarchic[i + d * n_sub]][d]
196 [(d1 + d) % dim][(d2 + d) % dim] =
197 p_grad_grads[renumber_aniso[d][i]][d1][d2];
199 for (
unsigned int i = 0; i < p_third_derivatives.size(); ++i)
200 for (
unsigned int d1 = 0; d1 < dim; ++d1)
201 for (
unsigned int d2 = 0; d2 < dim; ++d2)
202 for (
unsigned int d3 = 0; d3 < dim; ++d3)
203 third_derivatives[lexicographic_to_hierarchic[i + d * n_sub]][d]
204 [(d1 + d) % dim][(d2 + d) % dim]
206 p_third_derivatives[renumber_aniso[d][i]][d1]
209 for (
unsigned int i = 0; i < p_fourth_derivatives.size(); ++i)
210 for (
unsigned int d1 = 0; d1 < dim; ++d1)
211 for (
unsigned int d2 = 0; d2 < dim; ++d2)
212 for (
unsigned int d3 = 0; d3 < dim; ++d3)
213 for (
unsigned int d4 = 0; d4 < dim; ++d4)
214 fourth_derivatives[lexicographic_to_hierarchic[i + d * n_sub]]
215 [d][(d1 + d) % dim][(d2 + d) % dim]
216 [(d3 + d) % dim][(d4 + d) % dim] =
217 p_fourth_derivatives[renumber_aniso[d][i]]
257 const unsigned int normal_degree,
258 const unsigned int tangential_degree)
260 const unsigned int n_dofs_face =
262 std::vector<unsigned int> lexicographic_numbering;
264 for (
unsigned int j = 0; j < n_dofs_face; ++j)
266 lexicographic_numbering.push_back(j);
267 if (normal_degree > 1)
268 for (
unsigned int i = n_dofs_face * 2 * dim;
269 i < n_dofs_face * 2 * dim + normal_degree - 1;
271 lexicographic_numbering.push_back(i + j * (normal_degree - 1));
272 lexicographic_numbering.push_back(n_dofs_face + j);
276 unsigned int layers = (dim == 3) ? tangential_degree + 1 : 1;
277 for (
unsigned int k = 0; k < layers; ++k)
279 unsigned int k_add = k * (tangential_degree + 1);
280 for (
unsigned int j = n_dofs_face * 2;
281 j < n_dofs_face * 2 + tangential_degree + 1;
283 lexicographic_numbering.push_back(j + k_add);
285 if (normal_degree > 1)
286 for (
unsigned int i = n_dofs_face * (2 * dim + (normal_degree - 1));
287 i < n_dofs_face * (2 * dim + (normal_degree - 1)) +
288 (normal_degree - 1) * (tangential_degree + 1);
291 lexicographic_numbering.push_back(i + k_add * tangential_degree);
293 for (
unsigned int j = n_dofs_face * 3;
294 j < n_dofs_face * 3 + tangential_degree + 1;
296 lexicographic_numbering.push_back(j + k_add);
302 for (
unsigned int i = 4 * n_dofs_face; i < 5 * n_dofs_face; ++i)
303 lexicographic_numbering.push_back(i);
304 if (normal_degree > 1)
305 for (
unsigned int i =
306 6 * n_dofs_face + n_dofs_face * 2 * (normal_degree - 1);
307 i < 6 * n_dofs_face + n_dofs_face * 3 * (normal_degree - 1);
309 lexicographic_numbering.push_back(i);
310 for (
unsigned int i = 5 * n_dofs_face; i < 6 * n_dofs_face; ++i)
311 lexicographic_numbering.push_back(i);
314 return lexicographic_numbering;
void evaluate(const Point< dim > &unit_point, std::vector< Tensor< 1, dim > > &values, std::vector< Tensor< 2, dim > > &grads, std::vector< Tensor< 3, dim > > &grad_grads, std::vector< Tensor< 4, dim > > &third_derivatives, std::vector< Tensor< 5, dim > > &fourth_derivatives) const override