Actual source code: ex9.c
petsc-3.6.1 2015-08-06
1: static char help[] = "Example for PetscOptionsInsertFileYAML\n";
2: #include <petscsys.h>
3: #include <petscviewer.h>
7: int main(int argc,char **argv)
8: {
9: PetscErrorCode ierr;
10: char filename[PETSC_MAX_PATH_LEN];
11: PetscBool flg;
13: PetscInitialize(&argc,&argv,(char*)0,help);
14: PetscOptionsGetString(NULL,"-f",filename,sizeof filename,&flg);
15: if (flg) {
16: PetscOptionsInsertFileYAML(PETSC_COMM_WORLD,filename,PETSC_TRUE);
17: }
18: PetscOptionsView(PETSC_VIEWER_STDOUT_WORLD);
19: PetscFinalize();
20: return(0);
21: }