Commits

Matt Knepley committed ed189b0

Plex: Fix traversal bug in DMPlexLabelAddCells()

Comments (0)

Files changed (1)

src/dm/impls/plex/plexsubmesh.c

     ierr = PetscBTMemzero(numPoints, cellPoints);CHKERRQ(ierr);
     for (p = 0; p < numPoints; ++p) {
       PetscInt *closure = NULL;
-      PetscInt  closureSize, point, c, loc;
+      PetscInt  closureSize, c, loc;
 
-      if ((point < cStart) || (point >= cEnd)) continue;
+      if ((points[p] < cStart) || (points[p] >= cEnd)) continue;
       ierr = PetscBTSet(cellPoints, p);CHKERRQ(ierr);
       ierr = DMPlexGetTransitiveClosure(dm, points[p], PETSC_TRUE, &closureSize, &closure);CHKERRQ(ierr);
       for (c = 2; c < closureSize*2; c += 2) {