static char help[] = "Tests MatGetArray().\n\n"; #include "petscmat.h" #undef __FUNCT__ #define __FUNCT__ "main" int main(int argc,char **args) { Mat A; PetscInt i,j,m = 3,n = 2,rstart,rend; PetscErrorCode ierr; PetscScalar v,*array; PetscInitialize(&argc,&args,(char *)0,help); /* Create a parallel dense matrix shared by all processors */ ierr = MatCreateMPIDense(PETSC_COMM_WORLD,PETSC_DECIDE,PETSC_DECIDE,m,n,PETSC_NULL,&A); CHKERRQ(ierr); /* Set values into the matrix */ for (i=0; i