Python geometry: empty output file?
I'm playing with the Python interface for the first time and found that my initial translation of a disk mesh yields an (almost) empty msh file:
import gmsh
gmsh.initialize()
gmsh.model.add("test model")
lc = 0.1
p0 = gmsh.model.geo.addPoint(0.0, 0.0, 0.0, meshSize=lc)
p1 = gmsh.model.geo.addPoint(1.0, 0.0, 0.0, meshSize=lc)
p2 = gmsh.model.geo.addPoint(0.0, 1.0, 0.0, meshSize=lc)
p3 = gmsh.model.geo.addPoint(-1.0, 0.0, 0.0, meshSize=lc)
p4 = gmsh.model.geo.addPoint(0.0, -1.0, 0.0, meshSize=lc)
c0 = gmsh.model.geo.addCircleArc(p1, p0, p2)
c1 = gmsh.model.geo.addCircleArc(p2, p0, p3)
c2 = gmsh.model.geo.addCircleArc(p3, p0, p4)
c3 = gmsh.model.geo.addCircleArc(p4, p0, p1)
ll = gmsh.model.geo.addCurveLoop([c0, c1, c2, c3])
gmsh.model.geo.addPlaneSurface([ll])
gmsh.model.mesh.generate(2)
gmsh.write("out.msh")
gmsh.finalize()
What's wrong here?
Also: Is it possible to retrieve points and cells from gmsh directly without having to write out the file? Links are fine.
Edited by Nico Schlömer