Dear Community,
I got an AssertionError while executing this line of code:
msh, cell_tags, facet_tags = gmshio.read_from_msh("sinerot_1_1merged_final.msh", MPI.COMM_WORLD,0, gdim=3)
The weird thing is I already read many meshs successfully with the same code. I can’t explain why this one isn’t working. Am I missing something? Did I something wrong during mesh generation?
The full error message reads:
Warning : Gmsh has aleady been initialized
Info : Reading 'sinerot_1_1merged_final.msh'...
Info : 496 entities
Info : 59854 nodes
Info : 362949 elements
Info : Done reading 'sinerot_1_1merged_final.msh'
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
Cell In[24], line 1
----> 1 msh, cell_tags, facet_tags = gmshio.read_from_msh("sinerot_1_1merged_final.msh", MPI.COMM_WORLD,0, gdim=3)
File /usr/local/dolfinx-complex/lib/python3.10/dist-packages/dolfinx/io/gmshio.py:373, in read_from_msh(filename, comm, rank, gdim, partitioner)
371 gmsh.model.add("Mesh from file")
372 gmsh.merge(filename)
--> 373 msh = model_to_mesh(gmsh.model, comm, rank, gdim=gdim, partitioner=partitioner)
374 gmsh.finalize()
375 return msh
File /usr/local/dolfinx-complex/lib/python3.10/dist-packages/dolfinx/io/gmshio.py:243, in model_to_mesh(model, comm, rank, gdim, partitioner, dtype)
241 assert model is not None, "Gmsh model is None on rank responsible for mesh creation."
242 # Get mesh geometry and mesh topology for each element
--> 243 x = extract_geometry(model)
244 topologies = extract_topology_and_markers(model)
246 # Extract Gmsh cell id, dimension of cell and number of nodes to
247 # cell for each
File /usr/local/dolfinx-complex/lib/python3.10/dist-packages/dolfinx/io/gmshio.py:199, in extract_geometry(model, name)
195 # In some cases, Gmsh does not return the points in the same
196 # order as their unique node index. We therefore sort nodes in
197 # geometry according to the unique index
198 perm_sort = np.argsort(indices)
--> 199 assert np.all(indices[perm_sort] == np.arange(len(indices)))
200 return points[perm_sort]
AssertionError:
Thank you for any help!