Open jwpeterson opened 3 years ago
Oh, and by "doesn't support" I just mean that if you write out a Mesh with Node and Elem numbering gaps to XDR and then immediately read it back in, it will "work" (won't crash) but the Elem numbering (only) will now be contiguous while the Node numbering will still be consistent with the original.
I just ran into (and re-discovered) this issue again today, exactly three months to the day from creating it in the first place. In discussing with @roystgnr, he came up with an idea for writing "missing" Elems (due to non-contiguous numbering) as NodeElems with xdr_id_type(-1)
for the corresponding node id. That way, we could read in and ignore these Elems without changing the XDR file format, so that seems like a good approach to me.
This Exodus file has a non-contiguous node and Elem numbering, and can be used for testing. Note that the Exodus reader preserves non-contiguous Node and Elem numberings during reads, but during writes it forces renumbering regardless of the Mesh's allow_renumbering()
status.
There does not seem to be a fundamental reason why we couldn't support having gaps in Elem numbering in a manner similar to the way gaps in Node numbering is supported (by writing NaNs) it just isn't implemented currently.
cc: @roystgnr