Summary of mesh information

Hello,

I apologise for asking what is probably an FAQ, but here goes:

In my readings on fenicsx, including this forum, I have seen a one-line command that prints a summary of a mesh. That is, it produces a list containing the number of nodes, the number of triangles, tets, quads, hexas, as well as other summary information.

My problem is that I cannot remember the command and nor can I find it anywhere.

If someone could point this out to me, I would be most grateful.

Thank you very much,

Peter.

Within DOLFINx itself, there is no such command. You can get the number of cells, and the cell_type with:

print(mesh.topology.index_map(mesh.topology.dim).size_global, mesh.topology.cell_type)

Getting information about sub entities, such as facets (triangles in 2D), you change the input to index_map.
Getting the number of nodes in the mesh,

print(mesh.geometry.index_map().size_global)

Thanks for that Jorgen,

I think I must have got confused with the poly_data command in pyvista or something similar.

Regards,

Peter.