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.nn";

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

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

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

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

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


 28:   VecView(global,PETSC_VIEWER_DRAW_WORLD);


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