Actual source code: ex23.c
petsc-3.3-p7 2013-05-11
2: static char help[] = "Tests string options with spaces";
4: #include <petscsys.h>
8: int main(int argc,char **argv)
9: {
11: PetscBool ts_view = PETSC_FALSE;
12: PetscInt ts_max_steps = 0, snes_max_steps = 0;
13: PetscReal ts_final_time = 0.;
15: PetscInitialize(&argc,&argv,PETSC_NULL,help);
16: PetscOptionsGetBool(0,"-ts_view",&ts_view,PETSC_NULL);
17: PetscOptionsGetReal(0,"-ts_final_time",&ts_final_time,PETSC_NULL);
18: PetscOptionsGetInt(0,"-ts_max_steps",&ts_max_steps,PETSC_NULL);
19: PetscOptionsGetInt(0,"-snes_max_steps",&snes_max_steps,PETSC_NULL);
20: PetscPrintf(PETSC_COMM_WORLD,"-ts_view = %s\n-ts_final_time = %f\n-ts_max_steps = %i\n-snes_max_steps = %i\n",ts_view?"true":"false",ts_final_time,ts_max_steps,snes_max_steps);
21: PetscFinalize();
22: return 0;
23: }