I’m using vtkMeshQuality to evaluate the quality of my meshes. I noticed that some metrics (e.g., Aspect Ratio) are only valid for certain element types, while this can be defined for any element type in practice. For other cell types, the values are not computed or don’t make sense.
Is there a recommended way to obtain a unified quality measure across different element types? For example, something that works consistently for triangles, quads, tets, and hexes, rather than having to pick a separate metric per cell type.
If there’s no built-in unified metric, is there a common practice in VTK to normalize or combine these metrics so that mesh quality can be compared across mixed-element meshes?
There is not a built-in unified definition, largely because it is not easy to provide a consistent definition for many shapes. You mentioned aspect ratio, but there is not an agreed-upon definition for hexahedral cells. If you have ideas for how to do that, it is probably something you could publish. The other area largely not covered by Verdict (the library used by VTK to compute cell quality) is higher-order elements. Generally, curved elements present problems because it can be hard to detect degeneracies in their mappings from reference element to world coordinates because the Jacobian is not constant and certifying it is positive definite everywhere inside a volume or area is very expensive.
Different simulation codes place different demands on their input meshes, so most uses of this filter are by people testing a set of qualities specific to the solver they will be using.
I don’t know about vtkMeshQuality, but if using vtkCellQuality instead, there are two quality measures, “shape” and “scaled jacobian”, which appear to be the most general. These both work for triangle, quad, tetra, hex, pyramid, and wedge cells. (AFAIK vtkMeshQuality and vtkCellQuality both use the same Verdict library, and so this may also be true for vtkMeshQuality).
PyVista has a wrapper around vtkCellQuality, and has a nice table to show which qualities are valid for various cell types, which may be of use: