Skip to content

Commit

Permalink
Change for PR
Browse files Browse the repository at this point in the history
-Removed commented out code
-checkFirstOrderEdgeOverlap now takes a const Elem instead of a uniqu_ptr
  • Loading branch information
DanielYankura committed Jan 28, 2025
1 parent 815a28f commit 4d278c6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions framework/include/utils/MeshBaseDiagnosticsUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ void checkNonConformalMesh(const std::unique_ptr<libMesh::MeshBase> & mesh,
const Real conformality_tol,
unsigned int & num_nonconformal_nodes);

bool checkFirstOrderEdgeOverlap(const std::unique_ptr<const Elem> & edge1,
const std::unique_ptr<const Elem> & edge2,
bool checkFirstOrderEdgeOverlap(const Elem & edge1,
const Elem & edge2,
Point & intersection_point,
const Real intersection_tol);
}
5 changes: 2 additions & 3 deletions framework/src/meshgenerators/MeshDiagnosticsGenerator.C
Original file line number Diff line number Diff line change
Expand Up @@ -1431,8 +1431,7 @@ MeshDiagnosticsGenerator::checkNonMatchingEdges(const std::unique_ptr<MeshBase>
bounding_box_map.insert({elem, boundingBox});
}

std::unique_ptr<PointLocatorBase> point_locator =
mesh->sub_point_locator(); // PointLocatorBase::build(TREE_ELEMENTS, *mesh);
std::unique_ptr<PointLocatorBase> point_locator = mesh->sub_point_locator();
std::set<std::array<dof_id_type, 4>> overlapping_edges_nodes;
for (const auto elem : mesh->active_element_ptr_range())
{
Expand Down Expand Up @@ -1494,7 +1493,7 @@ MeshDiagnosticsGenerator::checkNonMatchingEdges(const std::unique_ptr<MeshBase>
// Now compare edge with other_edge
Point intersection_coords;
bool overlap = MeshBaseDiagnosticsUtils::checkFirstOrderEdgeOverlap(
edge, other_edge, intersection_coords, _non_matching_edge_tol);
*edge, *other_edge, intersection_coords, _non_matching_edge_tol);
if (overlap)
{
// Add the nodes that make up the 2 edges to the vector overlapping_edges_nodes
Expand Down
16 changes: 8 additions & 8 deletions framework/src/utils/MeshBaseDiagnosticsUtils.C
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ checkNonConformalMesh(const std::unique_ptr<MeshBase> & mesh,
}

bool
checkFirstOrderEdgeOverlap(const std::unique_ptr<const Elem> & edge1,
const std::unique_ptr<const Elem> & edge2,
checkFirstOrderEdgeOverlap(const Elem & edge1,
const Elem & edge2,
Point & intersection_point,
const Real intersection_tol)
{
// check that the two elements are of type EDGE2
mooseAssert(edge1->type() == EDGE2, "Elements must be of type EDGE2");
mooseAssert(edge2->type() == EDGE2, "Elements must be of type EDGE2");
mooseAssert(edge1.type() == EDGE2, "Elements must be of type EDGE2");
mooseAssert(edge2.type() == EDGE2, "Elements must be of type EDGE2");
// Get nodes from the two edges
const Point & p1 = edge1->point(0);
const Point & p2 = edge1->point(1);
const Point & p3 = edge2->point(0);
const Point & p4 = edge2->point(1);
const Point & p1 = edge1.point(0);
const Point & p2 = edge1.point(1);
const Point & p3 = edge2.point(0);
const Point & p4 = edge2.point(1);

// Check that the two edges are not sharing a node
if (p1 == p3 || p1 == p4 || p2 == p3 || p2 == p4)
Expand Down

0 comments on commit 4d278c6

Please sign in to comment.