Skip to content

Commit 27e3784

Browse files
authored
Merge pull request #4123 from GiudGiud/PR_node-check
Add an assert to prevent returning true when asking if invalid_uint is the id of a vertex of a 1st order element
2 parents 083f7a0 + d878831 commit 27e3784

8 files changed

Lines changed: 17 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 libmesh_dbg_var(n)) const override
183+
{ 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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ 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 libmesh_dbg_var(n)) const
7373
{
74+
libmesh_assert_not_equal_to (n, invalid_uint);
7475
return true;
7576
}
7677

src/geom/cell_prism6.C

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ 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 libmesh_dbg_var(n)) const
149149
{
150+
libmesh_assert_not_equal_to (n, invalid_uint);
150151
return true;
151152
}
152153

@@ -155,6 +156,7 @@ bool Prism6::is_edge(const unsigned int) const
155156
return false;
156157
}
157158

159+
158160
bool Prism6::is_face(const unsigned int) const
159161
{
160162
return false;

src/geom/cell_pyramid5.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ 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 libmesh_dbg_var(n)) const
6666
{
67+
libmesh_assert_not_equal_to (n, invalid_uint);
6768
return true;
6869
}
6970

src/geom/cell_tet4.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ 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 libmesh_dbg_var(n)) const
6161
{
62+
libmesh_assert_not_equal_to (n, invalid_uint);
6263
return true;
6364
}
6465

src/geom/edge_edge2.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ 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 libmesh_dbg_var(n)) const
5555
{
56+
libmesh_assert_not_equal_to (n, invalid_uint);
5657
return true;
5758
}
5859

src/geom/face_quad4.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ 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 libmesh_dbg_var(n)) const
9595
{
96+
libmesh_assert_not_equal_to (n, invalid_uint);
9697
return true;
9798
}
9899

src/geom/face_tri3.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ 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 libmesh_dbg_var(n)) const
8787
{
88+
libmesh_assert_not_equal_to (n, invalid_uint);
8889
return true;
8990
}
9091

0 commit comments

Comments
 (0)