XDMF reader coordinate format
The XDMF coordinate format selects a subset of another dataset by an arbitrary array of indices. This would be a handy feature but I'm running into issues left and right while trying to use it.
Example 1
First, here's an XDMF file that defines 3 points:
<Xdmf Version="3.0">
<Domain>
<Grid Name="Demo">
<Topology TopologyType="Polyvertex" NodesPerElement="1" NumberOfElements="3">
<DataItem DataType="Int" Dimensions="3" ItemType="coordinates">
<DataItem Name="IndexSet" DataType="Int" Dimensions="3" ItemType="Uniform" Format="XML">
0 1 2
</DataItem>
<DataItem Name="ReferenceSet" DataTye="Int" Dimensions="10" ItemType="Uniform" Format="XML">
0 1 2 3 4 5 6 7 8 9
</DataItem>
</DataItem>
</Topology>
<Geometry GeometryType="XYZ">
<DataItem Format="XML" DataType="Float" Precision="8" Dimensions="3 3">
0.0 0.0 0.0
0.5 0.5 0.0
1.0 0.0 0.0
</DataItem>
</Geometry>
</Grid>
</Domain>
</Xdmf>
Note that the Name
attributes are not required, I'm just using them to refer to DataItem
s here.
Note the ItemType="coordinates"
attribute. While the example in the XDMF docs defines the ItemType="Coordinate"
and Type="Coordinate"
attributes, the argument list at the bottom of the same page indicates that the correct value for ItemType
is "coordinates"
, and doesn't even list Type
as an attribute. I found that only the latter works, which is why the XDMF example above follows that syntax.
Xdmf3Reader
To get the obvious problems out of the way, the XDMF3 reader (Xdmf3ReaderS
and Xdmf3ReaderT
) seems to lack support for this feature, because it exits with the following message:
terminate called after throwing an instance of 'XdmfError'
what(): 'Format' not found in generateHeavyControllers in XdmfCoreItemFactory
Is this a known issue? I feel like the XDMF3 reader implements a very narrow subset of the standard and is untested, because I've only ever managed to visualize the simplest of models with it, so I'm usually left with the XDMF2 reader.
XdmfReader
The XDMF2 reader seems to have support for the coordinate format, but it leads to memory corruption. Load the file in ParaView; the 3 points should be read and rendered correctly. So far so good, but when closing the program I get the following backtrace:
#0 0x00007fffec77b3b6 in QObjectPrivate::ConnectionData::removeConnection(QObjectPrivate::Connection*) () at /usr/lib/libQt6Core.so.6
#1 0x00007fffec780f26 in QObject::~QObject() () at /usr/lib/libQt6Core.so.6
#2 0x00007ffff75238fc in QToolButton::~QToolButton() () at /usr/lib/libQt6Widgets.so.6
#3 0x00007fffec77c6fb in QObjectPrivate::deleteChildren() () at /usr/lib/libQt6Core.so.6
#4 0x00007ffff732cd41 in QWidget::~QWidget() () at /usr/lib/libQt6Widgets.so.6
#5 0x00007ffff750ce11 in QToolBar::~QToolBar() () at /usr/lib/libQt6Widgets.so.6
#6 0x00007fffec77c6fb in QObjectPrivate::deleteChildren() () at /usr/lib/libQt6Core.so.6
#7 0x00007ffff732cd41 in QWidget::~QWidget() () at /usr/lib/libQt6Widgets.so.6
#8 0x000055555555df29 in ParaViewMainWindow::~ParaViewMainWindow (this=0x5555556d7940, __in_chrg=<optimized out>) at paraview/Clients/ParaView/ParaViewMainWindow.cxx:285
#9 0x000055555555df4e in ParaViewMainWindow::~ParaViewMainWindow (this=0x5555556d7940, __in_chrg=<optimized out>) at paraview/Clients/ParaView/ParaViewMainWindow.cxx:285
#10 0x0000555555566758 in pqparaviewInitializer::~pqparaviewInitializer (this=0x7fffffffd6c0, __in_chrg=<optimized out>) at paraview/build/Clients/ParaView/pqparaviewInitializer.cxx:49
#11 0x0000555555565a10 in main (argc=2, argv=0x55555565ef80) at paraview/build/Clients/ParaView/paraview_main.cxx:136
Example 2
That backtrace isn't too useful, but I can produce a segfault in the XDMF2 reader by nesting the subset in another coordinate DataItem
.
<Xdmf Version="3.0">
<Domain>
<Grid Name="Demo">
<Topology TopologyType="Polyvertex" NodesPerElement="1" NumberOfElements="3">
<DataItem DataType="Int" Dimensions="3" ItemType="coordinates">
<DataItem Name="IndexSet" DataType="Int" Dimensions="3" ItemType="coordinates">
<DataItem Name="NestedIndexSet" DataType="Int" Dimensions="3" ItemType="Uniform" Format="XML">
0 1 2
</DataItem>
<DataItem Name="NestedReferenceSet" DataType="Int" Dimensions="9" ItemType="Uniform" Format="XML">
0 1 2 0 1 2 0 1 2
</DataItem>
</DataItem>
<DataItem Name="ReferenceSet" DataTye="Int" Dimensions="9" ItemType="Uniform" Format="XML">
0 1 2 0 1 2 0 1 2
</DataItem>
</DataItem>
</Topology>
<Geometry GeometryType="XYZ">
<DataItem Format="XML" DataType="Float" Precision="8" Dimensions="3 3">
0.0 0.0 0.0
0.5 0.5 0.0
1.0 0.0 0.0
</DataItem>
</Geometry>
</Grid>
</Domain>
</Xdmf>
Backtrace while reading with the XDMF2 reader:
#0 0x00007ffff02ab32c in ??? () at /usr/lib/libc.so.6
#1 0x00007ffff025a6c8 in raise () at /usr/lib/libc.so.6
#2 0x00007ffff02424b8 in abort () at /usr/lib/libc.so.6
#3 0x00007ffff0243395 in ??? () at /usr/lib/libc.so.6
#4 0x00007ffff02b52a7 in ??? () at /usr/lib/libc.so.6
#5 0x00007ffff02b7614 in ??? () at /usr/lib/libc.so.6
#6 0x00007ffff02b9e93 in free () at /usr/lib/libc.so.6
#7 0x00007fffd78f9535 in xdmf2::XdmfArray::~XdmfArray (this=0x555558d8b930, __in_chrg=<optimized out>) at paraview/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfArray.cxx:248
#8 0x00007fffd78f991c in xdmf2::XdmfArray::~XdmfArray (this=0x555558d8b930, __in_chrg=<optimized out>) at paraview/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfArray.cxx:257
#9 0x00007fffd79108c6 in xdmf2::XdmfDataItem::~XdmfDataItem (this=0x55555aa2f360, __in_chrg=<optimized out>) at paraview/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfDataItem.cxx:66
#10 0x00007fffd7910a54 in xdmf2::XdmfDataItem::~XdmfDataItem (this=0x55555aa2f360, __in_chrg=<optimized out>) at paraview/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfDataItem.cxx:72
#11 0x00007fffd7913979 in xdmf2::XdmfDataItem::UpdateFunction (this=0x7fffffffa6f0) at paraview/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfDataItem.cxx:493
#12 0x00007fffd7913f53 in xdmf2::XdmfDataItem::Update (this=0x7fffffffa6f0) at paraview/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfDataItem.cxx:517
#13 0x00007fffd7942ddb in xdmf2::XdmfTopology::Update (this=0x55555a527780) at paraview/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfTopology.cxx:668
#14 0x00007fffd7937411 in xdmf2::XdmfGrid::Update (this=0x5555570d0608) at paraview/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfGrid.cxx:754
#15 0x00007fffdd58d7d3 in vtkXdmfHeavyData::ReadUniformData (this=0x7fffffffac00, xmfGrid=0x5555570d0608, blockId=-1) at paraview/VTK/IO/Xdmf2/vtkXdmfHeavyData.cxx:374
#16 0x00007fffdd58ca0a in vtkXdmfHeavyData::ReadData (this=0x7fffffffac00, xmfGrid=0x5555570d0608, blockId=-1) at paraview/VTK/IO/Xdmf2/vtkXdmfHeavyData.cxx:163
#17 0x00007fffdd58c77a in vtkXdmfHeavyData::ReadData (this=0x7fffffffac00) at paraview/VTK/IO/Xdmf2/vtkXdmfHeavyData.cxx:97
#18 0x00007fffdd56e34b in vtkXdmfReader::RequestData (this=0x555555b874c0, outputVector=0x555555c67430) at paraview/VTK/IO/Xdmf2/vtkXdmfReader.cxx:473
#19 0x00007ffff0e7c132 in vtkDataObjectAlgorithm::ProcessRequest (this=0x555555b874c0, request=0x55555a390b30, inputVector=0x0, outputVector=0x555555c67430) at paraview/VTK/Common/ExecutionModel/vtkDataObjectAlgorithm.cxx:75
#20 0x00007fffdd56c6a8 in vtkXdmfReader::ProcessRequest (this=0x555555b874c0, request=0x55555a390b30, inputVector=0x0, outputVector=0x555555c67430) at paraview/VTK/IO/Xdmf2/vtkXdmfReader.cxx:206
#21 0x00007fffe96c6c94 in vtkFileSeriesReader::RequestData (this=0x55555a56d710, request=0x55555a390b30, inputVector=0x0, outputVector=0x555555c67430) at paraview/VTKExtensions/IOCore/vtkFileSeriesReader.cxx:715
...
Hardware and environment info is probably not relevant here because I'm running into the same problem on two different linux machines as well as a mac, but let me know if you need some more info about them regardless. The backtraces were produced by GDB and a debug build of paraview's master from yesterday (paraview commit hash 6f539b78d269409a484e1f63de59fbbc44444dfc, VTK commit hash e0b9ddb4).
I'm trying to figure out what the problem is but I'm running out of time, so any help or insight would be appreciated.