get_vertices(
const typename Triangulation<dim, spacedim>::cell_iterator &cell) const;
+ /**
+ * Return the mapped vertices of a face.
+ *
+ * Same as above but working on a given face of a cell.
+ *
+ * @param[in] cell The cell containing the face.
+ * @param[in] face_no The number of the face within the cell.
+ */
+ boost::container::small_vector<Point<spacedim>,
+ GeometryInfo<dim>::vertices_per_face>
+ get_vertices(const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const unsigned int face_no) const;
+
/**
* Return the mapped center of a cell.
*
+template <int dim, int spacedim>
+boost::container::small_vector<Point<spacedim>,
+ GeometryInfo<dim>::vertices_per_face>
+Mapping<dim, spacedim>::get_vertices(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const unsigned int face_no) const
+{
+ boost::container::small_vector<Point<spacedim>,
+ GeometryInfo<dim>::vertices_per_face>
+ face_vertices;
+
+ const auto &cell_vertices = get_vertices(cell);
+ const auto &reference_cell = cell->reference_cell();
+ const auto face_orientation = cell->combined_face_orientation(face_no);
+
+ for (const unsigned int v :
+ reference_cell.face_reference_cell(face_no).vertex_indices())
+ {
+ face_vertices.push_back(
+ cell_vertices[reference_cell.face_to_cell_vertices(
+ face_no, v, face_orientation)]);
+ }
+
+ return face_vertices;
+}
+
+
+
template <int dim, int spacedim>
Point<spacedim>
Mapping<dim, spacedim>::get_center(
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2001 - 2022 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+// Checks if vertices on face are given in correct oder
+
+#include <deal.II/fe/mapping_q.h>
+
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/tria.h>
+
+#include "../tests.h"
+
+
+template <int dim>
+std::vector<Point<dim>>
+get_vertices(const typename Triangulation<dim>::cell_iterator &cell,
+ const typename Triangulation<dim>::face_iterator &face,
+ const Mapping<dim> & mapping)
+{
+ std::vector<Point<dim>> vertices(face->n_vertices());
+
+ for (unsigned int i = 0; i < face->n_vertices(); ++i)
+ {
+ vertices[i] = mapping.transform_unit_to_real_cell(
+ cell, mapping.transform_real_to_unit_cell(cell, face->vertex(i)));
+ }
+ return vertices;
+}
+
+template <int dim>
+void
+test_vertex_order()
+{
+ deallog << "dim=" << dim << std::endl;
+
+ Triangulation<dim> tria;
+ GridGenerator::hyper_cube(tria, -1.0, 1.0);
+
+ MappingQ<dim> mapping(1);
+
+ for (const auto &cell : tria.active_cell_iterators())
+ for (unsigned int f = 0; f < cell->n_faces(); ++f)
+ {
+ auto const &vertices_detour =
+ get_vertices(cell, cell->face(f), mapping);
+ auto const &vertices = mapping.get_vertices(cell, f);
+
+ AssertDimension(vertices_detour.size(), vertices.size());
+
+ for (unsigned int i = 0; i < vertices.size(); ++i)
+ {
+ auto const diff = vertices[i] - vertices_detour[i];
+ AssertThrow(diff.norm() < 1e-12, ExcMessage("Vertices differ!"));
+ }
+ }
+
+ deallog << "OK" << std::endl;
+}
+
+int
+main()
+{
+ initlog();
+ deallog << std::setprecision(12);
+
+ test_vertex_order<1>();
+ test_vertex_order<2>();
+ test_vertex_order<3>();
+
+ return 0;
+}