Hey everyone! This is my first post here, so I apologize if its in the wrong category or otherwise not according to the rules. Happy to open this in a different place, if that helps:)
I am encountering an issue when reading a Fluent .cas.h5 case file with vtkFLUENTCFFReader (VTK version 9.5.20251101.dev0). Several cell_data arrays in the resulting vtkUnstructuredGrid blocks have invalid shapes.
Came here for help after discussion with the pyvista folks.
Below is a reproducer.
from pathlib import Path
import vtk
here = Path(__file__).parent
# Read the .cas.h5 file using VTK's Fluent CFF reader
reader = vtk.vtkFLUENTCFFReader()
reader.SetFileName(str(here / "one_way_fsi_probe_report.cas.h5"))
reader.Update()
# Get the multiblock
output = reader.GetOutputDataObject(0)
assert isinstance(output, vtk.vtkMultiBlockDataSet)
print(f"Number of blocks: {output.GetNumberOfBlocks()}")
for i in range(output.GetNumberOfBlocks()):
block = output.GetBlock(i)
print(f" Type: {block.GetClassName()}")
print(f" Points: {block.points.shape}")
for key, array in block.point_data.items():
print(f" - {key}: {array.shape}")
print(f" Cells: {block.cells['cell_types'].shape}")
for key, array in block.cell_data.items():
print(f" - {key}: {array.shape}")
Output:
Number of blocks: 2
Type: vtkUnstructuredGrid
Points: (83135, 3)
Cells: (48478,)
- SV_DENSITY: (48478,)
...
- SV_BF_V: (48478, 2)
Type: vtkUnstructuredGrid
Points: (83135, 3)
Cells: (290985,)
- SV_DENSITY: (290985,)
- SV_K: (242507,)
- SV_MU_LAM: (242507,)
- SV_MU_T: (242507,)
- SV_O: (242507,)
- SV_P: (242507,)
- SV_SIGMA_XX: (0,)
- SV_SIGMA_XY: (0,)
- SV_SIGMA_XZ: (0,)
- SV_SIGMA_YY: (0,)
- SV_SIGMA_YZ: (0,)
- SV_SIGMA_ZZ: (0,)
- SV_U: (242507,)
- SV_V: (242507,)
- SV_W: (242507,)
- SV_WALL_DIST: (290985,)
- SV_BF_V: (242507, 2)
Inspecting the underlying .cas.h5 file gives:
results/1/phase-1/cells/SV_BF_V/1: (290985, 3)
results/1/phase-1/cells/SV_DENSITY/1: (339463,)
results/1/phase-1/cells/SV_K/1: (290985,)
results/1/phase-1/cells/SV_MU_LAM/1: (290985,)
results/1/phase-1/cells/SV_MU_T/1: (290985,)
results/1/phase-1/cells/SV_O/1: (290985,)
results/1/phase-1/cells/SV_P/1: (290985,)
results/1/phase-1/cells/SV_SIGMA_XX/1: (48478,)
results/1/phase-1/cells/SV_SIGMA_XY/1: (48478,)
results/1/phase-1/cells/SV_SIGMA_XZ/1: (48478,)
results/1/phase-1/cells/SV_SIGMA_YY/1: (48478,)
results/1/phase-1/cells/SV_SIGMA_YZ/1: (48478,)
results/1/phase-1/cells/SV_SIGMA_ZZ/1: (48478,)
results/1/phase-1/cells/SV_U/1: (290985,)
results/1/phase-1/cells/SV_V/1: (290985,)
results/1/phase-1/cells/SV_W/1: (290985,)
results/1/phase-1/cells/SV_WALL_DIST/1: (339463,)
Thanks a lot for your help!
