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 10*327415f7SBarry Smith PetscFunctionBeginUser; 119566063dSJacob Faibussowitsch PetscCall(PetscInitialize(&argc,&argv,(char*)0,help)); 129566063dSJacob Faibussowitsch PetscCall(PetscOptionsCreate(&options)); 139566063dSJacob Faibussowitsch PetscCall(PetscOptionsInsert(options,&argc,&argv,"optionsfile")); 149566063dSJacob Faibussowitsch PetscCall(PetscOptionsInsertString(options,"-option1 value1 -option2 -option3 value3")); 159566063dSJacob Faibussowitsch PetscCall(PetscOptionsView(options,PETSC_VIEWER_STDOUT_WORLD)); 169566063dSJacob Faibussowitsch PetscCall(PetscOptionsDestroy(&options)); 179566063dSJacob Faibussowitsch PetscCall(PetscFinalize()); 18b122ec5aSJacob Faibussowitsch return 0; 19c4762a1bSJed Brown } 20c4762a1bSJed Brown 21c4762a1bSJed Brown /*TEST 22c4762a1bSJed Brown 23c4762a1bSJed Brown test: 24c4762a1bSJed Brown localrunfiles: optionsfile 25660278c0SBarry Smith filter: egrep -v "(options_left)" 26c4762a1bSJed Brown 27c4762a1bSJed Brown TEST*/ 28