Actual source code: ex19.c


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

  4: #include <petscsys.h>
  5: #include <petscviewer.h>
  6: int main(int argc, char **argv)
  7: {
  8:   PetscOptions options;

 11:   PetscInitialize(&argc, &argv, (char *)0, help);
 12:   PetscOptionsCreate(&options);
 13:   PetscOptionsInsert(options, &argc, &argv, "optionsfile");
 14:   PetscOptionsInsertString(options, "-option1 value1 -option2 -option3 value3");
 15:   PetscOptionsView(options, PETSC_VIEWER_STDOUT_WORLD);
 16:   PetscOptionsDestroy(&options);
 17:   PetscFinalize();
 18:   return 0;
 19: }

 21: /*TEST

 23:    test:
 24:      localrunfiles: optionsfile
 25:      filter: grep -E -v "(options_left)"

 27: TEST*/