Repository navigation
GRIDEDIT-2306: Skip hanging edges in mesh boundary calculation - #546
priscavdsluis merged 1 commit into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
This pull request updates mesh boundary extraction to ignore hanging edges not attached to faces.
Changes:
- Filters hanging edges during boundary construction and traversal.
- Adds regression coverage for hanging-edge meshes.
| File | Summary |
|---|---|
libs/MeshKernel/tests/src/Mesh2DTest.cpp |
Adds hanging-edge boundary regression coverage. |
libs/MeshKernel/src/MeshBoundaryExtractor.cpp |
Excludes hanging and interior edges from boundary extraction. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| { | ||
|
|
||
| if (edgesFaces[count][1] != constants::missing::uintValue || !IsValidEdge(edges[count])) | ||
| if (!IsValidEdge(edges[count]) || |
There was a problem hiding this comment.
I think the edgesFaces pair is a sorted pair? And thus these lines mean: if the first is uintValue (which is max-int, indicating no face) then the next must be too so no faces, if the last edge is not uintValue (valid face) then the first must also be, so this is an interior edge.
It would be helpful to have a little helper function IsBoundaryEdge that hides this logic, and maybe adds a comment that explains the logic.
There was a problem hiding this comment.
The edge-face pair contains the edge adjacent face id's.
AI overview:
edgesFaces[count][0] — the first face adjacent to the edge. For a boundary edge (an edge with only one neighbouring face), this is always populated with that one valid face id. It's populated for essentially every edge that touches at least one face.
edgesFaces[count][1] — the second face adjacent to the edge, only set if the edge is shared between two faces (i.e. an interior edge). If the edge has only one adjacent face (boundary edge) or no adjacent face (a dangling/hanging edge not part of any face), this slot is constants::missing::uintValue.
So the convention used throughout this file is:
[0] |
[1] |
meaning |
|---|---|---|
| valid | valid | interior edge, shared by two faces |
| valid | missing | boundary edge, touches exactly one face |
| missing | missing | edge belongs to no face at all ("hanging" edge) |
No description provided.