Conversation
build_subdomain_map() grouped elements by subdomain id alone, so a
subdomain containing more than one element type (e.g. a mix of
C0POLYHEDRON and HEX8 cells) became a single Exodus block whose type was
taken from its first element. That either errored ("all elements with a
given subdomain ID [must] be the same type") or, when the first element
was a standard type, crashed in ex_put_concat_all_blocks while writing
the polyhedra as that type.
Group elements by (subdomain, element type): single-type subdomains keep
their previous block id and behavior, while additional element types in a
subdomain get synthesized block ids. Exodus requires a single element
type per block, so this is what lets a mixed polyhedron/hex mesh be
written and read back.
Adds test_write_and_read_mixed_poly_hex, which round-trips a mesh with a
C0POLYHEDRON and a HEX8 in the same subdomain.
Co-Authored-By: Claude <noreply@anthropic.com>
GiudGiud
marked this pull request as ready for review
September 17, 2026 13:33
GiudGiud
commented
Sep 17, 2026
Comment on lines
+248
to
+249
| const subdomain_id_type block_id = | ||
| first_type ? sbd_id : next_synth_block_id++; |
Contributor
Author
There was a problem hiding this comment.
do we want a warning here? or just an info message
I m leaning info message, and adding the new entry into a subdomain name map
GiudGiud
commented
Sep 17, 2026
Comment on lines
+3079
to
+3080
| // subdomain id. This block becomes its own subdomain when | ||
| // the file is read back in. |
Contributor
Author
There was a problem hiding this comment.
that might be undesirable but also merging someone's random mesh same-name blocks (to try to recover the original subdomain assignments from subdomains names being the same and IDs being different) might also not work well
Contributor
Author
|
moose failures expected, patch here: |
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.
refs #4019
I need this because when reading from VTK and outputting to exodus straight away (to keep my pipeline with exodus in MOOSE, maybe I don't need to though), I dont have a step in libmesh to fix the element block assignments. I only have that in moose
build_subdomain_map() grouped elements by subdomain id alone, so a subdomain containing more than one element type (e.g. a mix of C0POLYHEDRON and HEX8 cells) became a single Exodus block whose type was taken from its first element. That either errored ("all elements with a given subdomain ID [must] be the same type") or, when the first element was a standard type, crashed in ex_put_concat_all_blocks while writing the polyhedra as that type.
Group elements by (subdomain, element type): single-type subdomains keep their previous block id and behavior, while additional element types in a subdomain get synthesized block ids. Exodus requires a single element type per block, so this is what lets a mixed polyhedron/hex mesh be written and read back.
Adds test_write_and_read_mixed_poly_hex, which round-trips a mesh with a C0POLYHEDRON and a HEX8 in the same subdomain.