Dear all,
I am trying to get the correct number of cells, vertices, and edges in a 2D mesh, but I am getting weird answers.
Take for instance this code:
import dolfin
import mshr
# set a domain
rect = mshr.Rectangle(dolfin.Point(0.0, 0.0), dolfin.Point(1.0, 1.0))
# mesh it
m = mshr.generate_mesh(rect, 2)
# dump mesh
dolfin.File("/Users/sensei/Downloads/a.pvd") << m
# get information
ncells = [ m.num_vertices(), m.num_edges(), m.num_faces(), m.num_facets(), m.num_cells() ]
print(ncells)
You can see the mesh in the attached image. The problem is the output:
[9, 0, 8, 0, 8]
I expected to find 9 vertices, 16 edges, and 8 cells.
Am I missing something obvious?
Thanks!