]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix comparisons in ReferenceCell 11605/head
authorDaniel Arndt <arndtd@ornl.gov>
Fri, 22 Jan 2021 16:29:08 +0000 (11:29 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Fri, 22 Jan 2021 16:40:12 +0000 (11:40 -0500)
include/deal.II/grid/reference_cell.h

index ab26e36d1615a2167577dbfd9988b62d825e81b1..4943f2e34d98fd1aa99ec8cd37004d1a94c09a74 100644 (file)
@@ -283,22 +283,22 @@ namespace ReferenceCell
   inline ArrayView<const unsigned int>
   Type::faces_for_given_vertex(const unsigned int vertex) const
   {
-    if (kind == Type::Line)
+    if (*this == Type::Line)
       {
         AssertIndexRange(vertex, GeometryInfo<1>::vertices_per_cell);
         return {&GeometryInfo<2>::vertex_to_face[vertex][0], 1};
       }
-    else if (kind == Type::Quad)
+    else if (*this == Type::Quad)
       {
         AssertIndexRange(vertex, GeometryInfo<2>::vertices_per_cell);
         return {&GeometryInfo<2>::vertex_to_face[vertex][0], 2};
       }
-    else if (kind == Type::Hex)
+    else if (*this == Type::Hex)
       {
         AssertIndexRange(vertex, GeometryInfo<3>::vertices_per_cell);
         return {&GeometryInfo<3>::vertex_to_face[vertex][0], 3};
       }
-    else if (kind == Type::Tri)
+    else if (*this == Type::Tri)
       {
         AssertIndexRange(vertex, 3);
         static const std::array<std::array<unsigned int, 2>, 3> table = {
@@ -306,7 +306,7 @@ namespace ReferenceCell
 
         return table[vertex];
       }
-    else if (kind == Type::Tet)
+    else if (*this == Type::Tet)
       {
         AssertIndexRange(vertex, 4);
         static const std::array<std::array<unsigned int, 3>, 4> table = {
@@ -314,7 +314,7 @@ namespace ReferenceCell
 
         return table[vertex];
       }
-    else if (kind == Type::Wedge)
+    else if (*this == Type::Wedge)
       {
         AssertIndexRange(vertex, 6);
         static const std::array<std::array<unsigned int, 3>, 6> table = {
@@ -327,7 +327,7 @@ namespace ReferenceCell
 
         return table[vertex];
       }
-    else if (kind == Type::Pyramid)
+    else if (*this == Type::Pyramid)
       {
         AssertIndexRange(vertex, 5);
         static const unsigned int X = numbers::invalid_unsigned_int;

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.