Pygmsh Tutorial?

  1. So, you need the boolean fragments to make a mesh that respects the boundaries of each of the domains that you are trying to make a union of. See the gmsh-tutorials or Transitioning from mesh.xml to mesh.xdmf, from dolfin-convert to meshio for more info on this subject.
  2. Since you have to use opencascade to be able to make unions of 3D geometries, a lot of the interfacing in pygmsh does not really work. For 3D geometries, I usually use a combination of the Gmsh GUI and pygmsh to script physical labels.

For 2D meshing you can simply replace “tetra” with “triangle”.