# Calculate Jacobian of triangular element given coordinates of vertices and displacements?

I am trying to determine quality of my mesh elements using the Jacobian determinant as the measure. My algorithm takes vertices of nodes in triangular mesh and moves them around so as to form distorted triangles. Let us assume my vertex P(x,y,z) moves to P'(x',y',z') How to calculate the resulting change in mesh quality? One way to do this is to calculate jacobian of every triangle in mesh, but I cannot understand how to calculate the partial derivatives given only the displacement of nodes.

All the existing literature on Jacobian calculation seem to use a function to do so. Can anyone explain in simple terms?

• Before thinking in an answer, I would like to ask a couple of things. Are your elements linear (how many nodes they have)? Is your problem nonlinear? – nicoguaro Sep 20 '16 at 3:00
• My elements are linear. I am working on triangular mesh with ~1000 vertices. Right now, I only displace the nodes so it is safe to assume that the problem is linear. – Vidhi Sep 20 '16 at 6:14

You can define multiple measures for the quality of your mesh. For example, gmsh uses a criterion that measure the element shape. It is based on the element radii ratio, i.e., ratio between the inscribed and circumscribed circles (See reference 1). I think that you can use the Jacobian to describe the quality of elements as well, although you might want to check reference 2.

Regarding the Jacobian, the first thing to mention is that is a function of the element coordinates in higher order elements. Then, for those elements you would need to compute a figure o merit per element, e.g., the average of the determinant or the maybe the norm. In the case of linear elements you will have a transformation like the one described in the following image

For this simple case the transformation is given by $$\begin{pmatrix}x\\ y \end{pmatrix} = \mathbf{T}\begin{pmatrix}r\\ s \end{pmatrix} \equiv [J]\begin{pmatrix}r\\ s \end{pmatrix} + \begin{pmatrix}x_A\\ y_A \end{pmatrix} \enspace ,$$ with $$[J] = \begin{bmatrix} x_B - x_A &x_C - x_A\\ y_B - y_A &y_C - y_A \end{bmatrix} \enspace ,$$ and $\det J = (x_B - x_A)(y_C - y_A) - (x_C - x_A)(y_B - y_A)$. That is the simplest way to think about the transformation, and you can just find it solving a linear system of equations, and it just depends on the position of your nodes.

For your problem you would like to compute the Jacobian then apply the displacement to each node, and compute it one more time.

References

1. Geuzaine, Christophe, and Jean‐François Remacle. "Gmsh: A 3‐D finite element mesh generator with built‐in pre‐and post‐processing facilities." International Journal for Numerical Methods in Engineering 79.11 (2009): 1309-1331.
2. Pébay, Philippe, and Timothy Baker. "Analysis of triangle quality measures." Mathematics of Computation 72.244 (2003): 1817-1839.
• Thanks nicoguaro. The J matrix you define, can it be used to determine the quality of the triangle? The determinant of J needs to be positive for a triangular element in mesh to be valid. I was wondering if this holds for your definition of J. Cool references. I checked Philippe's paper before but for some reason I need to add Jacobians in my quality analysis along with the metrics described in paper. – Vidhi Sep 20 '16 at 19:03
• @Vidhi, I think so. Ideally you would like a determinant of 1, and you definitely don't want it to be too big or too small. The expression I wrote for $J$ should give the same values than using the the derivatives of the interpolation functions, it's just simpler this way for linear elements. But there are other ways of writing it. – nicoguaro Sep 20 '16 at 20:06
• Thanks! I will accept your answer. But I am open to more ways of calculating Jacobian if anyone want to contribute. – Vidhi Sep 20 '16 at 22:56