Commit f0a342e4 authored by Abhishek Yenpure's avatar Abhishek Yenpure

Adding fix for Clip failure

- Failure reported by Matt Larsen
  Bug : vtk/vtk-m#329
parent c4bf46ec
...@@ -394,7 +394,6 @@ public: ...@@ -394,7 +394,6 @@ public:
{ {
(void)shape; (void)shape;
vtkm::Id clipIndex = clipDataIndex; vtkm::Id clipIndex = clipDataIndex;
// Start index for the cells of this case. // Start index for the cells of this case.
vtkm::Id cellIndex = clipStats.NumberOfCells; vtkm::Id cellIndex = clipStats.NumberOfCells;
// Start index to store connevtivity of this case. // Start index to store connevtivity of this case.
...@@ -636,15 +635,13 @@ public: ...@@ -636,15 +635,13 @@ public:
vtkm::cont::ArrayHandle<vtkm::Id> cellPointReverseConnectivity; vtkm::cont::ArrayHandle<vtkm::Id> cellPointReverseConnectivity;
cellPointReverseConnectivity.Allocate(total.NumberOfInCellIndices); cellPointReverseConnectivity.Allocate(total.NumberOfInCellIndices);
vtkm::cont::ArrayHandle<vtkm::Id> cellPointInterpolationKeys;
cellPointInterpolationKeys.Allocate(total.NumberOfInCellInterpPoints);
vtkm::cont::ArrayHandle<vtkm::Id> cellPointInterpolationInfo;
cellPointInterpolationInfo.Allocate(total.NumberOfInCellInterpPoints);
vtkm::cont::ArrayHandle<vtkm::Id> cellPointEdgeReverseConnectivity; vtkm::cont::ArrayHandle<vtkm::Id> cellPointEdgeReverseConnectivity;
cellPointEdgeReverseConnectivity.Allocate(total.NumberOfInCellEdgeIndices); cellPointEdgeReverseConnectivity.Allocate(total.NumberOfInCellEdgeIndices);
vtkm::cont::ArrayHandle<EdgeInterpolation> cellPointEdgeInterpolation; vtkm::cont::ArrayHandle<EdgeInterpolation> cellPointEdgeInterpolation;
cellPointEdgeInterpolation.Allocate(total.NumberOfInCellEdgeIndices); cellPointEdgeInterpolation.Allocate(total.NumberOfInCellEdgeIndices);
this->InCellInterpolationKeys.Allocate(total.NumberOfInCellInterpPoints);
this->InCellInterpolationInfo.Allocate(total.NumberOfInCellInterpPoints);
this->CellMapOutputToInput.Allocate(total.NumberOfCells); this->CellMapOutputToInput.Allocate(total.NumberOfCells);
GenerateCellSet cellSetWorklet(value); GenerateCellSet cellSetWorklet(value);
...@@ -667,8 +664,7 @@ public: ...@@ -667,8 +664,7 @@ public:
// Get unique EdgeInterpolation : unique edge points. // Get unique EdgeInterpolation : unique edge points.
// LowerBound for edgeInterpolation : get index into new edge points array. // LowerBound for edgeInterpolation : get index into new edge points array.
// LowerBound for cellPoitnEdgeInterpolation : get index into new edge points array. // LowerBound for cellPointEdgeInterpolation : get index into new edge points array.
//vtkm::cont::ArrayHandle<clipping::EdgeInterpolation> uniqueEdgeInterpolations;
vtkm::cont::Algorithm::SortByKey( vtkm::cont::Algorithm::SortByKey(
edgeInterpolation, edgePointReverseConnectivity, EdgeInterpolation::LessThanOp()); edgeInterpolation, edgePointReverseConnectivity, EdgeInterpolation::LessThanOp());
vtkm::cont::Algorithm::Copy(edgeInterpolation, this->EdgePointsInterpolation); vtkm::cont::Algorithm::Copy(edgeInterpolation, this->EdgePointsInterpolation);
...@@ -697,9 +693,10 @@ public: ...@@ -697,9 +693,10 @@ public:
scatterEdgePointConnectivity); scatterEdgePointConnectivity);
scatterEdgeDispatcher.Invoke( scatterEdgeDispatcher.Invoke(
edgeInterpolationIndexToUnique, edgePointReverseConnectivity, connectivity); edgeInterpolationIndexToUnique, edgePointReverseConnectivity, connectivity);
scatterEdgeDispatcher.Invoke( scatterEdgeDispatcher.Invoke(cellInterpolationIndexToUnique,
cellInterpolationIndexToUnique, cellPointEdgeReverseConnectivity, cellPointInterpolationInfo); cellPointEdgeReverseConnectivity,
//Add offset in connectivity of all new in-cell points. this->InCellInterpolationInfo);
// Add offset in connectivity of all new in-cell points.
ScatterInCellConnectivity scatterInCellPointConnectivity(this->InCellPointsOffset); ScatterInCellConnectivity scatterInCellPointConnectivity(this->InCellPointsOffset);
vtkm::worklet::DispatcherMapField<ScatterInCellConnectivity> scatterInCellDispatcher( vtkm::worklet::DispatcherMapField<ScatterInCellConnectivity> scatterInCellDispatcher(
scatterInCellPointConnectivity); scatterInCellPointConnectivity);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment