VTK-m  2.0
worklet/CellSetConnectivity.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_worklet_connectivity_CellSetConnectivity_h
11 #define vtk_m_worklet_connectivity_CellSetConnectivity_h
12 
15 
16 namespace vtkm
17 {
18 namespace worklet
19 {
20 namespace connectivity
21 {
22 
24 {
25 public:
26  static void Run(const vtkm::cont::UnknownCellSet& cellSet,
27  vtkm::cont::ArrayHandle<vtkm::Id>& componentArray)
28  {
29  vtkm::cont::ArrayHandle<vtkm::Id> numIndicesArray;
30  vtkm::cont::ArrayHandle<vtkm::Id> indexOffsetsArray;
31  vtkm::cont::ArrayHandle<vtkm::Id> connectivityArray;
32 
33  // create cell to cell connectivity graph (dual graph)
34  CellSetDualGraph::Run(cellSet, numIndicesArray, indexOffsetsArray, connectivityArray);
35  // find the connected component of the dual graph
36  GraphConnectivity::Run(numIndicesArray, indexOffsetsArray, connectivityArray, componentArray);
37  }
38 };
39 }
40 }
41 } // vtkm::worklet::connectivity
42 
43 #endif // vtk_m_worklet_connectivity_CellSetConnectivity_h
vtkm::worklet::connectivity::CellSetConnectivity
Definition: worklet/CellSetConnectivity.h:23
vtkm::cont::ArrayHandle< vtkm::Id >
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::worklet::connectivity::CellSetConnectivity::Run
static void Run(const vtkm::cont::UnknownCellSet &cellSet, vtkm::cont::ArrayHandle< vtkm::Id > &componentArray)
Definition: worklet/CellSetConnectivity.h:26
vtkm::cont::UnknownCellSet
A CellSet of an unknown type.
Definition: UnknownCellSet.h:48
vtkm::worklet::connectivity::CellSetDualGraph::Run
static void Run(const vtkm::cont::UnknownCellSet &cellSet, vtkm::cont::ArrayHandle< vtkm::Id > &numIndicesArray, vtkm::cont::ArrayHandle< vtkm::Id > &indexOffsetArray, vtkm::cont::ArrayHandle< vtkm::Id > &connectivityArray)
Definition: CellSetDualGraph.h:126
GraphConnectivity.h
vtkm::worklet::connectivity::GraphConnectivity::Run
static void Run(const InputArrayType &numIndicesArray, const InputArrayType &indexOffsetsArray, const InputArrayType &connectivityArray, OutputArrayType &componentsOut)
Definition: GraphConnectivity.h:72
CellSetDualGraph.h