diff --git a/vtkm/cont/CellSetExplicit.h b/vtkm/cont/CellSetExplicit.h index e2fbc19f9..ce627236b 100644 --- a/vtkm/cont/CellSetExplicit.h +++ b/vtkm/cont/CellSetExplicit.h @@ -280,7 +280,9 @@ public: vtkm::TopologyElementTagPoint) { if (this->CellToPoint.ElementsValid) + { return; + } std::multimap cells_of_nodes; @@ -348,22 +350,36 @@ public: this->CellToPoint.PrintSummary(out); } + template VTKM_CONT_EXPORT const vtkm::cont::ArrayHandle & - GetShapesArray() const { return this->PointToCell.Shapes; } + GetShapesArray(FromTopology,ToTopology) const + { + return this->GetConnectivity(FromTopology(), ToTopology()).Shapes; + } + template VTKM_CONT_EXPORT const vtkm::cont::ArrayHandle & - GetNumIndicesArray() const { return this->PointToCell.NumIndices; } + GetNumIndicesArray(FromTopology,ToTopology) const + { + return this->GetConnectivity(FromTopology(), ToTopology()).NumIndices; + } + template VTKM_CONT_EXPORT const vtkm::cont::ArrayHandle & - GetConnectivityArray() const { return this->PointToCell.Connectivity; } + GetConnectivityArray(FromTopology,ToTopology) const + { + return this->GetConnectivity(FromTopology(), ToTopology()).Connectivity; + } + template VTKM_CONT_EXPORT const vtkm::cont::ArrayHandle & - GetIndexOffsetArray() const { - return this->PointToCell.IndexOffsets; + GetIndexOffsetArray(FromTopology,ToTopology) const + { + return this->GetConnectivity(FromTopology(), ToTopology()).IndexOffsets; } private: diff --git a/vtkm/worklet/testing/UnitTestClipping.cxx b/vtkm/worklet/testing/UnitTestClipping.cxx index ba5c3535f..1d570d4ad 100644 --- a/vtkm/worklet/testing/UnitTestClipping.cxx +++ b/vtkm/worklet/testing/UnitTestClipping.cxx @@ -144,7 +144,9 @@ void TestClippingExplicit() vtkm::Float32 expectedScalars[] = { 1, 2, 1, 0, 0.5, 0.5, 0.5 }; VTKM_TEST_ASSERT( - TestArrayHandle(outputCellSet.GetConnectivityArray(), expectedConnectivity, + TestArrayHandle(outputCellSet.GetConnectivityArray( + vtkm::TopologyElementTagPoint(),vtkm::TopologyElementTagCell()), + expectedConnectivity, connectivitySize), "Got incorrect conectivity"); @@ -189,7 +191,9 @@ void TestClippingStrucutred() vtkm::Float32 expectedScalars[] = { 1, 1, 1, 1, 0, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5 }; VTKM_TEST_ASSERT( - TestArrayHandle(outputCellSet.GetConnectivityArray(), expectedConnectivity, + TestArrayHandle(outputCellSet.GetConnectivityArray( + vtkm::TopologyElementTagPoint(),vtkm::TopologyElementTagCell()), + expectedConnectivity, connectivitySize), "Got incorrect conectivity"); diff --git a/vtkm/worklet/testing/UnitTestExternalFaces.cxx b/vtkm/worklet/testing/UnitTestExternalFaces.cxx index 60a5c3d69..ce402004e 100644 --- a/vtkm/worklet/testing/UnitTestExternalFaces.cxx +++ b/vtkm/worklet/testing/UnitTestExternalFaces.cxx @@ -32,9 +32,12 @@ vtkm::cont::DataSet RunExternalFaces(vtkm::cont::DataSet &ds) vtkm::cont::CellSetExplicit<> &cellset = ds.GetCellSet(0).CastTo >(); - vtkm::cont::ArrayHandle shapes = cellset.GetShapesArray(); - vtkm::cont::ArrayHandle numIndices = cellset.GetNumIndicesArray(); - vtkm::cont::ArrayHandle conn = cellset.GetConnectivityArray(); + vtkm::cont::ArrayHandle shapes = cellset.GetShapesArray( + vtkm::TopologyElementTagPoint(),vtkm::TopologyElementTagCell()); + vtkm::cont::ArrayHandle numIndices = cellset.GetNumIndicesArray( + vtkm::TopologyElementTagPoint(),vtkm::TopologyElementTagCell()); + vtkm::cont::ArrayHandle conn = cellset.GetConnectivityArray( + vtkm::TopologyElementTagPoint(),vtkm::TopologyElementTagCell()); vtkm::cont::ArrayHandle output_shapes; vtkm::cont::ArrayHandle output_numIndices; diff --git a/vtkm/worklet/testing/UnitTestVertexClustering.cxx b/vtkm/worklet/testing/UnitTestVertexClustering.cxx index 99112818b..abdc157f2 100644 --- a/vtkm/worklet/testing/UnitTestVertexClustering.cxx +++ b/vtkm/worklet/testing/UnitTestVertexClustering.cxx @@ -61,8 +61,8 @@ vtkm::cont::DataSet RunVertexClustering(vtkm::cont::DataSet &dataSet, dataSet.GetCellSet(0).CastTo >(); vtkm::cont::ArrayHandle pointArray = dataSet.GetCoordinateSystem("coordinates").GetData().CastToArrayHandle(); - vtkm::cont::ArrayHandle pointIdArray = cellSet.GetConnectivityArray(); - vtkm::cont::ArrayHandle indexOffsetArray = cellSet.GetIndexOffsetArray(); + vtkm::cont::ArrayHandle pointIdArray = cellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(),vtkm::TopologyElementTagCell()); + vtkm::cont::ArrayHandle indexOffsetArray = cellSet.GetIndexOffsetArray(vtkm::TopologyElementTagPoint(),vtkm::TopologyElementTagCell()); vtkm::cont::ArrayHandle output_pointArray ; vtkm::cont::ArrayHandle output_pointId3Array ; @@ -141,11 +141,11 @@ void TestVertexClustering() vtkm::cont::CellSetExplicit<> &cellSet = outDataSet.GetCellSet(0).CastTo >(); VTKM_TEST_ASSERT( - cellSet.GetConnectivityArray().GetNumberOfValues() == output_pointIds, + cellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(),vtkm::TopologyElementTagCell()).GetNumberOfValues() == output_pointIds, "Number of connectivity array elements mismatch"); - for (vtkm::Id i=0; i