Add Mesh Quality and Cell Metrics
This branch contributes a working and tested prototype of a mesh quality filter that computes metrics over different 2D and 3D cells in an unstructured grid mesh. A different metric is user-specified for each cell type (e.g., tet, hex, triangle) in the mesh, and the underlying filter and worklet invoke metric functions over each cell. The filter outputs summary statistics for each metric/cell-type pair, consisting of frequency, mean, standard deviation, min, and max. Each set of summary statistics is written into the output data set (currently a VTK file) as a new field. Additionally, the computed metric values of all cells are output as a new field. If a cell type is not assigned a metric, then it is assigned an empty metric by default and its mesh quality will not be computed or included as a field in the output data set.
In this basic implementation, there are 4 tested cell metrics, each verified for correctness with a filter unit test. We have several (~15) other metrics either already implemented or in-progress. These will be merged upon successful passing of their unit tests. We would appreciate any feedback regarding the functionality/design as we proceed further.
Relevant files are as follows:
-
vtkm/filter/MeshQuality.h
,vtkm/filter/MeshQuality.hxx
(filter) -
vtkm/filter/testing/UnitTestMeshQualityFilter.cxx
(filter unit test) -
vtkm/worklet/MeshQuality.h
(worklet) -
examples/cell_metrics/CellMetrics.cxx
(example file to use MeshQuality filter, given an input VTK data set) -
vtkm/exec/cellmetrics
(directory with cell metric implementations; notevtkm/exec/CellMeasure.h
is also included as a supported metric under the metric nameVOLUME
)
The design of the mesh quality filter largely follows that of the VTK implementation:
- https://gitlab.kitware.com/vtk/vtk/tree/master/ThirdParty/verdict
- https://vtk.org/Wiki/VTK/mesh_quality
The ground-truth metric values hard-coded in the unit test file are obtained from the VisIt library and its set of equivalent mesh quality operators. While VisIt includes many of the metrics from the Verdict manual, there are still a few metrics left unsupported (at least via the GUI interface). We will obtain the ground-truth values of these unsupported metrics from the VTK implementations.
The mathematics and definitions of each cell metric are adapted as closely as possible from the Verdict Manual of mesh quality cell metrics:
This work is part of a milestone for the ECP project under the advisement of @hankchilds. Code development is completed by @blessley, @dloyd2, and Steven Walton.