Skip to content

Support for libMesh sidesets#216

Open
pshriwise wants to merge 6 commits intoxdg-org:mainfrom
pshriwise:sideset-fix
Open

Support for libMesh sidesets#216
pshriwise wants to merge 6 commits intoxdg-org:mainfrom
pshriwise:sideset-fix

Conversation

@pshriwise
Copy link
Copy Markdown
Collaborator

This PR addresses #212 by splitting sidesets spanning multiple blocks into separate surfaces in the mesh topology understood by XDG (the libMesh sideset data is unmodified). New data structures are introduces to support a one-to-many mapping of sidesets to discovered interface sets. The previous merge method mainly validates the model and most of the work handling merging of sidesets into the model is now done in create_surfaces_from_sidesets_and_interfaces.

As this is a more complex workflow I've tried to provide clear comments throughout. There are a couple of local functors and locally defined type aliases that were introduced at the suggestion of Codex -- there's nothing wrong with it but it's not my typical style and I may rework some of that.

Key changes:

Refactoring and Clarification of Sideset/Interface Handling:

  • Replaced the merge_sidesets_into_interfaces method with a new map_sidesets_to_discovered_interfaces method, which validates and maps explicit sidesets to discovered interface sets, recording associations and ensuring all sideset faces are properly represented.

Surface Creation and Metadata Management:

  • Refactored create_surfaces_from_sidesets_and_interfaces to:
    • Split explicit sidesets into multiple surfaces if they span multiple interface pairs.
    • Assign unique surface IDs to implicit interface surfaces not covered by sidesets.
    • Track the mapping of sidesets to created surfaces for accurate metadata assignment.

New Data Structures in LibMeshManager:

  • sideset_interface_map_: is the coarse association map.
    It answers: “Which discovered interface pair or pairs does this sideset belong to?”
    It stores only the interface-pair keys, so it is useful for validating coverage and for knowing whether a sideset is one-to-one or one-to-many with discovered interfaces.

  • sideset_interface_face_map_: is the detailed grouping map.
    It answers: “Which specific faces from this sideset belong to each discovered interface pair?”
    This is what lets surface creation split a single sideset into multiple surfaces when the sideset spans multiple discovered interface sets.

  • sideset_surface_map_: is the final output association.
    It answers: “After surfaces are created, which surface IDs came from this sideset?”
    This is mainly used in parse_metadata() so the sideset’s boundary-condition metadata can be copied onto every resulting surface.

Code Cleanup:

  • Removed unused utility functions (intersects_set, contains_set) that are no longer needed.

Header File Update:

  • Included <map> in mesh_manager.h to support new data structures.

@Waqar-ukaea Waqar-ukaea self-assigned this Apr 10, 2026
@pshriwise pshriwise marked this pull request as ready for review April 12, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants