Actual source code: ex19.c

petsc-3.12.5 2020-03-29
Report Typos and Errors

  2: static char help[] = "Illustrates creating an options database.\n\n";

  4: /*T
  5:    Concepts: introduction to PETSc;
  6:    Concepts: printing^in parallel
  7:    Processors: n
  8: T*/



 12:  #include <petscsys.h>
 13:  #include <petscviewer.h>
 14: int main(int argc,char **argv)
 15: {
 17:   PetscOptions   options;


 20:   PetscInitialize(&argc,&argv,(char*)0,help);if (ierr) return ierr;
 21:   PetscOptionsCreate(&options);
 22:   PetscOptionsInsert(options,&argc,&argv,"optionsfile");
 23:   PetscOptionsInsertString(options,"-option1 value1 -option2 -option3 value3");
 24:   PetscOptionsView(options,PETSC_VIEWER_STDOUT_WORLD);
 25:   PetscOptionsDestroy(&options);

 27:   PetscFinalize();
 28:   return ierr;
 29: }


 32: /*TEST

 34:    test:
 35:      localrunfiles: optionsfile
 36:      filter: egrep -v "(malloc|nox|display|saws_port|vecscatter|options_left|check_pointer_intensity|cuda_initialize|error_output_stdout)"

 38: TEST*/