Commits

Hong Zhang  committed c034947

bugfix of MatFDColoringApply_BAIJ

  • Participants
  • Parent commits b582cc9

Comments (0)

Files changed (1)

File src/mat/impls/baij/seq/baij.c

 {
   Mat_SeqBAIJ    *a = (Mat_SeqBAIJ*)A->data;
   PetscErrorCode ierr;
-  PetscInt       i,*collengths,*cia,*cja,n=a->nbs,m=a->mbs; //n = A->cmap->n,m = A->rmap->n;
+  PetscInt       i,*collengths,*cia,*cja,n=a->nbs,m=a->mbs; 
   PetscInt       nz = a->i[m],row,*jj,mr,col;
   PetscInt       *cspidx;
 
       ierr = VecGetArray(w2,&y);CHKERRQ(ierr);
       for (l=0; l<coloring->nrows[k]; l++) {
         row = bs*coloring->rows[k][l];                /* local row index */
-        col = i + bs*coloring->columnsforrow[k][l];       /* global column index */
+        col = i + bs*coloring->columnsforrow[k][l];   /* global column index */
         for (j=0; j<bs; j++) {
-          y[row+j] *= vscale_array[j+bs*vscaleforrow[k][l]];
+          y[row+j] *= vscale_array[col];
           srows[j]  = row + start + j;
         }
         ierr = MatSetValues(J,bs,srows,1,&col,y+row,INSERT_VALUES);CHKERRQ(ierr);