Correct the number of points in SplitSharpEdges filter

The cell set created in the `SplitSharpEdges` filter had the number of
points of the input, not the output. This inconsistency became worse now
that `DataSet` is doing more to check the consistency of point and cell
field lengths.
This commit is contained in:
Kenneth Moreland 2022-10-31 13:29:22 -06:00
parent ef3c4c65c9
commit aa56875122
2 changed files with 15 additions and 3 deletions

@ -475,7 +475,7 @@ public:
// Create the new cellset
CellDeepCopy::Run(oldCellset, newCellset);
CellDeepCopy::Run(oldCellset, newCellset, this->NewPointsIdArray.GetNumberOfValues());
// FIXME: Since the non const get array function is not in CellSetExplict.h,
// here I just get a non-const copy of the array handle.
auto connectivityArrayHandle = newCellset.GetConnectivityArray(vtkm::TopologyElementTagCell(),

@ -67,7 +67,8 @@ struct CellDeepCopy
typename OffsetsStorage>
VTKM_CONT static void Run(
const InCellSetType& inCellSet,
vtkm::cont::CellSetExplicit<ShapeStorage, ConnectivityStorage, OffsetsStorage>& outCellSet)
vtkm::cont::CellSetExplicit<ShapeStorage, ConnectivityStorage, OffsetsStorage>& outCellSet,
vtkm::Id numberOfPoints)
{
VTKM_IS_KNOWN_OR_UNKNOWN_CELL_SET(InCellSetType);
@ -89,10 +90,21 @@ struct CellDeepCopy
inCellSet, shapes, vtkm::cont::make_ArrayHandleGroupVecVariable(connectivity, offsets));
vtkm::cont::CellSetExplicit<ShapeStorage, ConnectivityStorage, OffsetsStorage> newCellSet;
newCellSet.Fill(inCellSet.GetNumberOfPoints(), shapes, connectivity, offsets);
newCellSet.Fill(numberOfPoints, shapes, connectivity, offsets);
outCellSet = newCellSet;
}
template <typename InCellSetType,
typename ShapeStorage,
typename ConnectivityStorage,
typename OffsetsStorage>
VTKM_CONT static void Run(
const InCellSetType& inCellSet,
vtkm::cont::CellSetExplicit<ShapeStorage, ConnectivityStorage, OffsetsStorage>& outCellSet)
{
Run(inCellSet, outCellSet, inCellSet.GetNumberOfPoints());
}
template <typename InCellSetType>
VTKM_CONT static vtkm::cont::CellSetExplicit<> Run(const InCellSetType& inCellSet)
{