Add a method to BoundaryState to get the 3D index
It is sometimes the case that a worklet is operating on a 3D array and needs to operate on the 3D IJK index. It is possible to take the input id (a vtkm::Id
) and convert it to a 3D index, but this takes extra arithmetic. Even when operating on structured 3D cells where VTK-m maintains a 3D index, it is a difficult hack to get to this index.
WorkletPointNeighborhood
is often being used in circumstances like this to do 3D scheduling and operate on 3D indexing even if not extending out into a "neighborhood". The Boundary
object (actually vtkm::exec::BoundaryState
) holds a reference to the 3D index. You can get to that 3D index by calling NeighborIndexToFullIndex({ 0, 0, 0 })
, but that is a bit of a hack (and potentially has three unnecessary additions). Instead, there should be a method to just get the full index held in the BoundaryState
object.