21#include <boost/container/small_vector.hpp>
61 append_subobject_rule(
66 ReferenceCells::max_n_vertices<dim - 1>()> &vertices,
70 std::vector<double> &weights)
73 points.reserve(points.size() + quadrature.
size());
74 weights.reserve(weights.size() + quadrature.
size());
76 const auto support_points =
80 combined_orientation));
81 for (
unsigned int j = 0; j < quadrature.
size(); ++j)
86 for (
const unsigned int vertex_no :
89 support_points[vertex_no] *
93 points.push_back(mapped_point);
97 weights.push_back(quadrature.
weight(j) * measure /
98 face_reference_cell.
volume());
112 const unsigned int face_no,
117 reference_cell.n_face_orientations(face_no));
120 std::vector<Point<dim>> points;
121 std::vector<double> weights;
124 reference_cell.face_reference_cell(face_no);
127 face_vertices(face_reference_cell.
n_vertices());
128 for (
const unsigned int vertex_no : face_reference_cell.
vertex_indices())
129 face_vertices[vertex_no] =
130 reference_cell.face_vertex_location(face_no, vertex_no);
131 internal::QProjector::append_subobject_rule(face_reference_cell,
134 reference_cell.face_measure(
136 combined_orientation,
150 const unsigned int face_no,
151 const unsigned int subface_no,
157 reference_cell.n_face_orientations(face_no));
161 reference_cell.face_reference_cell(face_no).n_children(
166 std::vector<Point<dim>> points;
167 std::vector<double> weights;
171 for (
const unsigned int subface_vertex_no :
172 reference_cell.face_reference_cell(face_no).vertex_indices())
173 vertices.push_back(reference_cell.subface_vertex_location(
174 face_no, subface_no, subface_vertex_no, ref_case));
175 internal::QProjector::append_subobject_rule(
176 reference_cell.face_reference_cell(face_no),
179 reference_cell.face_measure(face_no),
180 combined_orientation,
195 std::size_t n_points = 0;
196 for (
const unsigned int face_no : reference_cell.face_indices())
197 n_points += quadrature[quadrature.
size() == 1 ? 0 : face_no].
size() *
198 reference_cell.n_face_orientations(face_no);
200 std::vector<Point<dim>> points;
201 std::vector<double> weights;
202 points.reserve(n_points);
203 weights.reserve(n_points);
205 for (
const unsigned int face_no : reference_cell.face_indices())
208 reference_cell.face_reference_cell(face_no);
211 face_vertices(face_reference_cell.
n_vertices());
212 for (
const unsigned int vertex_no : face_reference_cell.
vertex_indices())
213 face_vertices[vertex_no] =
214 reference_cell.face_vertex_location(face_no, vertex_no);
217 combined_orientation < reference_cell.n_face_orientations(face_no);
218 ++combined_orientation)
219 internal::QProjector::append_subobject_rule(
221 quadrature[quadrature.
size() == 1 ? 0 : face_no],
223 reference_cell.face_measure(face_no),
224 combined_orientation,
244 std::size_t n_points = 0;
245 for (
const unsigned int face_no : reference_cell.face_indices())
247 const auto n_orientations = reference_cell.n_face_orientations(face_no);
248 const auto face_reference_cell =
249 reference_cell.face_reference_cell(face_no);
250 for (
const auto &refinement_case : face_reference_cell.refinement_cases())
252 const auto n_children =
253 dim > 1 ? face_reference_cell.n_children(refinement_case) : 1;
254 n_points += n_children * n_orientations * quadrature.
size();
258 std::vector<Point<dim>> points;
259 std::vector<double> weights;
260 points.reserve(n_points);
261 weights.reserve(n_points);
264 for (
unsigned int face_no = 0; face_no < reference_cell.n_faces(); ++face_no)
266 const auto face_reference_cell =
267 reference_cell.face_reference_cell(face_no);
268 const auto &refinement_cases = face_reference_cell.refinement_cases();
269 for (
const auto &refinement_case : refinement_cases)
271 const auto n_children =
272 dim > 1 ? face_reference_cell.n_children(refinement_case) : 1;
274 combined_orientation <
275 reference_cell.n_face_orientations(face_no);
276 ++combined_orientation)
277 for (
unsigned int subface_no = 0; subface_no < n_children;
284 for (
const unsigned int subface_vertex_no :
285 reference_cell.face_reference_cell(face_no)
287 vertices.push_back(reference_cell.subface_vertex_location(
288 face_no, subface_no, subface_vertex_no, refinement_case));
289 internal::QProjector::append_subobject_rule(
290 reference_cell.face_reference_cell(face_no),
293 reference_cell.face_measure(face_no),
294 combined_orientation,
310 const unsigned int child_no)
312 Assert(reference_cell == ReferenceCells::get_hypercube<dim>(),
314 (void)reference_cell;
318 const unsigned int n_q_points = quadrature.
size();
320 std::vector<Point<dim>> q_points(n_q_points);
321 for (
unsigned int i = 0; i < n_q_points; ++i)
329 std::vector<double> weights = quadrature.
get_weights();
330 for (
unsigned int i = 0; i < n_q_points; ++i)
344 Assert(reference_cell == ReferenceCells::get_hypercube<dim>(),
346 (void)reference_cell;
348 const unsigned int n_points = quadrature.
size(),
351 std::vector<Point<dim>> q_points(n_points * n_children);
352 std::vector<double> weights(n_points * n_children);
356 for (
unsigned int child = 0; child < n_children; ++child)
359 project_to_child(reference_cell, quadrature, child);
360 for (
unsigned int i = 0; i < n_points; ++i)
362 q_points[child * n_points + i] = help.
point(i);
363 weights[child * n_points + i] = help.
weight(i);
378 Assert(reference_cell == ReferenceCells::get_hypercube<dim>(),
380 (void)reference_cell;
382 const unsigned int n = quadrature.
size();
383 std::vector<Point<dim>> points(n);
384 std::vector<double> weights(n);
385 const double length = p1.
distance(p2);
387 for (
unsigned int k = 0; k < n; ++k)
389 const double alpha = quadrature.
point(k)[0];
390 points[k] = alpha * p2;
391 points[k] += (1. - alpha) * p1;
392 weights[k] = length * quadrature.
weight(k);
403 const unsigned int face_no,
405 const unsigned int n_quadrature_points)
409 reference_cell.n_face_orientations(face_no));
413 return {(reference_cell.n_face_orientations(face_no) * face_no +
414 combined_orientation) *
415 n_quadrature_points};
424 const unsigned int face_no,
430 reference_cell.n_face_orientations(face_no));
433 unsigned int offset = 0;
434 for (
unsigned int i = 0; i < face_no; ++i)
435 offset += reference_cell.n_face_orientations(i) *
436 quadrature[quadrature.
size() == 1 ? 0 : i].
size();
438 return {offset + combined_orientation *
439 quadrature[quadrature.
size() == 1 ? 0 : face_no].
size()};
448 const unsigned int face_no,
449 const unsigned int subface_no,
451 const unsigned int n_quadrature_points,
457 reference_cell.n_face_orientations(face_no));
459 const auto [final_subface_no, final_refinement_case] =
460 reference_cell.equivalent_refinement_case(combined_orientation,
465 reference_cell.face_reference_cell(face_no).n_children(
466 final_refinement_case));
475 const auto face_reference_cell = reference_cell.face_reference_cell(face_no);
476 const auto &refinement_cases = face_reference_cell.refinement_cases();
477 unsigned int points_per_face = 0;
478 for (
const auto &refinement_case : refinement_cases)
480 const auto n_children =
481 dim > 1 ? face_reference_cell.n_children(refinement_case) : 1;
482 points_per_face += reference_cell.n_face_orientations(face_no) *
483 n_children * n_quadrature_points;
488 unsigned int index = points_per_face * face_no;
489 for (
const auto &refinement_case : refinement_cases)
491 const auto n_children =
492 dim > 1 ? face_reference_cell.n_children(refinement_case) : 1;
494 if (refinement_case == final_refinement_case)
495 return index + (combined_orientation * n_children + final_subface_no) *
498 index += reference_cell.n_face_orientations(face_no) * n_children *
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 face(const ReferenceCell< dim > &reference_cell, const unsigned int face_no, const types::geometric_orientation combined_orientation, const unsigned int n_quadrature_points)
static DataSetDescriptor subface(const ReferenceCell< dim > &reference_cell, const unsigned int face_no, const unsigned int subface_no, const types::geometric_orientation combined_orientation, const unsigned int n_quadrature_points, const internal::SubfaceCase< dim > ref_case=internal::SubfaceCase< dim >::case_isotropic)
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_all_subfaces(const ReferenceCell< dim > &reference_cell, const SubQuadrature &quadrature)
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_face(const ReferenceCell< dim > &reference_cell, const SubQuadrature &quadrature, const unsigned int face_no, const types::geometric_orientation combined_orientation)
static Quadrature< dim > project_to_subface(const ReferenceCell< dim > &reference_cell, const SubQuadrature &quadrature, const unsigned int face_no, const unsigned int subface_no, const types::geometric_orientation combined_orientation, const RefinementCase< dim - 1 > &ref_case)
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
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)
constexpr unsigned int max_n_vertices()
constexpr ReferenceCell< 3 > Pyramid
constexpr ReferenceCell< 3 > Wedge
std::uint8_t geometric_orientation