# Determinant of jacobian matrix

I am using an FEM code written in Fortran which I did not design. For a particular problem, the program complains that the determinant of the Jacobian matrix is inferior to zero.

I vaguely understand that the Jacobian matrix is related to the shape functions and that it must be inverted to map shape function coordinates to global coordinates. To invert the matrix it must compute the determinant. Therefore I suspect this is a mesh problem.

Could someone provide added insight into this? What conditions in an FE problem would typically lead to a Jacobian determinant that is less than zero? Why is this a problem? How can it be avoided?

• to follow up on @HBR's answer below - you should double check that the element node ordering associated with the mesh that you input into the model matches what the basis functions expect. An incorrect ordering of the element nodes would cause issues related to the Jacobian and determinant. – cbcoutinho Sep 7 '17 at 8:13
• Since this error occurs only for a particular problem, it is likely the mesher that created the mesh produced one or more "bad" elements. A bad element would be one where the coordinates of the nodes don't define a solid with a positive volume; that is what a negative jacobian means in this context. – Bill Greene Sep 7 '17 at 10:51
• I don't think I understand what the error message means -- what does it mean for the determinant to be "inferior to zero"? That it is negative? And is it the determinant of the cell matrix, or of the global matrix? – Wolfgang Bangerth Sep 11 '17 at 19:12

Imagine, for simplicity a two dimensional case in which the reference element is a triangle with vertices $V_1$, $V_2$ and $V_3$ (chosen counter-clockwise), and basis functions $1-\lambda-\mu$, $\lambda$ and $\mu$ respectively. The pair of reference coordinates will be defined such as: $F:(\lambda,\mu)\to(x, y)$ where $F=[x,y]^T=F(\lambda,\mu)$ and it is given by: $$F(\lambda,\mu) = V_1(1-\lambda-\mu)+V_2\lambda + V_3\mu$$
It is clear that the Jacobian is: $$J=\vec{\textrm{grad}}\,F=[V_2-V_1,V_3-V_1]$$
Note, that the determinant of this Jacobian coincides with two times the area of the triangle: $det(J) = (y_3-y_1)(x_2-x_1)-(x_3-x_1)(y_2-y_1)$.
On the contrary, if vertices are chosen in a clockwise fashion, the Jacobian turns to: $$\vec{\textrm{grad}}\,F=[V_3-V_1,V_2-V_1]$$ interchanging its columns resulting in a negative determinant.