Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an assert to prevent returning true when asking if invalid_uint is the id of a vertex of a 1st order element #4123

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/geom/node_elem.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ class NodeElem : public Elem
/**
* \returns \p true if the specified (local) node number is a vertex.
*/
virtual bool is_vertex(const unsigned int) const override { return true; }
virtual bool is_vertex(const unsigned int libmesh_dbg_var(n)) const override
{ libmesh_assert_not_equal_to (n, invalid_uint); return true; }

/**
* NodeElem objects don't have faces or sides.
Expand Down
3 changes: 2 additions & 1 deletion src/geom/cell_hex8.C
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ const unsigned int Hex8::edge_nodes_map[Hex8::num_edges][Hex8::nodes_per_edge] =
// ------------------------------------------------------------
// Hex8 class member functions

bool Hex8::is_vertex(const unsigned int) const
bool Hex8::is_vertex(const unsigned int libmesh_dbg_var(n)) const
{
libmesh_assert_not_equal_to (n, invalid_uint);
return true;
}

Expand Down
4 changes: 3 additions & 1 deletion src/geom/cell_prism6.C
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,9 @@ const unsigned int Prism6::edge_nodes_map[Prism6::num_edges][Prism6::nodes_per_e
// ------------------------------------------------------------
// Prism6 class member functions

bool Prism6::is_vertex(const unsigned int) const
bool Prism6::is_vertex(const unsigned int libmesh_dbg_var(n)) const
{
libmesh_assert_not_equal_to (n, invalid_uint);
return true;
}

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


bool Prism6::is_face(const unsigned int) const
{
return false;
Expand Down
3 changes: 2 additions & 1 deletion src/geom/cell_pyramid5.C
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ const unsigned int Pyramid5::edge_nodes_map[Pyramid5::num_edges][Pyramid5::nodes
// ------------------------------------------------------------
// Pyramid5 class member functions

bool Pyramid5::is_vertex(const unsigned int) const
bool Pyramid5::is_vertex(const unsigned int libmesh_dbg_var(n)) const
{
libmesh_assert_not_equal_to (n, invalid_uint);
return true;
}

Expand Down
3 changes: 2 additions & 1 deletion src/geom/cell_tet4.C
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ const unsigned int Tet4::edge_nodes_map[Tet4::num_edges][Tet4::nodes_per_edge] =
// ------------------------------------------------------------
// Tet4 class member functions

bool Tet4::is_vertex(const unsigned int) const
bool Tet4::is_vertex(const unsigned int libmesh_dbg_var(n)) const
{
libmesh_assert_not_equal_to (n, invalid_uint);
return true;
}

Expand Down
3 changes: 2 additions & 1 deletion src/geom/edge_edge2.C
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ const Real Edge2::_embedding_matrix[Edge2::num_children][Edge2::num_nodes][Edge2

#endif

bool Edge2::is_vertex(const unsigned int) const
bool Edge2::is_vertex(const unsigned int libmesh_dbg_var(n)) const
{
libmesh_assert_not_equal_to (n, invalid_uint);
return true;
}

Expand Down
3 changes: 2 additions & 1 deletion src/geom/face_quad4.C
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ const Real Quad4::_embedding_matrix[Quad4::num_children][Quad4::num_nodes][Quad4
// ------------------------------------------------------------
// Quad4 class member functions

bool Quad4::is_vertex(const unsigned int) const
bool Quad4::is_vertex(const unsigned int libmesh_dbg_var(n)) const
{
libmesh_assert_not_equal_to (n, invalid_uint);
return true;
}

Expand Down
3 changes: 2 additions & 1 deletion src/geom/face_tri3.C
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ const Real Tri3::_embedding_matrix[Tri3::num_children][Tri3::num_nodes][Tri3::nu
// ------------------------------------------------------------
// Tri3 class member functions

bool Tri3::is_vertex(const unsigned int) const
bool Tri3::is_vertex(const unsigned int libmesh_dbg_var(n)) const
{
libmesh_assert_not_equal_to (n, invalid_uint);
return true;
}

Expand Down