Commit 463f4c9e authored by Alan Williams's avatar Alan Williams
Browse files

Make unit-test usage of MAX_NODES_PER_ELEM more robust.

parent 60588556
...@@ -322,12 +322,15 @@ inline void check_permutation_nodes(stk::topology topology, std::vector<std::vec ...@@ -322,12 +322,15 @@ inline void check_permutation_nodes(stk::topology topology, std::vector<std::vec
} }
} }
constexpr unsigned MAX_NODES_PER_ELEM = 100;
template <unsigned MAX_NODES> template <unsigned MAX_NODES>
STK_INLINE_FUNCTION STK_INLINE_FUNCTION
void check_side_nodes_ngp(stk::topology topology, unsigned gold_side_node_ordinals[][MAX_NODES]) void check_side_nodes_ngp(stk::topology topology, unsigned gold_side_node_ordinals[][MAX_NODES])
{ {
constexpr unsigned MAX_NODES_PER_ELEM = 100;
stk::mesh::Entity allElemNodes[MAX_NODES_PER_ELEM]; stk::mesh::Entity allElemNodes[MAX_NODES_PER_ELEM];
NGP_EXPECT_TRUE(topology.num_nodes() < MAX_NODES_PER_ELEM);
for (unsigned nodeOrdinal = 0; nodeOrdinal < topology.num_nodes(); ++nodeOrdinal) { for (unsigned nodeOrdinal = 0; nodeOrdinal < topology.num_nodes(); ++nodeOrdinal) {
allElemNodes[nodeOrdinal] = nodeOrdinal + 100; allElemNodes[nodeOrdinal] = nodeOrdinal + 100;
} }
...@@ -348,8 +351,9 @@ template <unsigned MAX_NODES> ...@@ -348,8 +351,9 @@ template <unsigned MAX_NODES>
STK_INLINE_FUNCTION STK_INLINE_FUNCTION
void check_edge_nodes_ngp(stk::topology topology, unsigned gold_edge_node_ordinals[][MAX_NODES]) void check_edge_nodes_ngp(stk::topology topology, unsigned gold_edge_node_ordinals[][MAX_NODES])
{ {
constexpr unsigned MAX_NODES_PER_ELEM = 100;
stk::mesh::Entity allElemNodes[MAX_NODES_PER_ELEM]; stk::mesh::Entity allElemNodes[MAX_NODES_PER_ELEM];
NGP_EXPECT_TRUE(topology.num_nodes() < MAX_NODES_PER_ELEM);
for (unsigned nodeOrdinal = 0; nodeOrdinal < topology.num_nodes(); ++nodeOrdinal) { for (unsigned nodeOrdinal = 0; nodeOrdinal < topology.num_nodes(); ++nodeOrdinal) {
allElemNodes[nodeOrdinal] = nodeOrdinal + 100; allElemNodes[nodeOrdinal] = nodeOrdinal + 100;
} }
...@@ -369,8 +373,9 @@ template <unsigned MAX_NODES> ...@@ -369,8 +373,9 @@ template <unsigned MAX_NODES>
STK_INLINE_FUNCTION STK_INLINE_FUNCTION
void check_face_nodes_ngp(stk::topology topology, unsigned gold_face_node_ordinals[][MAX_NODES]) void check_face_nodes_ngp(stk::topology topology, unsigned gold_face_node_ordinals[][MAX_NODES])
{ {
constexpr unsigned MAX_NODES_PER_ELEM = 100;
stk::mesh::Entity allElemNodes[MAX_NODES_PER_ELEM]; stk::mesh::Entity allElemNodes[MAX_NODES_PER_ELEM];
NGP_EXPECT_TRUE(topology.num_nodes() < MAX_NODES_PER_ELEM);
for (unsigned nodeOrdinal = 0; nodeOrdinal < topology.num_nodes(); ++nodeOrdinal) { for (unsigned nodeOrdinal = 0; nodeOrdinal < topology.num_nodes(); ++nodeOrdinal) {
allElemNodes[nodeOrdinal] = nodeOrdinal + 100; allElemNodes[nodeOrdinal] = nodeOrdinal + 100;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment