21#include <boost/container/small_vector.hpp>
40 project_to_hex_face_and_append(
42 const unsigned int face_no,
45 const unsigned int subface_no = 0)
49 const double const_value = face_no % 2;
54 const unsigned int xi_index = (1 + face_no / 2) % 3,
55 eta_index = (2 + face_no / 2) % 3,
56 const_index = face_no / 2;
63 double xi_scale = 1.0, eta_scale = 1.0, xi_translation = 0.0,
64 eta_translation = 0.0;
73 xi_translation = subface_no % 2 * 0.5;
77 eta_translation = subface_no % 2 * 0.5;
82 xi_translation =
int(subface_no % 2) * 0.5;
83 eta_translation =
int(subface_no / 2) * 0.5;
95 cell_point[xi_index] = xi_scale * p[0] + xi_translation;
96 cell_point[eta_index] = eta_scale * p[1] + eta_translation;
97 cell_point[const_index] = const_value;
98 q_points.push_back(cell_point);
130 append_subobject_rule(
136 const double measure,
139 std::vector<double> &weights)
142 points.reserve(points.size() + quadrature.
size());
143 weights.reserve(weights.size() + quadrature.
size());
145 const auto support_points =
149 combined_orientation));
150 for (
unsigned int j = 0; j < quadrature.
size(); ++j)
155 for (
const unsigned int vertex_no :
158 support_points[vertex_no] *
162 points.push_back(mapped_point);
166 weights.push_back(quadrature.
weight(j) * measure /
167 face_reference_cell.
volume());
180 const unsigned int face_no,
184 const auto face_quadrature =
189 q_points = face_quadrature.get_points();
198 const unsigned int face_no,
202 const auto face_quadrature =
207 q_points = face_quadrature.get_points();
216 const unsigned int face_no,
220 (void)reference_cell;
226 internal::QProjector::project_to_hex_face_and_append(quadrature.
get_points(),
238 const unsigned int face_no,
239 const bool face_orientation,
240 const bool face_flip,
241 const bool face_rotation)
259 const unsigned int face_no,
264 reference_cell.n_face_orientations(face_no));
267 std::vector<Point<dim>> points;
268 std::vector<double> weights;
271 reference_cell.face_reference_cell(face_no);
274 face_vertices(face_reference_cell.
n_vertices());
275 for (
const unsigned int vertex_no : face_reference_cell.
vertex_indices())
276 face_vertices[vertex_no] =
277 reference_cell.face_vertex_location(face_no, vertex_no);
278 internal::QProjector::append_subobject_rule(face_reference_cell,
281 reference_cell.face_measure(
283 combined_orientation,
296 const unsigned int face_no,
302 (void)reference_cell;
304 const unsigned int dim = 1;
308 q_points[0] =
Point<dim>(
static_cast<double>(face_no));
317 const unsigned int face_no,
318 const unsigned int subface_no,
323 const auto face_quadrature =
330 q_points = face_quadrature.get_points();
339 const unsigned int face_no,
340 const unsigned int subface_no,
345 (void)reference_cell;
347 const auto face_quadrature =
354 q_points = face_quadrature.get_points();
364 const unsigned int face_no,
365 const unsigned int subface_no,
386 const unsigned int face_no,
387 const unsigned int subface_no,
393 reference_cell.n_face_orientations(face_no));
397 reference_cell.face_reference_cell(face_no).n_children(
402 std::vector<Point<dim>> points;
403 std::vector<double> weights;
407 for (
const unsigned int subface_vertex_no :
408 reference_cell.face_reference_cell(face_no).vertex_indices())
409 vertices.push_back(reference_cell.subface_vertex_location(
410 face_no, subface_no, subface_vertex_no, ref_case));
411 internal::QProjector::append_subobject_rule(
412 reference_cell.face_reference_cell(face_no),
415 reference_cell.face_measure(face_no),
416 combined_orientation,
431 std::size_t n_points = 0;
432 for (
const unsigned int face_no : reference_cell.face_indices())
433 n_points += quadrature[quadrature.
size() == 1 ? 0 : face_no].
size() *
434 reference_cell.n_face_orientations(face_no);
436 std::vector<Point<dim>> points;
437 std::vector<double> weights;
438 points.reserve(n_points);
439 weights.reserve(n_points);
441 for (
const unsigned int face_no : reference_cell.face_indices())
444 reference_cell.face_reference_cell(face_no);
447 face_vertices(face_reference_cell.
n_vertices());
448 for (
const unsigned int vertex_no : face_reference_cell.
vertex_indices())
449 face_vertices[vertex_no] =
450 reference_cell.face_vertex_location(face_no, vertex_no);
453 combined_orientation < reference_cell.n_face_orientations(face_no);
454 ++combined_orientation)
455 internal::QProjector::append_subobject_rule(
457 quadrature[quadrature.
size() == 1 ? 0 : face_no],
459 reference_cell.face_measure(face_no),
460 combined_orientation,
480 std::size_t n_points = 0;
481 for (
const unsigned int face_no : reference_cell.face_indices())
483 const auto n_orientations = reference_cell.n_face_orientations(face_no);
484 const auto face_reference_cell =
485 reference_cell.face_reference_cell(face_no);
486 for (
const auto &refinement_case : face_reference_cell.refinement_cases())
488 const auto n_children =
489 dim > 1 ? face_reference_cell.n_children(refinement_case) : 1;
490 n_points += n_children * n_orientations * quadrature.
size();
494 std::vector<Point<dim>> points;
495 std::vector<double> weights;
496 points.reserve(n_points);
497 weights.reserve(n_points);
500 for (
unsigned int face_no = 0; face_no < reference_cell.n_faces(); ++face_no)
502 const auto face_reference_cell =
503 reference_cell.face_reference_cell(face_no);
504 const auto &refinement_cases = face_reference_cell.refinement_cases();
505 for (
const auto &refinement_case : refinement_cases)
507 const auto n_children =
508 dim > 1 ? face_reference_cell.n_children(refinement_case) : 1;
510 combined_orientation <
511 reference_cell.n_face_orientations(face_no);
512 ++combined_orientation)
513 for (
unsigned int subface_no = 0; subface_no < n_children;
520 for (
const unsigned int subface_vertex_no :
521 reference_cell.face_reference_cell(face_no)
523 vertices.push_back(reference_cell.subface_vertex_location(
524 face_no, subface_no, subface_vertex_no, refinement_case));
525 internal::QProjector::append_subobject_rule(
526 reference_cell.face_reference_cell(face_no),
529 reference_cell.face_measure(face_no),
530 combined_orientation,
546 const unsigned int child_no)
550 (void)reference_cell;
565 std::vector<double> weights = quadrature.
get_weights();
582 (void)reference_cell;
584 const unsigned int n_points = quadrature.
size(),
587 std::vector<Point<dim>> q_points(n_points * n_children);
588 std::vector<double> weights(n_points * n_children);
592 for (
unsigned int child = 0; child < n_children; ++child)
596 for (
unsigned int i = 0; i < n_points; ++i)
598 q_points[child * n_points + i] = help.
point(i);
599 weights[child * n_points + i] = help.
weight(i);
616 (void)reference_cell;
618 const unsigned int n = quadrature.
size();
619 std::vector<Point<dim>> points(n);
620 std::vector<double> weights(n);
621 const double length = p1.
distance(p2);
623 for (
unsigned int k = 0; k < n; ++k)
625 const double alpha = quadrature.
point(k)[0];
626 points[k] = alpha * p2;
627 points[k] += (1. - alpha) * p1;
628 weights[k] = length * quadrature.
weight(k);
639 const unsigned int face_no,
640 const bool face_orientation,
641 const bool face_flip,
642 const bool face_rotation,
643 const unsigned int n_quadrature_points)
645 return face(reference_cell,
650 n_quadrature_points);
659 const unsigned int face_no,
661 const unsigned int n_quadrature_points)
665 reference_cell.n_face_orientations(face_no));
669 return {(reference_cell.n_face_orientations(face_no) * face_no +
670 combined_orientation) *
671 n_quadrature_points};
680 const unsigned int face_no,
681 const bool face_orientation,
682 const bool face_flip,
683 const bool face_rotation,
686 return face(reference_cell,
700 const unsigned int face_no,
706 reference_cell.n_face_orientations(face_no));
709 unsigned int offset = 0;
710 for (
unsigned int i = 0; i < face_no; ++i)
711 offset += reference_cell.n_face_orientations(i) *
712 quadrature[quadrature.
size() == 1 ? 0 : i].
size();
714 return {offset + combined_orientation *
715 quadrature[quadrature.
size() == 1 ? 0 : face_no].
size()};
724 const unsigned int face_no,
725 const unsigned int subface_no,
726 const bool face_orientation,
727 const bool face_flip,
728 const bool face_rotation,
729 const unsigned int n_quadrature_points,
749 const unsigned int face_no,
750 const unsigned int subface_no,
752 const unsigned int n_quadrature_points,
758 reference_cell.n_face_orientations(face_no));
760 const auto [final_subface_no, final_refinement_case] =
761 reference_cell.equivalent_refinement_case(combined_orientation,
766 reference_cell.face_reference_cell(face_no).n_children(
767 final_refinement_case));
776 const auto face_reference_cell = reference_cell.face_reference_cell(face_no);
777 const auto &refinement_cases = face_reference_cell.refinement_cases();
778 unsigned int points_per_face = 0;
779 for (
const auto &refinement_case : refinement_cases)
781 const auto n_children =
782 dim > 1 ? face_reference_cell.n_children(refinement_case) : 1;
783 points_per_face += reference_cell.n_face_orientations(face_no) *
784 n_children * n_quadrature_points;
789 unsigned int index = points_per_face * face_no;
790 for (
const auto &refinement_case : refinement_cases)
792 const auto n_children =
793 dim > 1 ? face_reference_cell.n_children(refinement_case) : 1;
795 if (refinement_case == final_refinement_case)
796 return index + (combined_orientation * n_children + final_subface_no) *
799 index += reference_cell.n_face_orientations(face_no) * n_children *
813 const unsigned int face_no)
817 (void)reference_cell;
819 std::vector<Point<dim>> points(quadrature.
size());
830 const unsigned int face_no,
831 const unsigned int subface_no,
836 (void)reference_cell;
838 std::vector<Point<dim>> points(quadrature.
size());
840 reference_cell, quadrature, face_no, subface_no, points, ref_case);
numbers::NumberTraits< Number >::real_type distance(const Point< dim, Number > &p) const
Class storing the offset index into a Quadrature rule created by project_to_all_faces() or project_to...
static DataSetDescriptor subface(const ReferenceCell< dim > &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< dim > &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)
Class which transforms dim - 1-dimensional quadrature rules to dim-dimensional face quadratures.
static Quadrature< dim > project_to_all_faces(const ReferenceCell< dim > &reference_cell, const hp::QCollection< dim - 1 > &quadrature)
static Quadrature< dim > project_to_oriented_face(const ReferenceCell< dim > &reference_cell, const SubQuadrature &quadrature, const unsigned int face_no, const bool face_orientation, const bool face_flip, const bool face_rotation)
static void project_to_subface(const ReferenceCell< dim > &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_subfaces(const ReferenceCell< dim > &reference_cell, const SubQuadrature &quadrature)
static void project_to_face(const ReferenceCell< dim > &reference_cell, const SubQuadrature &quadrature, const unsigned int face_no, std::vector< Point< dim > > &q_points)
static Quadrature< dim > project_to_all_children(const ReferenceCell< dim > &reference_cell, const Quadrature< dim > &quadrature)
static Quadrature< dim > project_to_line(const ReferenceCell< dim > &reference_cell, const Quadrature< 1 > &quadrature, const Point< dim > &p1, const Point< dim > &p2)
static Quadrature< dim > project_to_oriented_subface(const ReferenceCell< dim > &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)
Quadrature< dim - 1 > SubQuadrature
static Quadrature< dim > project_to_child(const ReferenceCell< dim > &reference_cell, const Quadrature< dim > &quadrature, const unsigned int child_no)
const Point< dim > & point(const unsigned int i) const
double weight(const unsigned int i) const
const std::vector< double > & get_weights() const
const std::vector< Point< dim > > & get_points() const
unsigned int size() const
constexpr unsigned int n_vertices() const
double d_linear_shape_function(const Point< dim > &xi, const unsigned int i) const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > vertex_indices() const
boost::container::small_vector< T, 8 > permute_by_combined_orientation(const ArrayView< const T > &vertices, const types::geometric_orientation orientation) const
types::geometric_orientation get_inverse_combined_orientation(const types::geometric_orientation orientation) const
unsigned int size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_ASSERT_UNREACHABLE()
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
constexpr ReferenceCell< 3 > Hexahedron
constexpr ReferenceCell< 1 > Line
constexpr unsigned int max_n_vertices()
constexpr ReferenceCell< 3 > Pyramid
constexpr const ReferenceCell< dim > & get_hypercube()
constexpr ReferenceCell< 3 > Wedge
types::geometric_orientation combined_face_orientation(const bool face_orientation, const bool face_rotation, const bool face_flip)
constexpr types::geometric_orientation default_geometric_orientation
std::uint8_t geometric_orientation
* const unsigned int n_q_points
static constexpr unsigned int faces_per_cell
static Point< dim > child_to_cell_coordinates(const Point< dim > &p, const unsigned int child_index, const RefinementCase< dim > refine_case=RefinementCase< dim >::isotropic_refinement)
static constexpr unsigned int max_children_per_cell