Refactor CellSetExplicit to remove NumIndices
VTK is in the process of refactoring vtkCellArray
to move away from the existing design towards one that supports random access by introducing an offsets array:
// Current VTK:
Conn = { 3, x, x, x, 2, x, x, 4, x, x, x, x, 3, x, x, x }
// New VTK:
Offsets = { 0, 3, 5, 9, 12 }
Conn = { x, x, x, x, x, x, x, x, x, x, x, x }
This differs from the VTK-m CellSetExplicit
storage, in that we store (numCells+1) offsets and do not have a NumIndices
array.
We should change CellSetExplicit
to match the new VTK layout to unify them and simplify zero copy. This will greatly reduce memory consumption and improve cache usage at the cost of an integer subtraction per cell access.
// Current VTK-m:
Offsets = { 0, 3, 5, 9 }
NumIndices = { 3, 2, 4, 3 }
// New VTK-m
Offsets = { 0, 3, 5, 9, 12 }
(Connectivity and type arrays do not change)
Edited by Allison Vacanti