Manually creating the mesh using MeshEditor
:
nodes, cells = return_points_cells(abaqus_fname)
num_nodes = nodes.shape[0]
num_elems = cells.shape[0]
msh = Mesh()
e = MeshEditor()
e.open(msh,'quadrilateral',2,2)
e.init_vertices(num_nodes)
e.init_cells(num_elems)
for i, nval in enumerate(nodes):
e.add_vertex(i,nval)
for elem in cells:
e.add_cell(elem[0],np.array([elem[1], elem[2], elem[4], elem[3]],int))
e.close(order=False)
with XDMFFile(comm,'trialMesh.xdmf') as wf:
wf.write(msh)
results in the following mesh:
It does not read the complete mesh, however, at least does better than throwing a ordering
exception.