Conversation
createNetgenMesh numbered the regions of a Netgen mesh by the sorted label values present in the plex, and looked up descriptors of the geometry mesh at those values. The local part of a distributed plex can lack some label values, so its regions were renumbered, and a Netgen mesh built from it could not serve as the geometry of a further refinement: the next lookup indexed past its descriptors. Give every label value up to the largest its own region, empty where the local plex lacks it, so that region indices match label values on every rank. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Installs NGSolve/ngsPETSc#127, which numbers the regions of a Netgen mesh built from a local DMPlex by label value. Snapping a refined mesh against it fails on 2 ranks without that PR. Drop once #127 merges. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Installs NGSolve/ngsPETSc#127, which numbers the regions of a Netgen mesh built from a local DMPlex by label value. Snapping a refined mesh against it fails on 2 ranks without that PR. Drop once #127 merges. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Do we have a test where we do not pass any geometry information and check that basic features like mesh generation and multigrid (non geometric conforming) still work ? |
These tests would not make sense. A netgen mesh should always carry geometric information. |
But we would be breaking code of people that since we did not require to pass geometry before they have not been passing geometry. Let's make the changes compatible with old code, I think this is good practice, no ? |
That would be silently giving users the wrong code, and has little to do with this PR. |
createNetgenMesh(plex, geo)numbers the regions of the new Netgen mesh by the label values it finds inplex.Before this PR: regions are numbered by the sorted label values present in
plex. On a rank whose part of a distributed plex lacks some values (for example, a rank that touches only 4 of 6 boundary edges), the regions come out renumbered, and only the descriptors for the values present are added. A Netgen mesh built this way cannot serve asgeofor a further refinement. The next call looks updescriptors[depth][index-1]with a global label value and raisesIndexError: list index out of range.After this PR: every label value from 1 up to the largest (or up to the number of descriptors of
geo) gets its own region, empty where the local plex lacks that value. Region indices therefore equal label values on every rank. Unlabeled cells go into region 1 when no cell is labeled, and otherwise into a new region after the last one. Serial meshes with contiguous label values get the same regions as before.Firedrake needs this to snap each refined plex onto the geometry before refining it again, in parallel: firedrakeproject/firedrake
pbrubeck/adaptive-multigrid, wheretest_netgen_occ_adaptivityfails on 2 ranks without it.This PR was written by Claude (Claude Code) on behalf of @pbrubeck.
🤖 Generated with Claude Code