You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Reading a VTU file only gives the cells from the last piece.
To Reproduce
A minimal code example that reproduces the problem would be a big help if you can provide it. Attach a small mesh file if necessary.
Open a VTU file with multiple pieces. mesh.cells will show only a single piece
I've tracked the issue to a small typo in src/meshio/vtu/_vtu.py, function _organize_cells lines 154 and 155 need indenting in once more to be within the loop above.
for offset, cls, cdr in zip(point_offsets, cells, cell_data_raw):
cls, cell_data = vtk_cells_from_data(
cls["connectivity"].ravel(),
cls["offsets"].ravel(),
cls["types"].ravel(),
cdr,
)
for c in cls:
out_cells.append(CellBlock(c.type, c.data + offset))
to become
for offset, cls, cdr in zip(point_offsets, cells, cell_data_raw):
cls, cell_data = vtk_cells_from_data(
cls["connectivity"].ravel(),
cls["offsets"].ravel(),
cls["types"].ravel(),
cdr,
)
for c in cls:
out_cells.append(CellBlock(c.type, c.data + offset))
Let me know if you want me to draft a PR or anything.
The text was updated successfully, but these errors were encountered:
Describe the bug
Reading a VTU file only gives the cells from the last piece.
To Reproduce
A minimal code example that reproduces the problem would be a big help if you can provide it. Attach a small mesh file if necessary.
Open a VTU file with multiple pieces.
mesh.cells
will show only a single pieceI've tracked the issue to a small typo in
src/meshio/vtu/_vtu.py
, function_organize_cells
lines 154 and 155 need indenting in once more to be within the loop above.to become
Let me know if you want me to draft a PR or anything.
The text was updated successfully, but these errors were encountered: