Actual source code: ex28.c


  2: static char help[] ="Loads a previously saved TS.";

  4: /*
  5:    It loads a TS saved with TSView()

  7: */
  8: /*
  9:     Include "petscts.h" to use the PETSc timestepping routines. Note that
 10:     this file automatically includes "petscsys.h" and other lower-level
 11:     PETSc include files.
 12: */
 13: #include <petscts.h>


 16: int main(int argc,char **argv)
 17: {
 18:   TS             ts;                 /* timestepping context */
 20:   PetscViewer    viewer;

 22:   PetscInitialize(&argc,&argv,NULL,help);if (ierr) return ierr;
 23:   PetscDLLibraryAppend(PETSC_COMM_WORLD,&PetscDLLibrariesLoaded,"advection-diffusion-reaction/ex1");
 24:   TSCreate(PETSC_COMM_WORLD,&ts);
 25:   PetscViewerBinaryOpen(PETSC_COMM_WORLD,"advection-diffusion-reaction/binaryoutput",FILE_MODE_READ,&viewer);
 26:   TSLoad(ts,viewer);
 27:   PetscViewerDestroy(&viewer);
 28:   /* PetscFPTView(0); */
 29:   TSSetFromOptions(ts);
 30:   TSSetUp(ts);
 31:   TSView(ts,PETSC_VIEWER_STDOUT_WORLD);
 32:   TSSolve(ts,NULL);
 33:   TSDestroy(&ts);
 34:   PetscFinalize();
 35:   return ierr;
 36: }