Skip to content

Refactor mesh classes: switch from row/col/slice to vtkm::Id2/Id3

This merge request improves code quality for the contour tree algorithm. The original port from our prototype used row, column, and slice to reference to positions in the mesh instead of vtkm::Id2 (for 2D data)/vtkm::Id3 (for 3D data). This resulted in some confusion as to the correspondence of dimensions to row, column, slice and some difficult to track down errors when the data extents where non-square/non-cubic (i.e., when the extents were not the same along all directio58ns). This became particularly apparent when implementing a distributed parallel contour tree algorithm (merge requested to be submitted after this one).

To avoid these problems, we eliminated the use of row/column/slice completely and use vtkm::Id2 and vtkm::Id3 as appropriate for 2D/3D data. Furthermore, we eliminated some redundancies in mesh classes for the contour tree and performed some minor clean-up/refactoring. Finally, we added test cases with extents of 8x9 and 5x6x7 in the unit tests to catch problems like those that were present in the original implementation.

NOTE: Line 538 in vtkm/worklet/contourtree_augmented/ContourTreeMaker.h copies an array to avoid a compile error. I am not sure if/why this copy is necessary. Any advice would be appreciated.

Merge request reports

Loading