1c4762a1bSJed Brown 2c4762a1bSJed Brown static char help[] = "Illustrates creating an options database.\n\n"; 3c4762a1bSJed Brown 4c4762a1bSJed Brown #include <petscsys.h> 5c4762a1bSJed Brown #include <petscviewer.h> 6c4762a1bSJed Brown int main(int argc,char **argv) 7c4762a1bSJed Brown { 8c4762a1bSJed Brown PetscOptions options; 9c4762a1bSJed Brown 109566063dSJacob Faibussowitsch PetscCall(PetscInitialize(&argc,&argv,(char*)0,help)); 119566063dSJacob Faibussowitsch PetscCall(PetscOptionsCreate(&options)); 129566063dSJacob Faibussowitsch PetscCall(PetscOptionsInsert(options,&argc,&argv,"optionsfile")); 139566063dSJacob Faibussowitsch PetscCall(PetscOptionsInsertString(options,"-option1 value1 -option2 -option3 value3")); 149566063dSJacob Faibussowitsch PetscCall(PetscOptionsView(options,PETSC_VIEWER_STDOUT_WORLD)); 159566063dSJacob Faibussowitsch PetscCall(PetscOptionsDestroy(&options)); 169566063dSJacob Faibussowitsch PetscCall(PetscFinalize()); 17b122ec5aSJacob Faibussowitsch return 0; 18c4762a1bSJed Brown } 19c4762a1bSJed Brown 20c4762a1bSJed Brown /*TEST 21c4762a1bSJed Brown 22c4762a1bSJed Brown test: 23c4762a1bSJed Brown localrunfiles: optionsfile 24*660278c0SBarry Smith filter: egrep -v "(options_left)" 25c4762a1bSJed Brown 26c4762a1bSJed Brown TEST*/ 27