diff --git a/docs/changelog/external-face-miss-pair.md b/docs/changelog/external-face-miss-pair.md new file mode 100644 index 000000000..75b5bd8c0 --- /dev/null +++ b/docs/changelog/external-face-miss-pair.md @@ -0,0 +1,8 @@ +# Fixed error in checking paired faces in ExternalFaces filter + +The `ExternalFaces` filter uses hash codes to find duplicate (i.e. +internal) faces. The issue with hash codes is that you have to deal with +unique entries that have identical hashes. The worklet to count how many +unique, unmatched faces were associated with each hash code was correct. +However, the code to then grab the ith unique face in a hash was wrong. +This has been fixed. diff --git a/vtkm/filter/entity_extraction/worklet/ExternalFaces.h b/vtkm/filter/entity_extraction/worklet/ExternalFaces.h index dbb891027..f89b2e2ea 100644 --- a/vtkm/filter/entity_extraction/worklet/ExternalFaces.h +++ b/vtkm/filter/entity_extraction/worklet/ExternalFaces.h @@ -452,8 +452,12 @@ private: cellSet.GetIndices(originCells[myIndex]), myFace); bool foundPair = false; - for (vtkm::IdComponent otherIndex = myIndex + 1; otherIndex < numCellsOnHash; otherIndex++) + for (vtkm::IdComponent otherIndex = 0; otherIndex < numCellsOnHash; otherIndex++) { + if (otherIndex == myIndex) + { + continue; + } vtkm::Id3 otherFace; vtkm::exec::CellFaceCanonicalId(originFaces[otherIndex], cellSet.GetCellShape(originCells[otherIndex]),