Skip to content

GRIDEDIT-2306: Skip hanging edges in mesh boundary calculation - #546

Merged
priscavdsluis merged 1 commit into
masterfrom
feature/GRIDEDIT-2306-boundary-calculation-with-hanging-edges
Oct 1, 2026
Merged

priscavdsluis merged 1 commit into
masterfrom
feature/GRIDEDIT-2306-boundary-calculation-with-hanging-edges

Conversation

@RStolkerDeltares

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]) ||

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@priscavdsluis
priscavdsluis merged commit 65bd79b into master Oct 1, 2026
17 checks passed
@priscavdsluis
priscavdsluis deleted the feature/GRIDEDIT-2306-boundary-calculation-with-hanging-edges branch October 1, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants