Actual source code: ex66.c

petsc-3.6.1 2015-08-06
Report Typos and Errors
  2: static char help[] = "Reads in rectangular matrix from disk, stored from ex65.c\n\n";

  4: #include <petscmat.h>

  8: int main(int argc,char **args)
  9: {
 11:   Mat            A;
 12:   PetscViewer    fd;

 14:   PetscInitialize(&argc,&args,(char*)0,help);

 16:   /* Read matrix and RHS */
 17:   PetscViewerBinaryOpen(PETSC_COMM_WORLD,"rect",FILE_MODE_READ,&fd);
 18:   MatCreate(PETSC_COMM_WORLD,&A);
 19:   MatSetType(A,MATSEQAIJ);
 20:   MatLoad(A,fd);
 21:   PetscViewerDestroy(&fd);

 23:   /* Free data structures */
 24:   MatDestroy(&A);

 26:   PetscFinalize();
 27:   return 0;
 28: }