Skip to content

Enable Quadratic Elements in NetGenMeshInterface - #4506

Open
miaoyinb wants to merge 3 commits into
libMesh:develfrom
miaoyinb:quad3D
Open

Enable Quadratic Elements in NetGenMeshInterface#4506
miaoyinb wants to merge 3 commits into
libMesh:develfrom
miaoyinb:quad3D

Conversation

@miaoyinb

Copy link
Copy Markdown
Contributor

closes #4505

@roystgnr roystgnr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are we supporting TET14 here? There's clearly some partial support (which I'd say leave in even if we don't get to total support yet), but it looks to me like we're only handling mid-edge node movement, not mid-face nodes.

If the answer is "yes", could we add a unit test?

If "no", could we take it out of the if() before that libmesh_not_implemented()?

Otherwise this looks great.

@miaoyinb

Copy link
Copy Markdown
Contributor Author

Ah, yes. I missed the face centroid of TRI7 for TET14, will add it.

@moosebuild

Copy link
Copy Markdown

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

Coverage

5112d2 #4506 f0a4b5
Total Total +/- New
Rate 65.72% 65.74% +0.01% 100.00%
Hits 78898 78962 +64 71
Misses 41151 41158 +7 0

Diff coverage report

Full coverage report

This comment will be updated on new commits.

@miaoyinb
miaoyinb marked this pull request as ready for review July 30, 2026 03:21
@miaoyinb

Copy link
Copy Markdown
Contributor Author

Added full TET14 support

Comment on lines +171 to +173
// NetGen (and volume_to_surface_mesh) can leave gaps in rank 0's
// element and node id spaces, while broadcast() compacts them on the
// other ranks. Renumber here -- on every rank, in lockstep -- so all

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Come again? I'm fine with merging this as-is, since you're just working around this problem, not creating it, but I'd love to know what's happening exactly and get a reproducer. If there's some conditions under which broadcast() does not result in an identical mesh on all ranks, that's a bug, and I want to get that replicated and fixed, not just worked around!

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.

Thanks, I think we can merge this for now. Here are more details about the issue (testNetGenQuadratic can be a good reproducer at np=2)

  • On rank 0, triangulate() deletes the input surface elements (the octahedron's 8 boundary TRIs) and adds the 4 new TETs. delete_elem() on a ReplicatedMesh leaves null holes in the _elements storage vector and does not shrink it, so rank 0 ends up with 4 live elements occupying an id space of size 8 (max_elem_id()=8).
  • broadcast() on the receivers does mesh.clear() and then unpacks only the live entities, preserving their ids. So rank 1 gets a freshly-rebuilt, compact mesh (max_elem_id()=4).
  • broadcast()'s own postcondition asserts verify(n_elem()) / verify(n_nodes()), which hold on both ranks. It does not assert max_elem_id(), which is why the id-space-size difference slips through.

So the assertion that trips is all_increased_order_range's comm().verify(mesh.max_elem_id())

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.

Support Quadratic Elements in NetGenMeshInterface

3 participants