fix: MeshDoctor: ensure consistent node numbering between 2D element and 3D faces#219
Merged
fix: MeshDoctor: ensure consistent node numbering between 2D element and 3D faces#219
Conversation
jafranc
approved these changes
Feb 4, 2026
| if neighborCell.GetCellDimension() == 3: | ||
| # This 3D cell has a mapping - use it for the 2D cell | ||
| if neighborId in cellToNodeMapping: | ||
| cell_2d_to_mapping[ c ] = dict( cellToNodeMapping[ neighborId ] ) |
Collaborator
There was a problem hiding this comment.
wouldn't this add the full neighbor cell's mapping and not only the partial mapping for the 2d cell ?
Contributor
Author
There was a problem hiding this comment.
@jafranc you are absolutely correct, this was a bit lazy on my part.
I removed these extra mappings for code clarity and memory efficiency.
Thanks for catching this!
Co-authored-by: Jacques Franc <49998870+jafranc@users.noreply.github.com>
Co-authored-by: Jacques Franc <49998870+jafranc@users.noreply.github.com>
Co-authored-by: paloma-martinez <104762252+paloma-martinez@users.noreply.github.com>
Co-authored-by: Jacques Franc <49998870+jafranc@users.noreply.github.com>
Co-authored-by: Jacques Franc <49998870+jafranc@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When splitting a mesh at fracture locations, node duplication mappings were only applied to 3D cells (volume elements). 2D cells (faces/surfaces) that share the same nodes were not updated, causing them to reference old node IDs after the split.
This PR ensures consistent node indexing across all cell dimensions, thus preventing geometric inconsistencies at fracture interfaces.
Note that neither this fix nor the original code guarantees the preservation of the original numbering after splitting.