Skip to content

Commit 9a777ff

Browse files
authored
Merge branch 'main' into medit-corners
2 parents 889aeef + 7eb71be commit 9a777ff

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

meshio/med/_med.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ def write(filename, mesh):
239239
med_mesh.attrs.create("UNI", numpy_void_str) # spatial unit
240240
med_mesh.attrs.create("SRT", 1) # sorting type MED_SORT_ITDT
241241
# component names:
242-
# med_mesh.attrs.create("NOM", np.string_("".join(f"{name:<16}" for name in names)))
242+
names = ["X", "Y", "Z"][: mesh.points.shape[1]]
243+
med_mesh.attrs.create("NOM", np.string_("".join(f"{name:<16}" for name in names)))
243244
med_mesh.attrs.create("DES", np.string_("Mesh created with meshio"))
244245
med_mesh.attrs.create("TYP", 0) # mesh type (MED_NON_STRUCTURE)
245246

meshio/xdmf/time_series.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,10 @@ def write_points_cells(self, points, cells):
283283
grid = ET.SubElement(
284284
self.domain, "Grid", Name=self.mesh_name, GridType="Uniform"
285285
)
286-
self.points(grid, points)
287-
self.cells(cells, grid)
286+
self.points(grid, np.asarray(points))
287+
self.cells(
288+
[CellBlock(cell_type, np.asarray(data)) for cell_type, data in cells], grid
289+
)
288290
self.has_mesh = True
289291

290292
def write_data(self, t, point_data=None, cell_data=None):

0 commit comments

Comments
 (0)