Actual source code: ex9.c

petsc-master 2017-01-16
Report Typos and Errors
  1: static char help[] = "Example for PetscOptionsInsertFileYAML\n";

  3:  #include <petscsys.h>
  4:  #include <petscviewer.h>

  6: int main(int argc,char **argv)
  7: {
  8:   PetscErrorCode  ierr;
  9:   char            filename[PETSC_MAX_PATH_LEN];
 10:   PetscBool       flg;

 12:   PetscInitialize(&argc,&argv,(char*)0,help);if (ierr) return ierr;
 13:   PetscOptionsGetString(NULL,NULL,"-f",filename,sizeof(filename),&flg);
 14:   if (flg) {
 15:     PetscOptionsInsertFileYAML(PETSC_COMM_WORLD,filename,PETSC_TRUE);
 16:   }
 17:   PetscOptionsView(NULL,PETSC_VIEWER_STDOUT_WORLD);
 18:   PetscFinalize();
 19:   return ierr;
 20: }



 24: /*TEST

 26:    test:
 27:       suffix: 1
 28:       requires: yaml
 29:       args: -f petsc.yml
 30:       filter:  grep -v saws_port_auto_select
 31:       localrunfiles: petsc.yml

 33:    test:
 34:       suffix: 2
 35:       requires: yaml
 36:       filter:  grep -v saws_port_auto_select
 37:       args: -options_file_yaml petsc.yml
 38:       localrunfiles: petsc.yml

 40: TEST*/