data-exp-lab / yt_aspect

a yt plugin for working with ASPECT output and general .pvtu files
MIT License
2 stars 1 forks source link

some vtu files contain null elements #15

Open chrishavlin opened 1 year ago

chrishavlin commented 1 year ago

What I thought was initially a yt bug (https://github.com/yt-project/yt/issues/4334) is in fact an issue with the vtk pieces being loaded (see this comment in the yt PR that started to address it). The gist of it is that for some datasets, the connectivity arrays may contain invalid elements where all of the node indices in a given element point to the same index in the coordinate array. Simply removing those null elements from the connectivity arrays is sufficient -- and they do really seem to be extra (so coming from how those vtk files are originally written?). I'll open a PR here with a fix after the yt discussion is closed out...

chrishavlin commented 1 year ago

16 removes null elements, which removes the blank pixels for some datasets.

But looks like it doesn't catch all the cases, here's 2D ASPECT dataset using the new detection

import yt
import yt_aspect
ds = yt.load("aspect/output_shell_simple_2d/solution/solution-00000.pvtu", detect_null_elements=True)
yt.SlicePlot(ds, "z", ('connect0', 'T'), origin="native")

image