Actual source code: ex13.c

  1: /*$Id: ex13.c,v 1.15 2001/04/10 19:37:27 bsmith Exp $*/

  3: static char help[] = "Tests loading DA vector from file.\n\n";

 5:  #include petscda.h
 6:  #include petscsys.h

 10: int main(int argc,char **argv)
 11: {
 12:   int         ierr,M = PETSC_DECIDE,N = PETSC_DECIDE;
 13:   DA          da;
 14:   Vec         global;
 15:   PetscViewer bviewer;

 17:   PetscInitialize(&argc,&argv,(char*)0,help);

 19:   /* Read options */
 20:   PetscOptionsGetInt(PETSC_NULL,"-M",&M,PETSC_NULL);
 21:   PetscOptionsGetInt(PETSC_NULL,"-N",&N,PETSC_NULL);

 23:   PetscViewerBinaryOpen(PETSC_COMM_WORLD,"daoutput",PETSC_BINARY_RDONLY,&bviewer);
 24:   DALoad(bviewer,M,N,PETSC_DECIDE,&da);
 25:   DACreateGlobalVector(da,&global);
 26:   VecLoadIntoVector(bviewer,global);
 27:   PetscViewerDestroy(bviewer);


 30:   VecView(global,PETSC_VIEWER_DRAW_WORLD);


 33:   /* Free memory */
 34:   VecDestroy(global);
 35:   DADestroy(da);
 36:   PetscFinalize();
 37:   return 0;
 38: }
 39: