Actual source code: ex19.c

petsc-3.10.5 2019-03-28
Report Typos and Errors

  2: static char help[] = "Tests string options with spaces";

  4:  #include <petscsys.h>

  6: int main(int argc,char **argv)
  7: {
  9:   char           option2[20],option3[30];
 10:   PetscBool      flg;
 11:   PetscInt       option1;

 13:   PetscInitialize(&argc,&argv,"ex19options",help);
 14:   PetscOptionsGetInt(NULL,0,"-option1",&option1,&flg);
 15:   PetscOptionsGetString(NULL,0,"-option2",option2,20,&flg);
 16:   PetscPrintf(PETSC_COMM_WORLD,"%s\n",option2);
 17:   PetscOptionsGetString(NULL,0,"-option3",option3,30,&flg);
 18:   PetscPrintf(PETSC_COMM_WORLD,"%s\n",option3);
 19:   PetscFinalize();
 20:   return ierr;
 21: }


 24: /*TEST

 26:    test:
 27:      localrunfiles: ex19options

 29: TEST*/