ODE Integrators

Copy the three files ${PETSC_DIR}/src/ts/examples/tutorials/makefile, util2.c, and ex2.c  OR ex2f.F  and ex2f.h to your working directory 

Examine the code ex2.c OR ex2f.F 

Objective: Solve a simple ODE in parallel (and see details of the solver used)

Run with  mpiexec -np 2 ex2 (OR ex2f)  -ts_view -ts_max_steps 10   (sample output)

Objective: Change the method of solution at runtime

You can select a different ODE integrator using the option -ts_type <type> where type can be euler or crank-nicholson

Run with  mpiexec -np 2 ex2 (OR ex2f)  -ts_view -ts_max_steps 10 -ts_type crank-nicholson

Detailed discussion of  TS in the users manual