Skip to content

Commit

Permalink
Fix to make sure adjacency graph is limited to faces
Browse files Browse the repository at this point in the history
  • Loading branch information
tokusanya committed Sep 16, 2024
1 parent 1671ba2 commit a70776b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ namespace Iotm {
std::vector<EntityId> sideNodes =
get_sorted_side_nodes(adjacency.elementIndex, adjacency.side);

for (int otherSide = 1; otherSide <= get_element_topology(neighborElementIndex).num_sides();
for (int otherSide = 1; otherSide <= get_element_topology(neighborElementIndex).num_face_sides();
++otherSide) {
std::vector<EntityId> otherSideNodes =
get_sorted_side_nodes(neighborElementIndex, otherSide);
Expand Down Expand Up @@ -738,7 +738,7 @@ namespace Iotm {
initialize_side_connectivity_graph(elementIndices);

for (size_t elementIndex : elementIndices) {
int numSides = get_element_topology(elementIndex).num_sides();
int numSides = get_element_topology(elementIndex).num_face_sides();
for (int side = 1; side <= numSides; ++side) {
if (m_indexGraph[elementIndex].sideReference[side - 1] == 0) {
CurrentAdjacency adjacency(elementIndex, side);
Expand All @@ -752,7 +752,7 @@ namespace Iotm {
{
for (size_t elementIndex : elementIndices) {
m_indexGraph[elementIndex] =
FaceConnections(get_element_topology(elementIndex).num_sides());
FaceConnections(get_element_topology(elementIndex).num_face_sides());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ namespace Iotm {

bool operator!=(const TopologyMapEntry &rhs) const { return !(*this == rhs); }

int num_face_sides() const
{
if (topology->is_shell()) {
// Only interested in face boundaries, not edges
if (topology->parametric_dimension() == 2) {
return topology->number_faces();
}
}

return topology->number_boundaries();
}

int num_sides() const
{
return sideTopologies.size();
Expand Down

0 comments on commit a70776b

Please sign in to comment.