The criterion Quality is calculated differently for different element types.
Tri and Tetra
The quality is calculated as the minimum ratio of height to base length of each side (normalized to 1).
Quad
The quality is calculated as the Determinant, as described in Determinant (2x2x2 stencil).
Hexa
The quality is a weighted diagnostic between Determinant (between -1 and 1), Max Orthogls (normalized between -1 and 1; if deviation from orthogonality is greater than 90 degrees, then the normalized value will be smaller than 0) and Max Warpgls (normalized between 0 and 1; warpage of 0 degrees is 1, warpage of 180 degrees is 0). The minimum of the 3 normalized diagnostics will be used.
Pyramid
The quality is calculated as the determinant.
Prism
The quality is calculated as the minimum of the Determinant and Warpage. Warpage is normalized to a factor between 0 and 1, where 90 degrees is 0, and 0 degrees is 1.