Actual source code: petscoptions.h
1: /* $Id: petscoptions.h,v 1.46 2001/09/07 20:13:16 bsmith Exp $ */
2: /*
3: Routines to determine options set in the options database.
4: */
7: #include petsc.h
9: EXTERN int PetscOptionsHasName(const char[],const char[],PetscTruth*);
10: EXTERN int PetscOptionsGetInt(const char[],const char [],int *,PetscTruth*);
11: EXTERN int PetscOptionsGetLogical(const char[],const char [],PetscTruth *,PetscTruth*);
12: EXTERN int PetscOptionsGetReal(const char[],const char[],PetscReal *,PetscTruth*);
13: EXTERN int PetscOptionsGetScalar(const char[],const char[],PetscScalar *,PetscTruth*);
14: EXTERN int PetscOptionsGetIntArray(const char[],const char[],int[],int *,PetscTruth*);
15: EXTERN int PetscOptionsGetRealArray(const char[],const char[],PetscReal[],int *,PetscTruth*);
16: EXTERN int PetscOptionsGetString(const char[],const char[],char[],int,PetscTruth*);
17: EXTERN int PetscOptionsGetStringArray(const char[],const char[],char*[],int*,PetscTruth*);
19: EXTERN int PetscOptionsSetAlias(const char[],const char[]);
20: EXTERN int PetscOptionsSetValue(const char[],const char[]);
21: EXTERN int PetscOptionsClearValue(const char[]);
23: EXTERN int PetscOptionsAllUsed(int *);
24: EXTERN int PetscOptionsLeft(void);
25: EXTERN int PetscOptionsPrint(FILE *);
27: EXTERN int PetscOptionsCreate(void);
28: EXTERN int PetscOptionsInsert(int *,char ***,const char[]);
29: EXTERN int PetscOptionsInsertFile(const char[]);
30: EXTERN int PetscOptionsInsertString(const char*);
31: EXTERN int PetscOptionsDestroy(void);
33: EXTERN int PetscOptionsReject(const char[],const char[]);
34: EXTERN int PetscOptionsGetAll(char*[]);
36: EXTERN int PetscOptionsGetenv(MPI_Comm,const char *,char[],int,PetscTruth *);
37: EXTERN int PetscOptionsAtoi(const char[],int*);
38: EXTERN int PetscOptionsAtod(const char[],PetscReal*);
40: extern PetscTruth PetscOptionsPublish;
41: extern int PetscOptionsPublishCount;
43: /*MC
44: PetscOptionsBegin - Begins a set of queries on the options database that are related and should be
45: displayed on the same window of a GUI that allows the user to set the options interactively.
47: Synopsis: int PetscOptionsBegin(MPI_Comm comm,char *prefix,char *title,char *mansec)
49: Collective on MPI_Comm
51: Input Parameters:
52: + comm - communicator that shares GUI
53: . prefix - options prefix for all options displayed on window
54: . title - short descriptive text, for example "Krylov Solver Options"
55: - mansec - section of manual pages for options, for example KSP
57: Level: intermediate
59: Notes: Needs to be ended by a call the PetscOptionsEnd()
61: Can add subheadings with PetscOptionsHead()
63: .seealso: PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetInt(),
64: PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsLogical()
65: PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsLogical(),
66: PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHead(),
67: PetscOptionsStringArray(),PetscOptionsRealArray(), PetscOptionsScalar(),
68: PetscOptionsLogicalGroupBegin(), PetscOptionsLogicalGroup(), PetscOptionsLogicalGroupEnd(),
69: PetscOptionsList(), PetscOptionsEList()
71: M*/
72: #define PetscOptionsBegin(comm,prefix,mess,sec) 0; {\
73: for (PetscOptionsPublishCount=(PetscOptionsPublish?-1:1); PetscOptionsPublishCount<2; PetscOptionsPublishCount++) {\
74: int _5_PetscOptionsBegin_Private(comm,prefix,mess,sec);CHKERRQ(_5_ierr);
76: /*MC
77: PetscOptionsEnd - Ends a set of queries on the options database that are related and should be
78: displayed on the same window of a GUI that allows the user to set the options interactively.
80: Collective on the MPI_Comm used in PetscOptionsBegin()
82: Synopsis: int PetscOptionsEnd(void)
84: Level: intermediate
86: Notes: Needs to be preceded by a call to PetscOptionsBegin()
88: .seealso: PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetInt(),
89: PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsLogical()
90: PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsLogical(),
91: PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHead(),
92: PetscOptionsStringArray(),PetscOptionsRealArray(), PetscOptionsScalar(),
93: PetscOptionsLogicalGroupBegin(), PetscOptionsLogicalGroup(), PetscOptionsLogicalGroupEnd(),
94: PetscOptionsList(), PetscOptionsEList()
96: M*/
97: #define PetscOptionsEnd() _5_PetscOptionsEnd_Private();CHKERRQ(_5_ierr);}}
99: EXTERN int PetscOptionsBegin_Private(MPI_Comm,char*,char*,char*);
100: EXTERN int PetscOptionsEnd_Private(void);
101: EXTERN int PetscOptionsHead(char*);
103: /*MC
104: PetscOptionsTail - Ends a section of options begun with PetscOptionsHead()
105: See, for example, KSPSetFromOptions_GMRES().
107: Collective on the communicator passed in PetscOptionsBegin()
109: Synopsis: int PetscOptionsTail(void)
111: Level: intermediate
113: Notes: Must be between a PetscOptionsBegin() and a PetscOptionsEnd()
115: Must be preceded by a call to PetscOptionsHead() in the same function.
117: Concepts: options database^subheading
119: .seealso: PetscOptionsGetInt(), PetscOptionsGetReal(),
120: PetscOptionsHasName(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsLogical(),
121: PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHead(),
122: PetscOptionsStringArray(),PetscOptionsRealArray(), PetscOptionsScalar(),
123: PetscOptionsLogicalGroupBegin(), PetscOptionsLogicalGroup(), PetscOptionsLogicalGroupEnd(),
124: PetscOptionsList(), PetscOptionsEList()
125: M*/
126: #define PetscOptionsTail() 0; {if (PetscOptionsPublishCount != 1) return(0);}
128: EXTERN int PetscOptionsInt(char*,char*,char*,int,int*,PetscTruth*);
129: EXTERN int PetscOptionsReal(char*,char*,char*,PetscReal,PetscReal*,PetscTruth*);
130: EXTERN int PetscOptionsScalar(char*,char*,char*,PetscScalar,PetscScalar*,PetscTruth*);
131: EXTERN int PetscOptionsName(char*,char*,char*,PetscTruth*);
132: EXTERN int PetscOptionsString(char*,char*,char*,char*,char*,int,PetscTruth*);
133: EXTERN int PetscOptionsLogical(char*,char*,char*,PetscTruth,PetscTruth*,PetscTruth*);
134: EXTERN int PetscOptionsLogicalGroupBegin(char*,char*,char*,PetscTruth*);
135: EXTERN int PetscOptionsLogicalGroup(char*,char*,char*,PetscTruth*);
136: EXTERN int PetscOptionsLogicalGroupEnd(char*,char*,char*,PetscTruth*);
137: EXTERN int PetscOptionsList(char*,char*,char*,PetscFList,char*,char*,int,PetscTruth*);
138: EXTERN int PetscOptionsEList(char*,char*,char*,char**,int,char*,char *,int,PetscTruth*);
139: EXTERN int PetscOptionsRealArray(char*,char*,char*,PetscReal[],int*,PetscTruth*);
140: EXTERN int PetscOptionsIntArray(char*,char*,char*,int[],int*,PetscTruth*);
141: EXTERN int PetscOptionsStringArray(char*,char*,char*,char**,int*,PetscTruth*);
142: #endif