Actual source code: ex23.c
petsc-3.8.4 2018-03-24
2: static char help[] = "Tests string options with spaces";
4: #include <petscsys.h>
6: int main(int argc,char **argv)
7: {
9: PetscBool ts_view = PETSC_FALSE;
10: PetscInt ts_max_steps = 0, snes_max_it = 0;
11: PetscReal ts_final_time = 0.;
13: PetscInitialize(&argc,&argv,NULL,help);
14: PetscOptionsGetBool(NULL,0,"-ts_view",&ts_view,NULL);
15: PetscOptionsGetReal(NULL,0,"-ts_final_time",&ts_final_time,NULL);
16: PetscOptionsGetInt(NULL,0,"-ts_max_steps",&ts_max_steps,NULL);
17: PetscOptionsGetInt(NULL,0,"-snes_max_it",&snes_max_it,NULL);
18: PetscPrintf(PETSC_COMM_WORLD,"-ts_view = %s\n-ts_final_time = %f\n-ts_max_steps = %i\n-snes_max_it = %i\n",ts_view ? "true" : "false",ts_final_time,ts_max_steps,snes_max_it);
19: PetscFinalize();
20: return ierr;
21: }
24: /*TEST
25:
26: test:
27: requires: yaml
28: args: -options_file_yaml ex23options
29: localrunfiles: ex23options
31: TEST*/