Alot of these functions only make sense on linear (straight edged) meshes.
As DOLFINx supports higher order geometries, many of these functions are not simple or even well defined to compute.
Thank you @dokken for your fast answer and your good advice !
By curiosity, I remember, I hope well, that the determinant of the Jacobian matrix was related to the volume of a cell. Is there a way to use this trick ?
The Jacobian of the determinant relates to the volume of the cell. For affine cells, the determinant of the jacobian is constant, and thus you can compute it at any point in a cell to get the volume. However, for non-affine cells, the determinant is not constant.
Thus for simple (affine) problems, you can do:
import dolfinx
from mpi4py import MPI
import ufl
import numpy as np
mesh = dolfinx.mesh.create_unit_square(MPI.COMM_WORLD, 5, 5)
V = dolfinx.fem.functionspace(mesh, ("DG", 0))
u = dolfinx.fem.Function(V)
detJ = abs(ufl.JacobianDeterminant(mesh)*ufl.classes.ReferenceCellVolume(mesh))
expr = dolfinx.fem.Expression(detJ, V.element.interpolation_points())
u.interpolate(expr)
print(u.x.array)
print(sum(u.x.array))