allow 2D points for dolfin-xml
@@ -210,6 +210,6 @@ def write(filename, mesh):
if cell_type in mesh.cell_data:
for key, data in mesh.cell_data[cell_type].items():
cell_data_filename = "{}_{}.xml".format(os.path.splitext(filename)[0], key)
- dim = 2 if all(mesh.points[:, 2] == 0) else 3
+ dim = 2 if mesh.points.shape[1] == 2 or all(mesh.points[:, 2] == 0) else 3
_write_cell_data(cell_data_filename, dim, numpy.array(data))
return
