Different behaviour of a mesh coming from generate_mesh() resp. UnitSquareMesh()?

I would strongly advice to use something else than mshr to create your mesh, as it is no longer maintained. I would suggest using pygmsh or the Gmsh (gui or Python API).
See for instance:

Or:
https://gmsh.info/

I have made a tutorial on how to use the Gmsh Python API:

And section 3 of

on how to create an xdmf file that can be loaded into dolfin

2 Likes