xref: /petsc/src/sys/tutorials/ex19.c (revision 732aec7a18f2199fb53bb9a2f3aef439a834ce31)
1c4762a1bSJed Brown static char help[] = "Illustrates creating an options database.\n\n";
2c4762a1bSJed Brown 
3c4762a1bSJed Brown #include <petscsys.h>
4c4762a1bSJed Brown #include <petscviewer.h>
main(int argc,char ** argv)5d71ae5a4SJacob Faibussowitsch int main(int argc, char **argv)
6d71ae5a4SJacob Faibussowitsch {
7c4762a1bSJed Brown   PetscOptions options;
8c4762a1bSJed Brown 
9327415f7SBarry Smith   PetscFunctionBeginUser;
10*c8025a54SPierre Jolivet   PetscCall(PetscInitialize(&argc, &argv, NULL, 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
24c4762a1bSJed Brown 
25c4762a1bSJed Brown TEST*/
26