Say that I want to build a circular plane using Gmsh (v4.13.1), store the geometry and then import it in FEniCSx (DOLFINx v0.9.0). I have created the following script.
import gmsh
from mpi4py import MPI
from dolfinx import io
if __name__ == '__main__':
gmsh.initialize()
# Add a circular plane
c = factory.addCircle(3, 0, 0, 1)
cl = factory.addCurveLoop([c])
ps = factory.addPlaneSurface([cl])
gmsh.model.occ.synchronize()
pg = gmsh.model.addPhysicalGroup(2, [ps]) # Comment
gmsh.model.setPhysicalName(2, pg, 'Circle') # Comment
gmsh.model.mesh.generate(3)
filename = 'test.msh'
gmsh.write(filename)
gmsh.finalize()
# Test reading for FEniCSx
io.gmshio.read_from_msh(filename, MPI.COMM_WORLD) # FAILS if the circle is added :(
However, I get the following error:
Invalid rank, error stack:
internal_Issend(61644): MPI_Issend(buf=0x58841a1f9741, count=1, MPI_BYTE, 1, 1, comm=0x84000005, request=0x58841a212424) failed
internal_Issend(61605): Invalid rank has value 1 but must be nonnegative and less than 1
Abort(943325958) on node 0 (rank 0 in comm 416): application called MPI_Abort(comm=0x84000005, 943325958) - process 0
What should I do? Thanks in advance