mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Merge topic 'fix-clip-centroid-points' into release-2.1
bda2d3d8e Clip: remap centroid interpolation points to used-only point Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Abhishek Yenpure <abhi.yenpure@kitware.com> Merge-request: !3133
This commit is contained in:
commit
1e3cd818fb
@ -684,6 +684,31 @@ public:
|
|||||||
pointsOnlyConnectivity);
|
pointsOnlyConnectivity);
|
||||||
|
|
||||||
pointsOnlyConnectivityIndices.ReleaseResources();
|
pointsOnlyConnectivityIndices.ReleaseResources();
|
||||||
|
|
||||||
|
// We want to find the entries in `InCellInterpolationInfo` that point to exisiting points.
|
||||||
|
// `cellPointEdgeReverseConnectivity` map to entries that point to edges.
|
||||||
|
vtkm::cont::ArrayHandle<vtkm::UInt8> stencil;
|
||||||
|
stencil.AllocateAndFill(this->InCellInterpolationInfo.GetNumberOfValues(), 1);
|
||||||
|
auto edgeOnlyStencilEntries =
|
||||||
|
vtkm::cont::make_ArrayHandlePermutation(cellPointEdgeReverseConnectivity, stencil);
|
||||||
|
vtkm::cont::Algorithm::Fill(edgeOnlyStencilEntries, vtkm::UInt8{});
|
||||||
|
vtkm::cont::ArrayHandle<vtkm::Id> idxsToPoints;
|
||||||
|
vtkm::cont::Algorithm::CopyIf(
|
||||||
|
vtkm::cont::ArrayHandleIndex(this->InCellInterpolationInfo.GetNumberOfValues()),
|
||||||
|
stencil,
|
||||||
|
idxsToPoints);
|
||||||
|
stencil.ReleaseResources();
|
||||||
|
|
||||||
|
// Remap the point indices in `InCellInterpolationInfo`, to the used-only point indices
|
||||||
|
// computed above.
|
||||||
|
// This only works if the points needed for interpolating centroids are included in the
|
||||||
|
// `connectivity` array. This has been verified to be true for all cases in the clip tables.
|
||||||
|
auto inCellInterpolationInfoPointsOnly =
|
||||||
|
vtkm::cont::make_ArrayHandlePermutation(idxsToPoints, this->InCellInterpolationInfo);
|
||||||
|
invoke(vtkm::worklet::RemoveUnusedPoints::TransformPointIndices{},
|
||||||
|
inCellInterpolationInfoPointsOnly,
|
||||||
|
pointMapInputToOutput,
|
||||||
|
inCellInterpolationInfoPointsOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get unique EdgeInterpolation : unique edge points.
|
// Get unique EdgeInterpolation : unique edge points.
|
||||||
@ -701,6 +726,9 @@ public:
|
|||||||
EdgeInterpolation::LessThanOp());
|
EdgeInterpolation::LessThanOp());
|
||||||
edgeInterpolation.ReleaseResources();
|
edgeInterpolation.ReleaseResources();
|
||||||
|
|
||||||
|
// This only works if the edges in `cellPointEdgeInterpolation` also exist in
|
||||||
|
// `EdgePointsInterpolation`. This has been verified to be true for all cases in the clip
|
||||||
|
// tables.
|
||||||
vtkm::cont::ArrayHandle<vtkm::Id> cellInterpolationIndexToUnique;
|
vtkm::cont::ArrayHandle<vtkm::Id> cellInterpolationIndexToUnique;
|
||||||
vtkm::cont::Algorithm::LowerBounds(this->EdgePointsInterpolation,
|
vtkm::cont::Algorithm::LowerBounds(this->EdgePointsInterpolation,
|
||||||
cellPointEdgeInterpolation,
|
cellPointEdgeInterpolation,
|
||||||
|
Loading…
Reference in New Issue
Block a user