38#include <boost/container/small_vector.hpp>
51template <
int dim,
int spacedim>
53 const unsigned int polynomial_degree)
54 : polynomial_degree(polynomial_degree)
55 , n_shape_functions(
Utilities::fixed_power<dim>(polynomial_degree + 1))
56 , line_support_points(
QGaussLobatto<1>(polynomial_degree + 1))
57 , tensor_product_quadrature(false)
62template <
int dim,
int spacedim>
83template <
int dim,
int spacedim>
88 const unsigned int n_original_q_points)
92 this->update_each = update_flags;
94 const unsigned int n_q_points = q.
size();
96 const bool needs_higher_order_terms =
104 covariant.resize(n_original_q_points);
107 contravariant.resize(n_original_q_points);
110 volume_elements.resize(n_original_q_points);
117 tensor_product_quadrature =
false;
123 if (tensor_product_quadrature)
125 const std::array<Quadrature<1>, dim> quad_array =
127 for (
unsigned int i = 1; i < dim && tensor_product_quadrature; ++i)
129 if (quad_array[i - 1].size() != quad_array[i].size())
131 tensor_product_quadrature =
false;
136 const std::vector<Point<1>> &points_1 =
137 quad_array[i - 1].get_points();
138 const std::vector<Point<1>> &points_2 =
139 quad_array[i].get_points();
140 const std::vector<double> &weights_1 =
141 quad_array[i - 1].get_weights();
142 const std::vector<double> &weights_2 =
143 quad_array[i].get_weights();
144 for (
unsigned int j = 0; j < quad_array[i].size(); ++j)
146 if (
std::abs(points_1[j][0] - points_2[j][0]) > 1.e-10 ||
147 std::abs(weights_1[j] - weights_2[j]) > 1.e-10)
149 tensor_product_quadrature =
false;
156 if (tensor_product_quadrature)
163 shape_info.lexicographic_numbering =
164 FETools::lexicographic_to_hierarchic_numbering<dim>(
166 shape_info.n_q_points = q.
size();
167 shape_info.dofs_per_component_on_cell =
175 if (dim == 1 || !tensor_product_quadrature || needs_higher_order_terms)
180 shape_values.resize(n_shape_functions * n_q_points);
182 if (this->update_each &
192 shape_derivatives.resize(n_shape_functions * n_q_points);
194 if (this->update_each &
196 shape_second_derivatives.resize(n_shape_functions * n_q_points);
200 shape_third_derivatives.resize(n_shape_functions * n_q_points);
204 shape_fourth_derivatives.resize(n_shape_functions * n_q_points);
207 compute_shape_function_values(q.
get_points());
213template <
int dim,
int spacedim>
218 const unsigned int n_original_q_points)
220 initialize(update_flags, q, n_original_q_points);
222 if (dim > 1 && tensor_product_quadrature)
224 constexpr unsigned int facedim = dim - 1;
227 shape_info.lexicographic_numbering =
228 FETools::lexicographic_to_hierarchic_numbering<facedim>(
230 shape_info.n_q_points = n_original_q_points;
231 shape_info.dofs_per_component_on_cell =
237 if (this->update_each &
247 unit_tangentials[i].resize(n_original_q_points);
248 std::fill(unit_tangentials[i].begin(),
249 unit_tangentials[i].end(),
254 .resize(n_original_q_points);
269template <
int dim,
int spacedim>
274 const unsigned int n_points = unit_points.size();
285 const std::vector<unsigned int> renumber =
288 std::vector<double> values;
289 std::vector<Tensor<1, dim>> grads;
290 if (shape_values.size() != 0)
292 Assert(shape_values.size() == n_shape_functions * n_points,
294 values.resize(n_shape_functions);
296 if (shape_derivatives.size() != 0)
298 Assert(shape_derivatives.size() == n_shape_functions * n_points,
300 grads.resize(n_shape_functions);
303 std::vector<Tensor<2, dim>> grad2;
304 if (shape_second_derivatives.size() != 0)
306 Assert(shape_second_derivatives.size() == n_shape_functions * n_points,
308 grad2.resize(n_shape_functions);
311 std::vector<Tensor<3, dim>> grad3;
312 if (shape_third_derivatives.size() != 0)
314 Assert(shape_third_derivatives.size() == n_shape_functions * n_points,
316 grad3.resize(n_shape_functions);
319 std::vector<Tensor<4, dim>> grad4;
320 if (shape_fourth_derivatives.size() != 0)
322 Assert(shape_fourth_derivatives.size() == n_shape_functions * n_points,
324 grad4.resize(n_shape_functions);
328 if (shape_values.size() != 0 || shape_derivatives.size() != 0 ||
329 shape_second_derivatives.size() != 0 ||
330 shape_third_derivatives.size() != 0 ||
331 shape_fourth_derivatives.size() != 0)
332 for (
unsigned int point = 0; point < n_points; ++point)
334 tensor_pols.evaluate(
335 unit_points[point], values, grads, grad2, grad3, grad4);
337 if (shape_values.size() != 0)
338 for (
unsigned int i = 0; i < n_shape_functions; ++i)
339 shape(point, i) = values[renumber[i]];
341 if (shape_derivatives.size() != 0)
342 for (
unsigned int i = 0; i < n_shape_functions; ++i)
343 derivative(point, i) = grads[renumber[i]];
345 if (shape_second_derivatives.size() != 0)
346 for (
unsigned int i = 0; i < n_shape_functions; ++i)
347 second_derivative(point, i) = grad2[renumber[i]];
349 if (shape_third_derivatives.size() != 0)
350 for (
unsigned int i = 0; i < n_shape_functions; ++i)
351 third_derivative(point, i) = grad3[renumber[i]];
353 if (shape_fourth_derivatives.size() != 0)
354 for (
unsigned int i = 0; i < n_shape_functions; ++i)
355 fourth_derivative(point, i) = grad4[renumber[i]];
361template <
int dim,
int spacedim>
369 FETools::lexicographic_to_hierarchic_numbering<dim>(p))
371 internal::MappingQImplementation::unit_support_points<dim>(
376 compute_support_point_weights_perimeter_to_interior(
380 internal::MappingQImplementation::compute_support_point_weights_cell<dim>(
384 ExcMessage(
"It only makes sense to create polynomial mappings "
385 "with a polynomial degree greater or equal to one."));
390template <
int dim,
int spacedim>
392 : polynomial_degree(p)
393 , line_support_points(
396 Polynomials::generate_complete_Lagrange_basis(line_support_points))
397 , renumber_lexicographic_to_hierarchic(
398 FETools::lexicographic_to_hierarchic_numbering<dim>(p))
399 , unit_cell_support_points(
400 internal::MappingQImplementation::unit_support_points<dim>(
402 renumber_lexicographic_to_hierarchic))
403 , support_point_weights_perimeter_to_interior(
405 compute_support_point_weights_perimeter_to_interior(
406 this->polynomial_degree,
408 , support_point_weights_cell(
409 internal::MappingQImplementation::compute_support_point_weights_cell<dim>(
410 this->polynomial_degree))
413 ExcMessage(
"It only makes sense to create polynomial mappings "
414 "with a polynomial degree greater or equal to one."));
419template <
int dim,
int spacedim>
421 : polynomial_degree(mapping.polynomial_degree)
422 , line_support_points(mapping.line_support_points)
423 , polynomials_1d(mapping.polynomials_1d)
424 , renumber_lexicographic_to_hierarchic(
425 mapping.renumber_lexicographic_to_hierarchic)
426 , support_point_weights_perimeter_to_interior(
427 mapping.support_point_weights_perimeter_to_interior)
428 , support_point_weights_cell(mapping.support_point_weights_cell)
433template <
int dim,
int spacedim>
434std::unique_ptr<Mapping<dim, spacedim>>
437 return std::make_unique<MappingQ<dim, spacedim>>(*this);
442template <
int dim,
int spacedim>
446 return polynomial_degree;
451template <
int dim,
int spacedim>
459 this->compute_mapping_support_points(cell),
461 polynomials_1d.size() == 2,
462 renumber_lexicographic_to_hierarchic)
486template <
int dim,
int spacedim>
505 const Point<1> & initial_p_unit)
const
509 return internal::MappingQImplementation::
510 do_transform_real_to_unit_cell_internal<1>(
513 this->compute_mapping_support_points(cell),
515 renumber_lexicographic_to_hierarchic);
525 const Point<2> & initial_p_unit)
const
527 return internal::MappingQImplementation::
528 do_transform_real_to_unit_cell_internal<2>(
531 this->compute_mapping_support_points(cell),
533 renumber_lexicographic_to_hierarchic);
543 const Point<3> & initial_p_unit)
const
545 return internal::MappingQImplementation::
546 do_transform_real_to_unit_cell_internal<3>(
549 this->compute_mapping_support_points(cell),
551 renumber_lexicographic_to_hierarchic);
561 const Point<1> & initial_p_unit)
const
564 const int spacedim = 2;
571 auto mdata = Utilities::dynamic_unique_cast<InternalData>(
572 get_data(update_flags, point_quadrature));
574 mdata->mapping_support_points = this->compute_mapping_support_points(cell);
578 return internal::MappingQImplementation::
579 do_transform_real_to_unit_cell_internal_codim1<1>(cell,
592 const Point<2> & initial_p_unit)
const
595 const int spacedim = 3;
602 auto mdata = Utilities::dynamic_unique_cast<InternalData>(
603 get_data(update_flags, point_quadrature));
605 mdata->mapping_support_points = this->compute_mapping_support_points(cell);
609 return internal::MappingQImplementation::
610 do_transform_real_to_unit_cell_internal_codim1<2>(cell,
629template <
int dim,
int spacedim>
637 if (this->preserves_vertex_locations() && (polynomial_degree == 1) &&
638 ((dim == 1) || ((dim == 2) && (dim == spacedim))))
661 const auto vertices_ = this->get_vertices(cell);
665 for (
unsigned int i = 0; i <
vertices.size(); ++i)
691 const double eps = 1e-15;
692 if (-eps <= point(1) && point(1) <= 1 + eps &&
693 -eps <= point(0) && point(0) <= 1 + eps)
724 if (this->preserves_vertex_locations())
726 initial_p_unit = cell->real_to_unit_cell_affine_approximation(p);
728 if (dim == 1 && polynomial_degree == 1)
729 return initial_p_unit;
734 for (
unsigned int d = 0; d < dim; ++d)
735 initial_p_unit[d] = 0.5;
741 this->transform_real_to_unit_cell_internal(cell, p, initial_p_unit);
742 if (p_unit[0] == std::numeric_limits<double>::infinity())
750template <
int dim,
int spacedim>
768 const std::vector<Point<spacedim>> support_points =
769 this->compute_mapping_support_points(cell);
774 inverse_approximation(support_points, unit_cell_support_points);
776 const unsigned int n_points = real_points.size();
781 for (
unsigned int i = 0; i < n_points; i += n_lanes)
782 if (n_points - i > 1)
785 for (
unsigned int j = 0; j < n_lanes; ++j)
786 if (i + j < n_points)
787 for (
unsigned int d = 0; d < spacedim; ++d)
788 p_vec[d][j] = real_points[i + j][d];
790 for (
unsigned int d = 0; d < spacedim; ++d)
791 p_vec[d][j] = real_points[i][d];
794 internal::MappingQImplementation::
795 do_transform_real_to_unit_cell_internal<dim, spacedim>(
797 inverse_approximation.compute(p_vec),
800 renumber_lexicographic_to_hierarchic);
807 for (
unsigned int j = 0; j < n_lanes && i + j < n_points; ++j)
808 if (unit_point[0][j] == std::numeric_limits<double>::infinity())
809 unit_points[i + j] = internal::MappingQImplementation::
810 do_transform_real_to_unit_cell_internal<dim, spacedim>(
812 inverse_approximation.compute(real_points[i + j]),
815 renumber_lexicographic_to_hierarchic);
817 for (
unsigned int d = 0; d < dim; ++d)
818 unit_points[i + j][d] = unit_point[d][j];
821 unit_points[i] = internal::MappingQImplementation::
822 do_transform_real_to_unit_cell_internal<dim, spacedim>(
824 inverse_approximation.compute(real_points[i]),
827 renumber_lexicographic_to_hierarchic);
832template <
int dim,
int spacedim>
843 for (
unsigned int i = 0; i < 5; ++i)
888template <
int dim,
int spacedim>
889std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
893 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
894 std::make_unique<InternalData>(polynomial_degree);
896 data.
initialize(this->requires_update_flags(update_flags), q, q.
size());
903template <
int dim,
int spacedim>
904std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
911 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
912 std::make_unique<InternalData>(polynomial_degree);
916 ReferenceCells::get_hypercube<dim>(), quadrature[0]),
917 quadrature[0].size());
924template <
int dim,
int spacedim>
925std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
930 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
931 std::make_unique<InternalData>(polynomial_degree);
935 ReferenceCells::get_hypercube<dim>(), quadrature),
943template <
int dim,
int spacedim>
958 const unsigned int n_q_points = quadrature.
size();
982 internal::MappingQImplementation::
983 maybe_update_q_points_Jacobians_and_grads_tensor<dim, spacedim>(
984 computed_cell_similarity,
991 internal::MappingQImplementation::maybe_compute_q_points<dim, spacedim>(
996 internal::MappingQImplementation::maybe_update_Jacobians<dim, spacedim>(
997 computed_cell_similarity,
1003 computed_cell_similarity,
1011 spacedim>(computed_cell_similarity,
1018 spacedim>(computed_cell_similarity,
1023 internal::MappingQImplementation::
1024 maybe_update_jacobian_pushed_forward_2nd_derivatives<dim, spacedim>(
1025 computed_cell_similarity,
1032 spacedim>(computed_cell_similarity,
1037 internal::MappingQImplementation::
1038 maybe_update_jacobian_pushed_forward_3rd_derivatives<dim, spacedim>(
1039 computed_cell_similarity,
1044 const UpdateFlags update_flags = data.update_each;
1045 const std::vector<double> &weights = quadrature.
get_weights();
1061 for (
unsigned int point = 0; point < n_q_points; ++point)
1063 if (dim == spacedim)
1073 1e-12 * Utilities::fixed_power<dim>(
1074 cell->diameter() /
std::sqrt(
double(dim))),
1076 cell->center(), det, point)));
1078 output_data.
JxW_values[point] = weights[point] * det;
1086 for (
unsigned int i = 0; i < spacedim; ++i)
1087 for (
unsigned int j = 0; j < dim; ++j)
1091 for (
unsigned int i = 0; i < dim; ++i)
1092 for (
unsigned int j = 0; j < dim; ++j)
1093 G[i][j] = DX_t[i] * DX_t[j];
1098 if (computed_cell_similarity ==
1109 Assert(spacedim == dim + 1,
1111 "There is no (unique) cell normal for " +
1113 "-dimensional cells in " +
1115 "-dimensional space. This only works if the "
1116 "space dimension is one greater than the "
1117 "dimensionality of the mesh cells."));
1129 if (cell->direction_flag() ==
false)
1144 for (
unsigned int point = 0; point < n_q_points; ++point)
1153 for (
unsigned int point = 0; point < n_q_points; ++point)
1158 return computed_cell_similarity;
1163template <
int dim,
int spacedim>
1167 const unsigned int face_no,
1185 (&cell->get_triangulation() !=
1199 ReferenceCells::get_hypercube<dim>(),
1201 cell->face_orientation(face_no),
1202 cell->face_flip(face_no),
1203 cell->face_rotation(face_no),
1204 quadrature[0].
size()),
1212template <
int dim,
int spacedim>
1216 const unsigned int face_no,
1217 const unsigned int subface_no,
1233 (&cell->get_triangulation() !=
1247 ReferenceCells::get_hypercube<dim>(),
1250 cell->face_orientation(face_no),
1251 cell->face_flip(face_no),
1252 cell->face_rotation(face_no),
1254 cell->subface_case(face_no)),
1262template <
int dim,
int spacedim>
1278 const unsigned int n_q_points = quadrature.
size();
1283 internal::MappingQImplementation::maybe_compute_q_points<dim, spacedim>(
1288 internal::MappingQImplementation::maybe_update_Jacobians<dim, spacedim>(
1291 internal::MappingQImplementation::maybe_update_jacobian_grads<dim, spacedim>(
1311 internal::MappingQImplementation::
1312 maybe_update_jacobian_pushed_forward_2nd_derivatives<dim, spacedim>(
1325 internal::MappingQImplementation::
1326 maybe_update_jacobian_pushed_forward_3rd_derivatives<dim, spacedim>(
1332 const UpdateFlags update_flags = data.update_each;
1333 const std::vector<double> &weights = quadrature.
get_weights();
1345 for (
unsigned int point = 0; point < n_q_points; ++point)
1354 Assert(det > 1e-12 * Utilities::fixed_power<dim>(
1355 cell->diameter() /
std::sqrt(
double(dim))),
1357 cell->center(), det, point)));
1361 for (
unsigned int d = 0; d < spacedim; d++)
1365 output_data.
JxW_values[point] = weights[point] * det * normal.
norm();
1369 normal /= normal.
norm();
1379 for (
unsigned int point = 0; point < n_q_points; ++point)
1387 for (
unsigned int point = 0; point < n_q_points; ++point)
1395template <
int dim,
int spacedim>
1412 output_data.
initialize(unit_points.size(), update_flags);
1413 const std::vector<Point<spacedim>> support_points =
1414 this->compute_mapping_support_points(cell);
1416 const unsigned int n_points = unit_points.size();
1421 for (
unsigned int i = 0; i < n_points; i += n_lanes)
1422 if (n_points - i > 1)
1425 for (
unsigned int j = 0; j < n_lanes; ++j)
1426 if (i + j < n_points)
1427 for (
unsigned int d = 0; d < dim; ++d)
1428 p_vec[d][j] = unit_points[i + j][d];
1430 for (
unsigned int d = 0; d < dim; ++d)
1431 p_vec[d][j] = unit_points[i][d];
1438 polynomial_degree == 1,
1439 renumber_lexicographic_to_hierarchic);
1442 for (
unsigned int j = 0; j < n_lanes && i + j < n_points; ++j)
1443 for (
unsigned int d = 0; d < spacedim; ++d)
1447 for (
unsigned int j = 0; j < n_lanes && i + j < n_points; ++j)
1448 for (
unsigned int d = 0; d < spacedim; ++d)
1449 for (
unsigned int e = 0; e < dim; ++e)
1450 output_data.
jacobians[i + j][d][e] = result.second[e][d][j];
1458 for (
unsigned int j = 0; j < n_lanes && i + j < n_points; ++j)
1459 for (
unsigned int d = 0; d < dim; ++d)
1460 for (
unsigned int e = 0; e < spacedim; ++e)
1471 polynomial_degree == 1,
1472 renumber_lexicographic_to_hierarchic);
1487 for (
unsigned int d = 0; d < dim; ++d)
1488 for (
unsigned int e = 0; e < spacedim; ++e)
1496template <
int dim,
int spacedim>
1512template <
int dim,
int spacedim>
1528template <
int dim,
int spacedim>
1536 switch (mapping_kind)
1560template <
int dim,
int spacedim>
1573 switch (mapping_kind)
1579 "update_covariant_transformation"));
1581 for (
unsigned int q = 0; q < output.
size(); ++q)
1582 for (
unsigned int i = 0; i < spacedim; ++i)
1583 for (
unsigned int j = 0; j < spacedim; ++j)
1586 for (
unsigned int K = 0; K < dim; ++K)
1588 tmp[K] = data.
covariant[q][j][0] * input[q][i][0][K];
1589 for (
unsigned int J = 1; J < dim; ++J)
1590 tmp[K] += data.
covariant[q][j][J] * input[q][i][J][K];
1592 for (
unsigned int k = 0; k < spacedim; ++k)
1594 output[q][i][j][k] = data.
covariant[q][k][0] * tmp[0];
1595 for (
unsigned int K = 1; K < dim; ++K)
1596 output[q][i][j][k] += data.
covariant[q][k][K] * tmp[K];
1609template <
int dim,
int spacedim>
1617 switch (mapping_kind)
1634template <
int dim,
int spacedim>
1641 if (this->polynomial_degree == 2)
1643 for (
unsigned int line_no = 0;
1644 line_no < GeometryInfo<dim>::lines_per_cell;
1651 cell->line(line_no));
1656 cell->get_manifold() :
1665 std::vector<Point<spacedim>> tmp_points;
1666 for (
unsigned int line_no = 0;
1667 line_no < GeometryInfo<dim>::lines_per_cell;
1674 cell->line(line_no));
1679 cell->get_manifold() :
1682 const std::array<Point<spacedim>, 2>
vertices{
1687 const std::size_t n_rows =
1688 support_point_weights_perimeter_to_interior[0].size(0);
1689 a.resize(a.size() + n_rows);
1693 support_point_weights_perimeter_to_interior[0],
1710 std::vector<Point<3>> tmp_points;
1713 for (
unsigned int face_no = 0; face_no < faces_per_cell; ++face_no)
1718 const bool face_orientation = cell->face_orientation(face_no),
1719 face_flip = cell->face_flip(face_no),
1720 face_rotation = cell->face_rotation(face_no);
1725 for (
unsigned int i = 0; i < vertices_per_face; ++i)
1726 Assert(face->vertex_index(i) ==
1728 face_no, i, face_orientation, face_flip, face_rotation)),
1733 for (
unsigned int i = 0; i < lines_per_face; ++i)
1736 face_no, i, face_orientation, face_flip, face_rotation)),
1742 boost::container::small_vector<Point<3>, 200> tmp_points(
1747 if (polynomial_degree > 1)
1748 for (
unsigned int line = 0; line < GeometryInfo<2>::lines_per_cell;
1750 for (
unsigned int i = 0; i < polynomial_degree - 1; ++i)
1751 tmp_points[4 + line * (polynomial_degree - 1) + i] =
1753 (polynomial_degree - 1) *
1757 const std::size_t n_rows =
1758 support_point_weights_perimeter_to_interior[1].size(0);
1759 a.resize(a.size() + n_rows);
1761 face->get_manifold().get_new_points(
1763 support_point_weights_perimeter_to_interior[1],
1782 for (
unsigned int q = 0, q2 = 0; q2 < polynomial_degree - 1; ++q2)
1783 for (
unsigned int q1 = 0; q1 < polynomial_degree - 1; ++q1, ++q)
1785 Point<2> point(line_support_points[q1 + 1][0],
1786 line_support_points[q2 + 1][0]);
1791 const std::size_t n_rows = weights.size(0);
1792 a.resize(a.size() + n_rows);
1794 cell->get_manifold().get_new_points(
1800template <
int dim,
int spacedim>
1811template <
int dim,
int spacedim>
1812std::vector<Point<spacedim>>
1817 std::vector<Point<spacedim>> a;
1818 a.reserve(Utilities::fixed_power<dim>(polynomial_degree + 1));
1820 a.push_back(cell->vertex(i));
1822 if (this->polynomial_degree > 1)
1829 bool all_manifold_ids_are_equal = (dim == spacedim);
1830 if (all_manifold_ids_are_equal &&
1832 &cell->get_manifold()) ==
nullptr)
1835 if (&cell->face(f)->get_manifold() != &cell->get_manifold())
1836 all_manifold_ids_are_equal =
false;
1839 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
1840 if (&cell->line(l)->get_manifold() != &cell->get_manifold())
1841 all_manifold_ids_are_equal =
false;
1844 if (all_manifold_ids_are_equal)
1846 const std::size_t n_rows = support_point_weights_cell.size(0);
1847 a.resize(a.size() + n_rows);
1851 support_point_weights_cell,
1858 add_line_support_points(cell, a);
1863 add_line_support_points(cell, a);
1866 if (dim != spacedim)
1867 add_quad_support_points(cell, a);
1870 const std::size_t n_rows =
1871 support_point_weights_perimeter_to_interior[1].size(0);
1872 a.resize(a.size() + n_rows);
1874 cell->get_manifold().get_new_points(
1876 support_point_weights_perimeter_to_interior[1],
1883 add_line_support_points(cell, a);
1884 add_quad_support_points(cell, a);
1888 const std::size_t n_rows =
1889 support_point_weights_perimeter_to_interior[2].size(0);
1890 a.resize(a.size() + n_rows);
1892 cell->get_manifold().get_new_points(
1894 support_point_weights_perimeter_to_interior[2],
1910template <
int dim,
int spacedim>
1920template <
int dim,
int spacedim>
1925 Assert(dim == reference_cell.get_dimension(),
1926 ExcMessage(
"The dimension of your mapping (" +
1928 ") and the reference cell cell_type (" +
1930 " ) do not agree."));
1932 return reference_cell.is_hyper_cube();
1938#include "mapping_q.inst"
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
virtual Point< spacedim > get_new_point_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line) const
virtual void get_new_points(const ArrayView< const Point< spacedim > > &surrounding_points, const Table< 2, double > &weights, ArrayView< Point< spacedim > > new_points) const
AlignedVector< DerivativeForm< 1, dim, spacedim > > covariant
Triangulation< dim, spacedim >::cell_iterator cell_of_current_support_points
virtual std::size_t memory_consumption() const override
std::vector< Point< spacedim > > mapping_support_points
AlignedVector< DerivativeForm< 1, dim, spacedim > > contravariant
bool tensor_product_quadrature
void initialize_face(const UpdateFlags update_flags, const Quadrature< dim > &quadrature, const unsigned int n_original_q_points)
InternalData(const unsigned int polynomial_degree)
void initialize(const UpdateFlags update_flags, const Quadrature< dim > &quadrature, const unsigned int n_original_q_points)
void compute_shape_function_values(const std::vector< Point< dim > > &unit_points)
const std::vector< unsigned int > renumber_lexicographic_to_hierarchic
virtual CellSimilarity::Similarity fill_fe_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const Quadrature< dim > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
const Table< 2, double > support_point_weights_cell
virtual std::vector< Point< spacedim > > compute_mapping_support_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_data(const UpdateFlags, const Quadrature< dim > &quadrature) const override
virtual void fill_fe_subface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, const Quadrature< dim - 1 > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
virtual BoundingBox< spacedim > get_bounding_box(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const override
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_subface_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
virtual void transform(const ArrayView< const Tensor< 1, dim > > &input, const MappingKind kind, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 1, spacedim > > &output) const override
virtual void fill_fe_face_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const hp::QCollection< dim - 1 > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
const unsigned int polynomial_degree
virtual void transform_points_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const ArrayView< const Point< spacedim > > &real_points, const ArrayView< Point< dim > > &unit_points) const override
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_face_data(const UpdateFlags flags, const hp::QCollection< dim - 1 > &quadrature) const override
Point< dim > transform_real_to_unit_cell_internal(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p, const Point< dim > &initial_p_unit) const
void fill_mapping_data_for_generic_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const ArrayView< const Point< dim > > &unit_points, const UpdateFlags update_flags, ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
const std::vector< Table< 2, double > > support_point_weights_perimeter_to_interior
const std::vector< Point< 1 > > line_support_points
virtual Point< spacedim > transform_unit_to_real_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const override
const std::vector< Polynomials::Polynomial< double > > polynomials_1d
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const override
const std::vector< Point< dim > > unit_cell_support_points
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const override
MappingQ(const unsigned int polynomial_degree)
virtual void add_line_support_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, std::vector< Point< spacedim > > &a) const
virtual void add_quad_support_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, std::vector< Point< spacedim > > &a) const
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override
virtual void fill_fe_immersed_surface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const NonMatching::ImmersedSurfaceQuadrature< dim > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
virtual bool is_compatible_with(const ReferenceCell &reference_cell) const override
unsigned int get_degree() const
Abstract base class for mapping classes.
virtual void transform_points_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const ArrayView< const Point< spacedim > > &real_points, const ArrayView< Point< dim > > &unit_points) const
const Tensor< 1, spacedim > & normal_vector(const unsigned int i) const
static DataSetDescriptor cell()
bool is_tensor_product() const
const std::array< Quadrature< 1 >, dim > & get_tensor_basis() const
const std::vector< double > & get_weights() const
const std::vector< Point< dim > > & get_points() const
unsigned int size() const
numbers::NumberTraits< Number >::real_type norm() const
Triangulation< dim, spacedim > & get_triangulation()
static constexpr std::size_t size()
unsigned int size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
@ update_jacobian_pushed_forward_2nd_derivatives
@ update_volume_elements
Determinant of the Jacobian.
@ update_contravariant_transformation
Contravariant transformation.
@ update_jacobian_pushed_forward_grads
@ update_jacobian_3rd_derivatives
@ update_jacobian_grads
Gradient of volume element.
@ update_normal_vectors
Normal vectors.
@ update_JxW_values
Transformed quadrature weights.
@ update_covariant_transformation
Covariant transformation.
@ update_jacobians
Volume element.
@ update_inverse_jacobians
Volume element.
@ update_quadrature_points
Transformed quadrature points.
@ update_default
No update.
@ update_jacobian_pushed_forward_3rd_derivatives
@ update_boundary_forms
Outer normal vector, not normalized.
@ update_jacobian_2nd_derivatives
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
typename IteratorSelector::line_iterator line_iterator
const Manifold< dim, spacedim > & get_manifold(const types::manifold_id number) const
@ mapping_covariant_gradient
@ mapping_contravariant_hessian
@ mapping_covariant_hessian
@ mapping_contravariant_gradient
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
std::vector< Polynomial< double > > generate_complete_Lagrange_basis(const std::vector< Point< 1 > > &points)
constexpr T pow(const T base, const int iexp)
std::string to_string(const number value, const unsigned int digits=numbers::invalid_unsigned_int)
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
Point< 1 > transform_real_to_unit_cell(const std::array< Point< spacedim >, GeometryInfo< 1 >::vertices_per_cell > &vertices, const Point< spacedim > &p)
void transform_differential_forms(const ArrayView< const DerivativeForm< rank, dim, spacedim > > &input, const MappingKind mapping_kind, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_data, const ArrayView< Tensor< rank+1, spacedim > > &output)
void maybe_update_jacobian_3rd_derivatives(const CellSimilarity::Similarity cell_similarity, const typename QProjector< dim >::DataSetDescriptor data_set, const typename ::MappingQ< dim, spacedim >::InternalData &data, std::vector< DerivativeForm< 4, dim, spacedim > > &jacobian_3rd_derivatives)
void maybe_update_jacobian_pushed_forward_grads(const CellSimilarity::Similarity cell_similarity, const typename QProjector< dim >::DataSetDescriptor data_set, const typename ::MappingQ< dim, spacedim >::InternalData &data, std::vector< Tensor< 3, spacedim > > &jacobian_pushed_forward_grads)
void transform_fields(const ArrayView< const Tensor< rank, dim > > &input, const MappingKind mapping_kind, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_data, const ArrayView< Tensor< rank, spacedim > > &output)
void transform_gradients(const ArrayView< const Tensor< rank, dim > > &input, const MappingKind mapping_kind, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_data, const ArrayView< Tensor< rank, spacedim > > &output)
void transform_hessians(const ArrayView< const Tensor< 3, dim > > &input, const MappingKind mapping_kind, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_data, const ArrayView< Tensor< 3, spacedim > > &output)
void do_fill_fe_face_values(const ::MappingQ< dim, spacedim > &mapping, const typename ::Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, const typename QProjector< dim >::DataSetDescriptor data_set, const Quadrature< dim - 1 > &quadrature, const typename ::MappingQ< dim, spacedim >::InternalData &data, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data)
void maybe_update_jacobian_2nd_derivatives(const CellSimilarity::Similarity cell_similarity, const typename QProjector< dim >::DataSetDescriptor data_set, const typename ::MappingQ< dim, spacedim >::InternalData &data, std::vector< DerivativeForm< 3, dim, spacedim > > &jacobian_2nd_derivatives)
void maybe_update_jacobian_grads(const CellSimilarity::Similarity cell_similarity, const typename QProjector< dim >::DataSetDescriptor data_set, const typename ::MappingQ< dim, spacedim >::InternalData &data, std::vector< DerivativeForm< 2, dim, spacedim > > &jacobian_grads)
std::pair< typename ProductTypeNoPoint< Number, Number2 >::type, Tensor< 1, dim, typename ProductTypeNoPoint< Number, Number2 >::type > > evaluate_tensor_product_value_and_gradient(const std::vector< Polynomials::Polynomial< double > > &poly, const std::vector< Number > &values, const Point< dim, Number2 > &p, const bool d_linear=false, const std::vector< unsigned int > &renumber={})
static const unsigned int invalid_unsigned_int
const types::manifold_id flat_manifold_id
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)
static unsigned int face_to_cell_vertices(const unsigned int face, const unsigned int vertex, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false)
static double d_linear_shape_function(const Point< dim > &xi, const unsigned int i)
constexpr Number determinant(const SymmetricTensor< 2, dim, Number > &)
constexpr Tensor< 1, dim, Number > cross_product_2d(const Tensor< 1, dim, Number > &src)
constexpr Tensor< 1, dim, typename ProductType< Number1, Number2 >::type > cross_product_3d(const Tensor< 1, dim, Number1 > &src1, const Tensor< 1, dim, Number2 > &src2)