Bug in vtkMultiBlockPLOT3DReader

There appears to be a bug in vtkMultiBlockPLOT3DReader, specifically in the way it guesses the format of the file. I’m using whatever version of VTK is distributed with ParaView 5.8.1.

First, I try to read the file with auto-detect turned on:

import vtk
reader = vtk.vtkMultiBlockPLOT3DReader()
reader.SetXYZFileName(‘CARTBody00001200.x’)
reader.AutoDetectFormatOn()
reader.Update()
40.633s) [main thread ]vtkMultiBlockPLOT3DRead:2504 ERR| vtkMultiBlockPLOT3DReader (0x1748090): Could not determine settings for file. Cannot read.

Since I know what “flavor” of Plot3d this is, I’ll try disabling auto-detect and specifying all the options myself:

reader = vtk.vtkMultiBlockPLOT3DReader()
reader.SetXYZFileName(‘CARTBody00001200.x’)
reader.BinaryFileOn()
reader.MultiGridOn()
reader.AutoDetectFormatOff()
reader.BinaryFileOn()
reader.MultiGridOn()
reader.HasByteCountOff()
reader.IBlankingOn()
reader.DoublePrecisionOff()
reader.SetByteOrderToBigEndian()
reader.Update()
( 324.724s) [main thread ]vtkMultiBlockPLOT3DRead:2504 ERR| vtkMultiBlockPLOT3DReader (0x15a8590): Could not determine settings for file. Cannot read.

I’ve tried reading the file manually with a small Python script, and everything appears to be in order with it. It appears that VTK tries to do the auto-detect regardless of what the user asked for. I can supply an example data file on request, but Discourse won’t let me upload it since I’m a new user.

The specific issue with this file may be that it’s a C binary file with 512 blocks. If you byte-swap 512, you get 131072, which is a large but plausible number of blocks. That ends up confusing the endianness auto-detection.

Eric, can you report the issue on the issue tracker please? You should be able to attach the dataset there. I’m pointing here to the ParaView issues tracker, instead of VTK’s as this bug will impact ParaView and it’ll most likely get fixed faster if it’s there.

Reported here

A fix is available here and should make it in ParaView 5.9 release. Thanks for reporting.