static char help[] = "Creates a matrix, inserts some values, and tests MatGetSubMatrices() and MatZeroEntries().\n\n"; #include "petscmat.h" #undef __FUNCT__ #define __FUNCT__ "main" int main(int argc,char **argv) { Mat mat,submat,*submatrices; PetscInt m = 10,n = 10,i = 4,tmp; PetscErrorCode ierr; IS irkeep,ickeep; PetscScalar value = 1.0; PetscViewer sviewer; PetscInitialize(&argc,&argv,(char *)0,help); ierr = PetscViewerSetFormat(PETSC_VIEWER_STDOUT_WORLD,PETSC_VIEWER_ASCII_COMMON);CHKERRQ(ierr); ierr = PetscViewerSetFormat(PETSC_VIEWER_STDOUT_SELF,PETSC_VIEWER_ASCII_COMMON);CHKERRQ(ierr); ierr = MatCreate(PETSC_COMM_WORLD,&mat);CHKERRQ(ierr); ierr = MatSetSizes(mat,PETSC_DECIDE,PETSC_DECIDE,m,n);CHKERRQ(ierr); ierr = MatSetFromOptions(mat);CHKERRQ(ierr); for (i=0; i