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>
15: int main(int argc,char **argv)
16: {
17: TS ts; /* timestepping context */
18: PetscViewer viewer;
20: PetscInitialize(&argc,&argv,NULL,help);
21: PetscDLLibraryAppend(PETSC_COMM_WORLD,&PetscDLLibrariesLoaded,"advection-diffusion-reaction/ex1");
22: TSCreate(PETSC_COMM_WORLD,&ts);
23: PetscViewerBinaryOpen(PETSC_COMM_WORLD,"advection-diffusion-reaction/binaryoutput",FILE_MODE_READ,&viewer);
24: TSLoad(ts,viewer);
25: PetscViewerDestroy(&viewer);
26: /* PetscFPTView(0); */
27: TSSetFromOptions(ts);
28: TSSetUp(ts);
29: TSView(ts,PETSC_VIEWER_STDOUT_WORLD);
30: TSSolve(ts,NULL);
31: TSDestroy(&ts);
32: PetscFinalize();
33: return 0;
34: }