Actual source code: ex47.c

petsc-3.13.6 2020-09-29
Report Typos and Errors
  1: static char help[] = "Example for PetscOptionsInsertFileYAML\n";


  4:  #include <petscsys.h>
  5:  #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);if (ierr) return ierr;
 14:   PetscOptionsGetString(NULL,NULL,"-f",filename,sizeof(filename),&flg);
 15:   if (flg) {
 16:     PetscOptionsInsertFileYAML(PETSC_COMM_WORLD,filename,PETSC_TRUE);
 17:   }
 18:   PetscOptionsView(NULL,PETSC_VIEWER_STDOUT_WORLD);
 19:   PetscFinalize();
 20:   return ierr;
 21: }



 25: /*TEST

 27:    build:
 28:       requires: yaml

 30:    test:
 31:       suffix: 1
 32:       requires: yaml
 33:       args: -f petsc.yml -options_left 0
 34:       filter:  egrep -v "(malloc_dump|malloc_test|saws_port_auto_select|display|check_pointer_intensity|error_output_stdout|nox)"
 35:       localrunfiles: petsc.yml

 37:    test:
 38:       suffix: 2
 39:       requires: yaml
 40:       args: -options_file_yaml petsc.yml -options_left 0
 41:       filter:  egrep -v "(malloc_dump|malloc_test|saws_port_auto_select|display|check_pointer_intensity|error_output_stdout|nox)"
 42:       localrunfiles: petsc.yml

 44: TEST*/