I am using python API of Gmsh to generate a mesh for a rectangular domain. I am really new at this. My code looks like this,
import sys
import gmsh
gmsh.initialize()
gmsh.model.add("t1")
lc = 1e-1
gmsh.model.geo.addPoint(-1, 0, 0, lc, 1)
gmsh.model.geo.addPoint(1, 0, 0, lc, 2)
gmsh.model.geo.addPoint(1, 1, 0, lc, 3)
gmsh.model.geo.addPoint(-1, 1, 0, lc, 4)
gmsh.model.geo.addLine(1, 2, 1)
gmsh.model.geo.addLine(3, 2, 2)
gmsh.model.geo.addLine(3, 4, 3)
gmsh.model.geo.addLine(4, 1, 4)
gmsh.model.geo.addCurveLoop([4, 1, -2, 3], 1)
gmsh.model.geo.addPlaneSurface([1], 1)
gmsh.model.geo.synchronize()
gmsh.model.addPhysicalGroup(1, [1, 2, 4], 5)
gmsh.model.addPhysicalGroup(2, [1], name = "My surface")
gmsh.model.mesh.generate(2)
gmsh.write("t1.msh")
if '-nopopup' not in sys.argv:
gmsh.fltk.run()
gmsh.finalize()
I want to impose a mesh regularity condition, that the lines joining the cell centres must be orthogonal to the edges. I cannot find how to do that, any reference or solution would be of help.
Thank you in advance.
Edit: I am primarily interested in triangular meshes and I use the centroids of the mesh elements as cell centres.