# vtkMeshQuality metrics only valid for certain elements

**URL:** <https://discourse.vtk.org/t/vtkmeshquality-metrics-only-valid-for-certain-elements/16029>\
**Category:** Development\
**Tags:** code\
**Created:** [September 11, 2025, 8:55am UTC](https://discourse.vtk.org/t/vtkmeshquality-metrics-only-valid-for-certain-elements/16029 "2025-09-11T08:55:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mhs\_goud](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mhs_goud/32/8898_2.png) [@Mhs\_goud](https://discourse.vtk.org/u/Mhs_goud)\
**Post date:** [September 11, 2025, 8:55am UTC](https://discourse.vtk.org/t/vtkmeshquality-metrics-only-valid-for-certain-elements/16029/1 "2025-09-11T08:55:28Z")

</div>

Hello,

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?

Thanks in advance for any guidance!

---

<div class="post-metadata">

**Author:** ![dcthomp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dcthomp/32/60_2.png) [@dcthomp](https://discourse.vtk.org/u/dcthomp)\
**Post date:** [September 12, 2025, 11:36am UTC](https://discourse.vtk.org/t/vtkmeshquality-metrics-only-valid-for-certain-elements/16029/2 "2025-09-12T11:36:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![user27182](https://discourse.vtk.org/user_avatar/discourse.vtk.org/user27182/32/10104_2.png) [@user27182](https://discourse.vtk.org/u/user27182)\
**Post date:** [September 12, 2025, 6:58pm UTC](https://discourse.vtk.org/t/vtkmeshquality-metrics-only-valid-for-certain-elements/16029/3 "2025-09-12T18:58:29Z")

</div>

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:

> **[pyvista.DataObjectFilters.cell\_quality](https://docs.pyvista.org/api/core/_autosummary/pyvista.dataobjectfilters.cell_quality)**
