]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid a couple of references to GeometryInfo. 13301/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 27 Jan 2022 20:07:42 +0000 (13:07 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 27 Jan 2022 20:07:42 +0000 (13:07 -0700)
source/grid/manifold.cc

index 71f0d0573d15f939e4a44a2b139a9856fe8ef073..35d13739eff7fce301e00b91a0c122442ad48923 100644 (file)
@@ -19,6 +19,7 @@
 #include <deal.II/fe/fe_q.h>
 
 #include <deal.II/grid/manifold.h>
+#include <deal.II/grid/reference_cell.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
@@ -304,7 +305,7 @@ Manifold<dim, spacedim>::get_normals_at_vertices(
   const typename Triangulation<dim, spacedim>::face_iterator &face,
   FaceVertexNormals &                                         n) const
 {
-  for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face; ++v)
+  for (unsigned int v = 0; v < face->reference_cell().n_vertices(); ++v)
     {
       n[v] = normal_vector(face, face->vertex(v));
       n[v] /= n[v].norm();
@@ -762,10 +763,10 @@ FlatManifold<2>::get_normals_at_vertices(
   Manifold<2, 2>::FaceVertexNormals &    face_vertex_normals) const
 {
   const Tensor<1, 2> tangent = face->vertex(1) - face->vertex(0);
-  for (unsigned int vertex = 0; vertex < GeometryInfo<2>::vertices_per_face;
-       ++vertex)
+  // We're in 2d. Faces are edges:
+  for (const unsigned int vertex : ReferenceCells::Line.vertex_indices())
     // compute normals from tangent
-    face_vertex_normals[vertex] = Point<2>(tangent[1], -tangent[0]);
+    face_vertex_normals[vertex] = Tensor<1, 2>({tangent[1], -tangent[0]});
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.