Repository navigation
Split element blocks by element type when writing exodus files - #4557
Conversation
|
moose failures expected, patch here: |
| @@ -206,50 +206,87 @@ const std::vector<int> prism_inverse_face_map = {4, 1, 2, 3, 5}; | |||
| subdomain_id_type & subdomain_id_end, | |||
| int & next_block_id) | |||
| { | |||
There was a problem hiding this comment.
Let's throw a libmesh_assert(mesh.is_serial()) in here, since we're making that assumption implicitly so many places below?
Right now of course the mesh is serial, because in NemesisIO_Helper we override the functions that would have called this, but at some point soon we're going to want to extend these features to Nemesis too.
There was a problem hiding this comment.
ok had to reorder some code because we are calling this with a serial on rank 0 only mesh
There was a problem hiding this comment.
added a test for writing a distributed mesh. essentially we were gathering an incomplete subdomain map on rank > 0 and then promptly returning from the caller for rank != 0
if we have the assert we can't do that.
There was a problem hiding this comment.
seems we are hitting this in moose still. I ll keep looking
There was a problem hiding this comment.
Oh, sorry! The most we can assert here is is_serial_on_zero(), I suppose?
f6185a0 to
ab7618f
Compare
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>
- fix the comment
Move logic on getting ID for polyhedra outside the routine
ab7618f to
f95b313
Compare
due to run_only_on_proc0 = false use in moose
Add a run_only_on_proc0 option to the mixed HEX8/TET4 round-trip test. With run_only_on_proc0=false each rank writes its own file through an ExodusII_IO_Helper, which exercises the reduction in build_subdomain_map(), including the add_sides side-block counts. Co-Authored-By: Claude <noreply@anthropic.com>
roystgnr
left a comment
There was a problem hiding this comment.
I feel like we're still certain to run into some kind of problems with this that we're not hitting in test coverage yet, but since I can no longer think of any specific examples, I think we're good to merge. Unless @jwpeterson wants a look first I'll merge tomorrow or this weekend.
|
FYI @GiudGiud and @roystgnr, we seem to be consistently failing all the distributed mesh make check sweeps on the devel->master merge since this PR went in. https://civet.inl.gov/branch/14145/
|
|
thanks for reaching out. From checking two recipes it's example 5. I ll take a look |

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.