This document only describes breaking changes in meshio. If you are interested in bug fixes, enhancements etc., best follow the meshio project on GitHub.
- CellBlocks are no longer tuples, but classes. You can no longer iterate over them like
Instead, use
for cell_type, cell_data in cells: pass
for cell_block in cells: cell_block.type cell_block.data
- meshio now only provides one command-line tool,
meshio
, with subcommands likeinfo
,convert
, etc. This replaces the formermeshio-info
,meshio-convert
etc.
- Polygons are now stored as
"polygon"
cell blocks, not"polygonN"
(whereN
is the number of nodes per polygon). One can simply retrieve the number of points viacellblock.data.shape[1]
.
-
mesh.cells
used to be a dictionary of the form{ "triangle": [[0, 1, 2], [0, 2, 3]], "quad": [[0, 7, 1, 10], ...] }
From 4.0.0 on,
mesh.cells
is a list of tuples,[ ("triangle", [[0, 1, 2], [0, 2, 3]]), ("quad", [[0, 7, 1, 10], ...]) ]
This has the advantage that multiple blocks of the same cell type can be accounted for. Also, cell ordering can be preserved.
You can now use the method
mesh.get_cells_type("triangle")
to get all cells of"triangle"
type, or usemesh.cells_dict
to build the old dictionary structure. -
mesh.cell_data
used to be a dictionary of the form{ "triangle": {"a": [0.5, 1.3], "b": [2.17, 41.3]}, "quad": {"a": [1.1, -0.3, ...], "b": [3.14, 1.61, ...]}, }
From 4.0.0 on,
mesh.cell_data
is a dictionary of lists,{ "a": [[0.5, 1.3], [1.1, -0.3, ...]], "b": [[2.17, 41.3], [3.14, 1.61, ...]], }
Each data list, e.g.,
mesh.cell_data["a"]
, can bezip
ped withmesh.cells
.An old-style
cell_data
dictionary can be retrieved viamesh.cell_data_dict
.