Commits

Jed Brown committed 1d9f6a8 Merge

Merge branch 'madams/dm-compitebug' into next

Fixes PCFieldSplit unable to match index sets when comparing ISGeneral
as though it was an ISStride.

* madams/dm-compitebug:
replaced ISCreateGeneral in CompositeDM with ISCreateStride. MatNest calls ISStrideGetInfo on these vectors, which was causing errors

Comments (0)

Files changed (1)

src/dm/impls/composite/pack.c

 PetscErrorCode  DMCompositeGetGlobalISs(DM dm,IS *is[])
 {
   PetscErrorCode         ierr;
-  PetscInt               cnt = 0,*idx,i;
+  PetscInt               cnt = 0;
   struct DMCompositeLink *next;
   PetscMPIInt            rank;
   DM_Composite           *com = (DM_Composite*)dm->data;
 
   /* loop over packed objects, handling one at at time */
   while (next) {
-    ierr = PetscMalloc(next->n*sizeof(PetscInt),&idx);CHKERRQ(ierr);
-    for (i=0; i<next->n; i++) idx[i] = next->grstart + i;
-    ierr = ISCreateGeneral(PetscObjectComm((PetscObject)dm),next->n,idx,PETSC_OWN_POINTER,&(*is)[cnt]);CHKERRQ(ierr);
+    ierr = ISCreateStride(PetscObjectComm((PetscObject)dm),next->n,next->grstart,1,&(*is)[cnt]);CHKERRQ(ierr);
     if (dm->fields) {
       MatNullSpace space;
       Mat          pmat;