Skip to content

Commit 3da133e

Browse files
committed
Add an assert to prevent returning true when asking if invalid_uint is a vertex
refs #4122
1 parent 358b251 commit 3da133e

8 files changed

Lines changed: 24 additions & 8 deletions

File tree

include/geom/node_elem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ class NodeElem : public Elem
179179
/**
180180
* \returns \p true if the specified (local) node number is a vertex.
181181
*/
182-
virtual bool is_vertex(const unsigned int) const override { return true; }
182+
virtual bool is_vertex(const unsigned int n) const override
183+
{ libmesh_ignore(n); libmesh_assert_not_equal_to (n, invalid_uint); return true; }
183184

184185
/**
185186
* NodeElem objects don't have faces or sides.

src/geom/cell_hex8.C

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ const unsigned int Hex8::edge_nodes_map[Hex8::num_edges][Hex8::nodes_per_edge] =
6969
// ------------------------------------------------------------
7070
// Hex8 class member functions
7171

72-
bool Hex8::is_vertex(const unsigned int) const
72+
bool Hex8::is_vertex(const unsigned int n) const
7373
{
74+
libmesh_ignore(n);
75+
libmesh_assert_not_equal_to (n, invalid_uint);
7476
return true;
7577
}
7678

src/geom/cell_prism6.C

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,10 @@ const unsigned int Prism6::edge_nodes_map[Prism6::num_edges][Prism6::nodes_per_e
145145
// ------------------------------------------------------------
146146
// Prism6 class member functions
147147

148-
bool Prism6::is_vertex(const unsigned int) const
148+
bool Prism6::is_vertex(const unsigned int n) const
149149
{
150+
libmesh_ignore(n);
151+
libmesh_assert_not_equal_to (n, invalid_uint);
150152
return true;
151153
}
152154

@@ -155,6 +157,7 @@ bool Prism6::is_edge(const unsigned int) const
155157
return false;
156158
}
157159

160+
158161
bool Prism6::is_face(const unsigned int) const
159162
{
160163
return false;

src/geom/cell_pyramid5.C

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ const unsigned int Pyramid5::edge_nodes_map[Pyramid5::num_edges][Pyramid5::nodes
6262
// ------------------------------------------------------------
6363
// Pyramid5 class member functions
6464

65-
bool Pyramid5::is_vertex(const unsigned int) const
65+
bool Pyramid5::is_vertex(const unsigned int n) const
6666
{
67+
libmesh_ignore(n);
68+
libmesh_assert_not_equal_to (n, invalid_uint);
6769
return true;
6870
}
6971

src/geom/cell_tet4.C

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ const unsigned int Tet4::edge_nodes_map[Tet4::num_edges][Tet4::nodes_per_edge] =
5757
// ------------------------------------------------------------
5858
// Tet4 class member functions
5959

60-
bool Tet4::is_vertex(const unsigned int) const
60+
bool Tet4::is_vertex(const unsigned int n) const
6161
{
62+
libmesh_ignore(n);
63+
libmesh_assert_not_equal_to (n, invalid_uint);
6264
return true;
6365
}
6466

src/geom/edge_edge2.C

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ const Real Edge2::_embedding_matrix[Edge2::num_children][Edge2::num_nodes][Edge2
5151

5252
#endif
5353

54-
bool Edge2::is_vertex(const unsigned int) const
54+
bool Edge2::is_vertex(const unsigned int n) const
5555
{
56+
libmesh_ignore(n);
57+
libmesh_assert_not_equal_to (n, invalid_uint);
5658
return true;
5759
}
5860

src/geom/face_quad4.C

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ const Real Quad4::_embedding_matrix[Quad4::num_children][Quad4::num_nodes][Quad4
9191
// ------------------------------------------------------------
9292
// Quad4 class member functions
9393

94-
bool Quad4::is_vertex(const unsigned int) const
94+
bool Quad4::is_vertex(const unsigned int n) const
9595
{
96+
libmesh_ignore(n);
97+
libmesh_assert_not_equal_to (n, invalid_uint);
9698
return true;
9799
}
98100

src/geom/face_tri3.C

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ const Real Tri3::_embedding_matrix[Tri3::num_children][Tri3::num_nodes][Tri3::nu
8383
// ------------------------------------------------------------
8484
// Tri3 class member functions
8585

86-
bool Tri3::is_vertex(const unsigned int) const
86+
bool Tri3::is_vertex(const unsigned int n) const
8787
{
88+
libmesh_ignore(n);
89+
libmesh_assert_not_equal_to (n, invalid_uint);
8890
return true;
8991
}
9092

0 commit comments

Comments
 (0)