Actual source code: ex9.c

petsc-3.7.3 2016-08-01
Report Typos and Errors
  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,NULL,"-f",filename,sizeof filename,&flg);
 15:   if (flg) {
 16:     PetscOptionsInsertFileYAML(PETSC_COMM_WORLD,filename,PETSC_TRUE);
 17:   }
 18:   PetscOptionsView(PETSC_NULL,PETSC_VIEWER_STDOUT_WORLD);
 19:   PetscFinalize();
 20:   return(0);
 21: }