37 std::vector<Point<2>> q_points;
38 q_points.reserve(points.size());
40 q_points.emplace_back(p[1], p[0]);
49 std::vector<Point<2>> q_points;
50 q_points.reserve(points.size());
56 q_points.push_back(p);
61 q_points.emplace_back(1.0 - p[1], p[0]);
66 q_points.emplace_back(1.0 - p[0], 1.0 - p[1]);
71 q_points.emplace_back(p[1], 1.0 - p[0]);
147 std::vector<Point<2>>
149 const unsigned int offset)
158 return rotate(points, offset);
164 return rotate(
reflect(points), 8 - offset);
173 const bool face_orientation,
174 const bool face_flip,
175 const bool face_rotation)
177 static const unsigned int offset[2][2][2] = {
189 quadrature.get_points(),
190 offset[face_orientation][face_flip][face_rotation]),
191 quadrature.get_weights());
194 std::pair<unsigned int, RefinementCase<2>>
197 const bool face_orientation,
198 const bool face_flip,
199 const bool face_rotation,
202 constexpr int dim = 3;
272 static const unsigned int
317 (face_orientation == face_rotation ?
347 (void)reference_cell;
349 const unsigned int dim = 1;
365 const unsigned int dim = 2;
374 for (
unsigned int p = 0; p < quadrature.
size(); ++p)
378 q_points[p] =
Point<dim>(quadrature.point(p)(0), 0);
382 Point<dim>(1 - quadrature.point(p)(0), quadrature.point(p)(0));
385 q_points[p] =
Point<dim>(0, 1 - quadrature.point(p)(0));
393 for (
unsigned int p = 0; p < quadrature.
size(); ++p)
397 q_points[p] =
Point<dim>(0, quadrature.point(p)(0));
400 q_points[p] =
Point<dim>(1, quadrature.point(p)(0));
403 q_points[p] =
Point<dim>(quadrature.point(p)(0), 0);
406 q_points[p] =
Point<dim>(quadrature.point(p)(0), 1);
428 (void)reference_cell;
434 internal::QProjector::project_to_hex_face_and_append(quadrature.get_points(),
459 const bool face_orientation,
460 const bool face_flip,
461 const bool face_rotation)
466 quadrature, face_orientation, face_flip, face_rotation);
483 (void)reference_cell;
485 const unsigned int dim = 1;
503 const unsigned int dim = 2;
514 for (
unsigned int p = 0; p < quadrature.
size(); ++p)
521 q_points[p] =
Point<dim>(quadrature.point(p)(0) / 2, 0);
525 Point<dim>(0.5 + quadrature.point(p)(0) / 2, 0);
535 q_points[p] =
Point<dim>(1 - quadrature.point(p)(0) / 2,
536 quadrature.point(p)(0) / 2);
539 q_points[p] =
Point<dim>(0.5 - quadrature.point(p)(0) / 2,
540 0.5 + quadrature.point(p)(0) / 2);
550 q_points[p] =
Point<dim>(0, 1 - quadrature.point(p)(0) / 2);
554 Point<dim>(0, 0.5 - quadrature.point(p)(0) / 2);
566 for (
unsigned int p = 0; p < quadrature.
size(); ++p)
573 q_points[p] =
Point<dim>(0, quadrature.point(p)(0) / 2);
577 Point<dim>(0, quadrature.point(p)(0) / 2 + 0.5);
587 q_points[p] =
Point<dim>(1, quadrature.point(p)(0) / 2);
591 Point<dim>(1, quadrature.point(p)(0) / 2 + 0.5);
601 q_points[p] =
Point<dim>(quadrature.point(p)(0) / 2, 0);
605 Point<dim>(quadrature.point(p)(0) / 2 + 0.5, 0);
615 q_points[p] =
Point<dim>(quadrature.point(p)(0) / 2, 1);
619 Point<dim>(quadrature.point(p)(0) / 2 + 0.5, 1);
648 (void)reference_cell;
656 internal::QProjector::project_to_hex_face_and_append(
691 const bool face_orientation,
692 const bool face_flip,
693 const bool face_rotation,
699 quadrature, face_orientation, face_flip, face_rotation);
701 const std::pair<unsigned int, RefinementCase<2>>
703 internal::QProjector::select_subface_no_and_refinement_case(
723 (void)reference_cell;
725 const unsigned int dim = 1;
730 std::vector<Point<dim>> q_points;
731 q_points.reserve(n_points * n_faces);
732 std::vector<Point<dim>>
help(n_points);
737 for (
unsigned int face = 0; face < n_faces; ++face)
739 project_to_face(reference_cell,
740 quadrature[quadrature.
size() == 1 ? 0 : face],
747 std::vector<double> weights;
748 weights.reserve(n_points * n_faces);
749 for (
unsigned int face = 0; face < n_faces; ++face)
751 quadrature[quadrature.
size() == 1 ? 0 : face].get_weights().
begin(),
752 quadrature[quadrature.
size() == 1 ? 0 : face].get_weights().
end(),
753 std::back_inserter(weights));
771 [](
const auto &face,
const auto &orientation) -> std::vector<
Point<2>> {
778 return std::vector<Point<2>>(
temp.
begin(),
783 const std::array<std::pair<std::array<Point<2>, 2>,
double>, 3> faces = {
793 std::vector<Point<2>> points;
794 std::vector<double> weights;
799 for (
unsigned int orientation = 0; orientation < 2; ++orientation)
801 const auto &face = faces[
face_no];
810 quadrature[quadrature.
size() == 1 ? 0 :
face_no].get_points();
812 quadrature[quadrature.
size() == 1 ? 0 :
face_no].get_weights();
820 for (
unsigned int i = 0; i < 2; ++i)
838 const unsigned int dim = 2;
844 if (quadrature.
size() == 1)
849 for (
const auto &
q : quadrature)
854 std::vector<Point<dim>> q_points;
856 std::vector<Point<dim>>
help;
861 for (
unsigned int face = 0; face < n_faces; ++face)
863 help.resize(quadrature[quadrature.
size() == 1 ? 0 : face].
size());
864 project_to_face(reference_cell,
865 quadrature[quadrature.
size() == 1 ? 0 : face],
872 std::vector<double> weights;
874 for (
unsigned int face = 0; face < n_faces; ++face)
876 quadrature[quadrature.
size() == 1 ? 0 : face].get_weights().
begin(),
877 quadrature[quadrature.
size() == 1 ? 0 : face].get_weights().
end(),
878 std::back_inserter(weights));
893 const auto process = [&](
const std::vector<std::vector<Point<3>>> &faces) {
895 std::vector<Point<3>> points;
896 std::vector<double> weights;
910 std::vector<Tensor<1, 2>> shape_derivatives;
918 for (
unsigned char orientation = 0;
919 orientation < reference_cell.n_face_orientations(
face_no);
922 const auto &face = faces[
face_no];
924 const boost::container::small_vector<Point<3>, 8>
support_points =
925 reference_cell.face_reference_cell(
face_no)
926 .permute_by_combined_orientation<
Point<3>>(face, orientation);
930 quadrature[quadrature.
size() == 1 ? 0 :
face_no].get_points();
932 quadrature[quadrature.
size() == 1 ? 0 :
face_no].get_weights();
948 const double scaling = [&]() {
949 const unsigned int dim_ = 2;
950 const unsigned int spacedim = 3;
957 shape_derivatives[i] =
961 for (
unsigned int i = 0; i < spacedim; ++i)
962 for (
unsigned int j = 0;
j < dim_; ++
j)
967 for (
unsigned int i = 0; i < dim_; ++i)
968 for (
unsigned int j = 0;
j < dim_; ++
j)
988 reference_cell.n_faces());
989 for (
const unsigned int f : reference_cell.face_indices())
992 reference_cell.face_reference_cell(f).n_vertices());
993 for (
const unsigned int v :
994 reference_cell.face_reference_cell(f).vertex_indices())
996 reference_cell.face_vertex_location<3>(f, v);
1005 const unsigned int dim = 3;
1009 if (quadrature.
size() == 1)
1015 for (
const auto &
q : quadrature)
1022 std::vector<Point<dim>> q_points;
1025 std::vector<double> weights;
1028 for (
unsigned int offset = 0; offset < 8; ++offset)
1030 const auto mutation = internal::QProjector::mutate_points_with_offset(
1031 quadrature[0].get_points(), offset);
1036 const unsigned int q_index = quadrature.
size() == 1 ? 0 : face;
1038 internal::QProjector::project_to_hex_face_and_append(
1039 q_index > 0 ? internal::QProjector::mutate_points_with_offset(
1040 quadrature[face].get_points(), offset) :
1045 std::copy(quadrature[q_index].get_weights().
begin(),
1046 quadrature[q_index].get_weights().
end(),
1047 std::back_inserter(weights));
1066 (void)reference_cell;
1068 const unsigned int dim = 1;
1075 std::vector<Point<dim>> q_points;
1077 std::vector<Point<dim>>
help(n_points);
1081 for (
unsigned int face = 0; face < n_faces; ++face)
1084 project_to_subface(reference_cell, quadrature, face, subface,
help);
1089 std::vector<double> weights;
1091 for (
unsigned int face = 0; face < n_faces; ++face)
1093 std::copy(quadrature.get_weights().
begin(),
1094 quadrature.get_weights().
end(),
1095 std::back_inserter(weights));
1118 const unsigned int dim = 2;
1120 const unsigned int n_points = quadrature.
size(),
1126 std::vector<Point<dim>> q_points;
1128 std::vector<Point<dim>>
help(n_points);
1132 for (
unsigned int face = 0; face < n_faces; ++face)
1135 project_to_subface(reference_cell, quadrature, face, subface,
help);
1140 std::vector<double> weights;
1142 for (
unsigned int face = 0; face < n_faces; ++face)
1146 std::back_inserter(weights));
1169 const unsigned int dim = 3;
1171 const unsigned int n_points = quadrature.
size(),
1176 std::vector<Point<dim>> q_points;
1179 std::vector<double> weights;
1184 for (
unsigned int offset = 0; offset < 8; ++offset)
1187 internal::QProjector::mutate_points_with_offset(quadrature.
get_points(),
1191 for (
unsigned int face = 0; face < n_faces; ++face)
1195 for (
unsigned int subface = 0;
1200 internal::QProjector::project_to_hex_face_and_append(
1210 std::back_inserter(weights));
1230 Assert(reference_cell == ReferenceCells::get_hypercube<dim>(),
1232 (void)reference_cell;
1236 const unsigned int n_q_points = quadrature.
size();
1238 std::vector<Point<dim>> q_points(n_q_points);
1239 for (
unsigned int i = 0; i < n_q_points; ++i)
1247 std::vector<double> weights = quadrature.get_weights();
1248 for (
unsigned int i = 0; i < n_q_points; ++i)
1261 Assert(reference_cell == ReferenceCells::get_hypercube<dim>(),
1263 (void)reference_cell;
1265 const unsigned int n_points = quadrature.
size(),
1268 std::vector<Point<dim>> q_points(n_points * n_children);
1269 std::vector<double> weights(n_points * n_children);
1273 for (
unsigned int child = 0; child < n_children; ++child)
1276 project_to_child(reference_cell, quadrature, child);
1277 for (
unsigned int i = 0; i < n_points; ++i)
1279 q_points[child * n_points + i] =
help.point(i);
1280 weights[child * n_points + i] =
help.weight(i);
1295 Assert(reference_cell == ReferenceCells::get_hypercube<dim>(),
1297 (void)reference_cell;
1299 const unsigned int n = quadrature.
size();
1300 std::vector<Point<dim>> points(n);
1301 std::vector<double> weights(n);
1302 const double length =
p1.distance(
p2);
1304 for (
unsigned int k = 0;
k < n; ++
k)
1306 const double alpha = quadrature.point(
k)(0);
1309 weights[
k] = length * quadrature.weight(
k);
1320 const bool face_orientation,
1321 const bool face_flip,
1322 const bool face_rotation,
1323 const unsigned int n_quadrature_points)
1329 return {(2 *
face_no + (face_orientation ? 1 : 0)) *
1330 n_quadrature_points};
1333 const unsigned int orientation = (face_flip ? 4 : 0) +
1334 (face_rotation ? 2 : 0) +
1335 (face_orientation ? 1 : 0);
1336 return {(6 *
face_no + orientation) * n_quadrature_points};
1340 Assert(reference_cell == ReferenceCells::get_hypercube<dim>(),
1349 return face_no * n_quadrature_points;
1374 static const unsigned int offset[2][2][2] = {
1393 (
face_no + offset[face_orientation][face_flip][face_rotation]) *
1394 n_quadrature_points);
1410 const bool face_orientation,
1411 const bool face_flip,
1412 const bool face_rotation,
1420 unsigned int offset = 0;
1423 static const std::array<unsigned int, 5>
scale_tri = {{2, 2, 2, X, X}};
1424 static const std::array<unsigned int, 5>
scale_tet = {{6, 6, 6, 6, X}};
1425 static const std::array<unsigned int, 5>
scale_wedge = {{6, 6, 8, 8, 8}};
1437 if (quadrature.
size() == 1)
1438 offset = scale[0] * quadrature[0].size() *
face_no;
1440 for (
unsigned int i = 0; i <
face_no; ++i)
1441 offset += scale[i] * quadrature[i].size();
1449 const unsigned int orientation = (face_flip ? 4 : 0) +
1450 (face_rotation ? 2 : 0) +
1451 (face_orientation ? 1 : 0);
1459 Assert(reference_cell == ReferenceCells::get_hypercube<dim>(),
1469 if (quadrature.
size() == 1)
1474 for (
unsigned int i = 0; i <
face_no; ++i)
1475 result += quadrature[i].size();
1501 static const unsigned int offset[2][2][2] = {
1512 if (quadrature.
size() == 1)
1514 offset[face_orientation][face_flip][face_rotation] *
1516 quadrature[0].
size();
1520 for (
unsigned int i = 0; i <
face_no; ++i)
1523 unsigned int n_points = 0;
1526 n_points += quadrature[i].size();
1529 offset[face_orientation][face_flip][face_rotation] *
1551 const unsigned int n_quadrature_points,
1555 (void)reference_cell;
1562 n_quadrature_points);
1576 const unsigned int n_quadrature_points,
1580 (void)reference_cell;
1587 n_quadrature_points);
1598 const bool face_orientation,
1599 const bool face_flip,
1600 const bool face_rotation,
1601 const unsigned int n_quadrature_points,
1604 const unsigned int dim = 3;
1607 (void)reference_cell;
1689 const std::pair<unsigned int, RefinementCase<2>>
1691 internal::QProjector::select_subface_no_and_refinement_case(
1698 n_quadrature_points);
1709 Assert(reference_cell == ReferenceCells::get_hypercube<dim>(),
1711 (void)reference_cell;
1713 std::vector<Point<dim>> points(quadrature.
size());
1728 Assert(reference_cell == ReferenceCells::get_hypercube<dim>(),
1730 (void)reference_cell;
1732 std::vector<Point<dim>> points(quadrature.
size());
static BarycentricPolynomials< dim > get_fe_p_basis(const unsigned int degree)
static DataSetDescriptor subface(const ReferenceCell &reference_cell, const unsigned int face_no, const unsigned int subface_no, const bool face_orientation, const bool face_flip, const bool face_rotation, const unsigned int n_quadrature_points, const internal::SubfaceCase< dim > ref_case=internal::SubfaceCase< dim >::case_isotropic)
static DataSetDescriptor face(const ReferenceCell &reference_cell, const unsigned int face_no, const bool face_orientation, const bool face_flip, const bool face_rotation, const unsigned int n_quadrature_points)
static Quadrature< dim > project_to_all_subfaces(const ReferenceCell &reference_cell, const SubQuadrature &quadrature)
static Quadrature< dim > project_to_child(const ReferenceCell &reference_cell, const Quadrature< dim > &quadrature, const unsigned int child_no)
static Quadrature< dim > project_to_oriented_subface(const ReferenceCell &reference_cell, const SubQuadrature &quadrature, const unsigned int face_no, const unsigned int subface_no, const bool face_orientation, const bool face_flip, const bool face_rotation, const internal::SubfaceCase< dim > ref_case)
static Quadrature< dim > project_to_all_faces(const ReferenceCell &reference_cell, const hp::QCollection< dim - 1 > &quadrature)
static Quadrature< dim > project_to_oriented_face(const ReferenceCell &reference_cell, const SubQuadrature &quadrature, const unsigned int face_no, const bool face_orientation, const bool face_flip, const bool face_rotation)
static Quadrature< dim > project_to_line(const ReferenceCell &reference_cell, const Quadrature< 1 > &quadrature, const Point< dim > &p1, const Point< dim > &p2)
static void project_to_subface(const ReferenceCell &reference_cell, const SubQuadrature &quadrature, const unsigned int face_no, const unsigned int subface_no, std::vector< Point< dim > > &q_points, const RefinementCase< dim - 1 > &ref_case=RefinementCase< dim - 1 >::isotropic_refinement)
static Quadrature< dim > project_to_all_children(const ReferenceCell &reference_cell, const Quadrature< dim > &quadrature)
static void project_to_face(const ReferenceCell &reference_cell, const SubQuadrature &quadrature, const unsigned int face_no, std::vector< Point< dim > > &q_points)
const std::vector< double > & get_weights() const
const std::vector< Point< dim > > & get_points() const
unsigned int size() const
CollectionIterator< T > begin() const
unsigned int size() const
CollectionIterator< T > end() const
unsigned int max_n_quadrature_points() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
std::vector< Polynomial< double > > generate_complete_Lagrange_basis(const std::vector< Point< 1 > > &points)
constexpr const ReferenceCell Tetrahedron
constexpr const ReferenceCell Quadrilateral
constexpr const ReferenceCell Wedge
constexpr const ReferenceCell Pyramid
constexpr const ReferenceCell Triangle
constexpr const ReferenceCell Hexahedron
constexpr const ReferenceCell Line
static const unsigned int invalid_unsigned_int
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
static unsigned int child_cell_on_face(const RefinementCase< dim > &ref_case, const unsigned int face, const unsigned int subface, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false, const RefinementCase< dim - 1 > &face_refinement_case=RefinementCase< dim - 1 >::isotropic_refinement)
static unsigned int n_children(const RefinementCase< dim > &refinement_case)
DEAL_II_HOST constexpr Number determinant(const SymmetricTensor< 2, dim, Number > &)