Problem with the determinant of the Jacobian

You are choosing to project the jacobian, a cellwise constant into a first order continuous Lagrange space. This space has degrees of freedom at each vertex, and you introduce a numerical error when trying to approximate a discontinuous function with a continuous basis.

If you use Q = FunctionSpace(mesh, "DG", 0) you should Get the two values you are expecting.

This was the function space chosen in the original post.

1 Like