Skip to content

Patched MeshTools::find_nodal_neighbors#4270

Merged
roystgnr merged 3 commits intolibMesh:develfrom
pbehne:find_nodal_neighbors_patch
Oct 13, 2025
Merged

Patched MeshTools::find_nodal_neighbors#4270
roystgnr merged 3 commits intolibMesh:develfrom
pbehne:find_nodal_neighbors_patch

Conversation

@pbehne
Copy link
Copy Markdown
Contributor

@pbehne pbehne commented Oct 9, 2025

This PR updates MeshTools::find_nodal_neighbors to work correctly with higher order element types.

Refer to #4269 for two examples of incorrect results. The results for the same meshes, with this patch are listed below.

TRI6 example:

Node   Node id()=0, Point=(x,y,z)=(       0,        0,        0)
has neighbors:
    Node id()=3, Point=(x,y,z)=(     0.5,        0,        0)
    Node id()=5, Point=(x,y,z)=(     0.5,      0.5,        0)

Node   Node id()=1, Point=(x,y,z)=(       1,        0,        0)
has neighbors:
    Node id()=3, Point=(x,y,z)=(     0.5,        0,        0)
    Node id()=4, Point=(x,y,z)=(       1,      0.5,        0)

Node   Node id()=2, Point=(x,y,z)=(       1,        1,        0)
has neighbors:
    Node id()=4, Point=(x,y,z)=(       1,      0.5,        0)
    Node id()=5, Point=(x,y,z)=(     0.5,      0.5,        0)

Node   Node id()=3, Point=(x,y,z)=(     0.5,        0,        0)
has neighbors:
    Node id()=0, Point=(x,y,z)=(       0,        0,        0)
    Node id()=1, Point=(x,y,z)=(       1,        0,        0)

Node   Node id()=4, Point=(x,y,z)=(       1,      0.5,        0)
has neighbors:
    Node id()=1, Point=(x,y,z)=(       1,        0,        0)
    Node id()=2, Point=(x,y,z)=(       1,        1,        0)

Node   Node id()=5, Point=(x,y,z)=(     0.5,      0.5,        0)
has neighbors:
    Node id()=0, Point=(x,y,z)=(       0,        0,        0)
    Node id()=2, Point=(x,y,z)=(       1,        1,        0)

TET10 example:

Node   Node id()=0, Point=(x,y,z)=(       0,        0,        0)
has neighbors:
    Node id()=4, Point=(x,y,z)=(0.561231,        0,        0)
    Node id()=6, Point=(x,y,z)=(0.280616,  0.48604,        0)
    Node id()=7, Point=(x,y,z)=(0.280616, 0.162013, 0.458243)

Node   Node id()=1, Point=(x,y,z)=( 1.12246,        0,        0)
has neighbors:
    Node id()=4, Point=(x,y,z)=(0.561231,        0,        0)
    Node id()=5, Point=(x,y,z)=(0.841847,  0.48604,        0)
    Node id()=8, Point=(x,y,z)=(0.841847, 0.162013, 0.458243)

Node   Node id()=2, Point=(x,y,z)=(0.561231, 0.972081,        0)
has neighbors:
    Node id()=5, Point=(x,y,z)=(0.841847,  0.48604,        0)
    Node id()=6, Point=(x,y,z)=(0.280616,  0.48604,        0)
    Node id()=9, Point=(x,y,z)=(0.561231, 0.648054, 0.458243)

Node   Node id()=3, Point=(x,y,z)=(0.561231, 0.324027, 0.916486)
has neighbors:
    Node id()=7, Point=(x,y,z)=(0.280616, 0.162013, 0.458243)
    Node id()=8, Point=(x,y,z)=(0.841847, 0.162013, 0.458243)
    Node id()=9, Point=(x,y,z)=(0.561231, 0.648054, 0.458243)

Node   Node id()=4, Point=(x,y,z)=(0.561231,        0,        0)
has neighbors:
    Node id()=0, Point=(x,y,z)=(       0,        0,        0)
    Node id()=1, Point=(x,y,z)=( 1.12246,        0,        0)

Node   Node id()=5, Point=(x,y,z)=(0.841847,  0.48604,        0)
has neighbors:
    Node id()=1, Point=(x,y,z)=( 1.12246,        0,        0)
    Node id()=2, Point=(x,y,z)=(0.561231, 0.972081,        0)

Node   Node id()=6, Point=(x,y,z)=(0.280616,  0.48604,        0)
has neighbors:
    Node id()=0, Point=(x,y,z)=(       0,        0,        0)
    Node id()=2, Point=(x,y,z)=(0.561231, 0.972081,        0)

Node   Node id()=7, Point=(x,y,z)=(0.280616, 0.162013, 0.458243)
has neighbors:
    Node id()=0, Point=(x,y,z)=(       0,        0,        0)
    Node id()=3, Point=(x,y,z)=(0.561231, 0.324027, 0.916486)

Node   Node id()=8, Point=(x,y,z)=(0.841847, 0.162013, 0.458243)
has neighbors:
    Node id()=1, Point=(x,y,z)=( 1.12246,        0,        0)
    Node id()=3, Point=(x,y,z)=(0.561231, 0.324027, 0.916486)

Node   Node id()=9, Point=(x,y,z)=(0.561231, 0.648054, 0.458243)
has neighbors:
    Node id()=2, Point=(x,y,z)=(0.561231, 0.972081,        0)
    Node id()=3, Point=(x,y,z)=(0.561231, 0.324027, 0.916486)

Closes #4269

@moosebuild
Copy link
Copy Markdown

moosebuild commented Oct 10, 2025

Job Coverage, step Generate coverage on 874c3ac wanted to post the following:

Coverage

034308 #4270 874c3a
Total Total +/- New
Rate 64.96% 64.95% -0.01% 100.00%
Hits 76814 76808 -6 9
Misses 41432 41441 +9 0

Diff coverage report

Full coverage report

This comment will be updated on new commits.

@roystgnr roystgnr merged commit 0bbd247 into libMesh:devel Oct 13, 2025
21 checks passed
@pbehne pbehne deleted the find_nodal_neighbors_patch branch October 16, 2025 21:30
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.

MeshTools::find_nodal_neighbors does not work correctly for higher order meshes

3 participants