Correct order of nodes for TET10 elements
@@ -235,9 +235,18 @@ def write(filename, mesh):
for k, x in enumerate(mesh.points):
f.write("{} {!r} {!r} {!r}\n".format(k + 1, x[0], x[1], x[2]))
eid = 0
+ tet10_order = [0,4,1,5,2,6,7,8,9,3]
for cell_type, node_idcs in mesh.cells.items():
f.write("!\n")
f.write("$ELEMENT TYPE=" + meshio_to_permas_type[cell_type] + "\n")
+ if cell_type=='tetra10':
+ for row in node_idcs:
+ eid += 1
+ mylist = row.tolist()
+ mylist = [mylist[i] for i in tet10_order]
+ nids_strs = (str(nid + 1) for nid in mylist)
+ f.write(str(eid) + " " + " ".join(nids_strs) + "\n")
+ else:
for row in node_idcs:
eid += 1
nids_strs = (str(nid + 1) for nid in row.tolist())
