Evaluation of cell sizes

Consider:

import dolfinx
from mpi4py import MPI

mesh = dolfinx.UnitSquareMesh(MPI.COMM_WORLD, 10, 5)
tdim = mesh.topology.dim
num_cells = mesh.topology.index_map(tdim).size_local
h = dolfinx.cpp.mesh.h(mesh, tdim, range(num_cells))
print(h)

This code is a simplified version of dolfinx/test_mesh.py at 1087856ac3594a1c3c7d99c27a26e65f98da1fa2 · FEniCS/dolfinx · GitHub

3 Likes