xref: /petsc/include/petscoptions.h (revision fbf9dbe564678ed6eff1806adbc4c4f01b9743f4)
1 /*
2    Routines to determine options set in the options database.
3 */
4 #ifndef PETSCOPTIONS_H
5 #define PETSCOPTIONS_H
6 
7 #include <petscsys.h>
8 #include <petscviewertypes.h>
9 
10 /* SUBMANSEC = Sys */
11 
12 typedef enum {
13   PETSC_OPT_CODE,
14   PETSC_OPT_COMMAND_LINE,
15   PETSC_OPT_FILE,
16   PETSC_OPT_ENVIRONMENT,
17   NUM_PETSC_OPT_SOURCE
18 } PetscOptionSource;
19 
20 #define PETSC_MAX_OPTION_NAME 512
21 typedef struct _n_PetscOptions *PetscOptions;
22 PETSC_EXTERN PetscErrorCode     PetscOptionsCreate(PetscOptions *);
23 PETSC_EXTERN PetscErrorCode     PetscOptionsPush(PetscOptions);
24 PETSC_EXTERN PetscErrorCode     PetscOptionsPop(void);
25 PETSC_EXTERN PetscErrorCode     PetscOptionsDestroy(PetscOptions *);
26 PETSC_EXTERN PetscErrorCode     PetscOptionsCreateDefault(void);
27 PETSC_EXTERN PetscErrorCode     PetscOptionsDestroyDefault(void);
28 
29 PETSC_EXTERN PetscErrorCode PetscOptionsHasHelp(PetscOptions, PetscBool *);
30 PETSC_EXTERN PetscErrorCode PetscOptionsHasName(PetscOptions, const char[], const char[], PetscBool *);
31 PETSC_EXTERN PetscErrorCode PetscOptionsGetBool(PetscOptions, const char[], const char[], PetscBool *, PetscBool *);
32 PETSC_EXTERN PetscErrorCode PetscOptionsGetInt(PetscOptions, const char[], const char[], PetscInt *, PetscBool *);
33 PETSC_EXTERN PetscErrorCode PetscOptionsGetEnum(PetscOptions, const char[], const char[], const char *const *, PetscEnum *, PetscBool *);
34 PETSC_EXTERN PetscErrorCode PetscOptionsGetEList(PetscOptions, const char[], const char[], const char *const *, PetscInt, PetscInt *, PetscBool *);
35 PETSC_EXTERN PetscErrorCode PetscOptionsGetReal(PetscOptions, const char[], const char[], PetscReal *, PetscBool *);
36 PETSC_EXTERN PetscErrorCode PetscOptionsGetScalar(PetscOptions, const char[], const char[], PetscScalar *, PetscBool *);
37 PETSC_EXTERN PetscErrorCode PetscOptionsGetString(PetscOptions, const char[], const char[], char[], size_t, PetscBool *);
38 
39 PETSC_EXTERN PetscErrorCode PetscOptionsGetBoolArray(PetscOptions, const char[], const char[], PetscBool[], PetscInt *, PetscBool *);
40 PETSC_EXTERN PetscErrorCode PetscOptionsGetEnumArray(PetscOptions, const char[], const char[], const char *const *, PetscEnum *, PetscInt *, PetscBool *);
41 PETSC_EXTERN PetscErrorCode PetscOptionsGetIntArray(PetscOptions, const char[], const char[], PetscInt[], PetscInt *, PetscBool *);
42 PETSC_EXTERN PetscErrorCode PetscOptionsGetRealArray(PetscOptions, const char[], const char[], PetscReal[], PetscInt *, PetscBool *);
43 PETSC_EXTERN PetscErrorCode PetscOptionsGetScalarArray(PetscOptions, const char[], const char[], PetscScalar[], PetscInt *, PetscBool *);
44 PETSC_EXTERN PetscErrorCode PetscOptionsGetStringArray(PetscOptions, const char[], const char[], char *[], PetscInt *, PetscBool *);
45 
46 PETSC_EXTERN PetscErrorCode PetscOptionsValidKey(const char[], PetscBool *);
47 PETSC_EXTERN PetscErrorCode PetscOptionsSetAlias(PetscOptions, const char[], const char[]);
48 PETSC_EXTERN PetscErrorCode PetscOptionsSetValue(PetscOptions, const char[], const char[]);
49 PETSC_EXTERN PetscErrorCode PetscOptionsClearValue(PetscOptions, const char[]);
50 PETSC_EXTERN PetscErrorCode PetscOptionsFindPair(PetscOptions, const char[], const char[], const char *[], PetscBool *);
51 
52 PETSC_EXTERN PetscErrorCode PetscOptionsGetAll(PetscOptions, char *[]);
53 PETSC_EXTERN PetscErrorCode PetscOptionsAllUsed(PetscOptions, PetscInt *);
54 PETSC_EXTERN PetscErrorCode PetscOptionsUsed(PetscOptions, const char[], PetscBool *);
55 PETSC_EXTERN PetscErrorCode PetscOptionsLeft(PetscOptions);
56 PETSC_EXTERN PetscErrorCode PetscOptionsLeftGet(PetscOptions, PetscInt *, char ***, char ***);
57 PETSC_EXTERN PetscErrorCode PetscOptionsLeftRestore(PetscOptions, PetscInt *, char ***, char ***);
58 PETSC_EXTERN PetscErrorCode PetscOptionsView(PetscOptions, PetscViewer);
59 
60 PETSC_EXTERN PetscErrorCode PetscOptionsReject(PetscOptions, const char[], const char[], const char[]);
61 PETSC_EXTERN PetscErrorCode PetscOptionsInsert(PetscOptions, int *, char ***, const char[]);
62 PETSC_EXTERN PetscErrorCode PetscOptionsInsertFile(MPI_Comm, PetscOptions, const char[], PetscBool);
63 PETSC_EXTERN PetscErrorCode PetscOptionsInsertFileYAML(MPI_Comm, PetscOptions, const char[], PetscBool);
64 PETSC_EXTERN PetscErrorCode PetscOptionsInsertString(PetscOptions, const char[]);
65 PETSC_EXTERN PetscErrorCode PetscOptionsInsertStringYAML(PetscOptions, const char[]);
66 PETSC_EXTERN PetscErrorCode PetscOptionsInsertArgs(PetscOptions, int, char **);
67 PETSC_EXTERN PetscErrorCode PetscOptionsClear(PetscOptions);
68 PETSC_EXTERN PetscErrorCode PetscOptionsPrefixPush(PetscOptions, const char[]);
69 PETSC_EXTERN PetscErrorCode PetscOptionsPrefixPop(PetscOptions);
70 
71 PETSC_EXTERN PetscErrorCode PetscOptionsGetenv(MPI_Comm, const char[], char[], size_t, PetscBool *);
72 PETSC_EXTERN PetscErrorCode PetscOptionsStringToBool(const char[], PetscBool *);
73 PETSC_EXTERN PetscErrorCode PetscOptionsStringToInt(const char[], PetscInt *);
74 PETSC_EXTERN PetscErrorCode PetscOptionsStringToReal(const char[], PetscReal *);
75 PETSC_EXTERN PetscErrorCode PetscOptionsStringToScalar(const char[], PetscScalar *);
76 
77 PETSC_EXTERN PetscErrorCode PetscOptionsMonitorSet(PetscErrorCode (*)(const char[], const char[], PetscOptionSource, void *), void *, PetscErrorCode (*)(void **));
78 PETSC_EXTERN PetscErrorCode PetscOptionsMonitorDefault(const char[], const char[], PetscOptionSource, void *);
79 
80 PETSC_EXTERN PetscErrorCode PetscObjectSetOptions(PetscObject, PetscOptions);
81 PETSC_EXTERN PetscErrorCode PetscObjectGetOptions(PetscObject, PetscOptions *);
82 
83 PETSC_EXTERN PetscBool PetscOptionsPublish;
84 
85 /*
86     See manual page for PetscOptionsBegin()
87 
88     PetscOptionsItem and PetscOptionsItems are a single option (such as ksp_type) and a collection of such single
89   options being handled with a PetscOptionsBegin/End()
90 
91 */
92 typedef enum {
93   OPTION_INT,
94   OPTION_BOOL,
95   OPTION_REAL,
96   OPTION_FLIST,
97   OPTION_STRING,
98   OPTION_REAL_ARRAY,
99   OPTION_SCALAR_ARRAY,
100   OPTION_HEAD,
101   OPTION_INT_ARRAY,
102   OPTION_ELIST,
103   OPTION_BOOL_ARRAY,
104   OPTION_STRING_ARRAY
105 } PetscOptionType;
106 
107 typedef struct _n_PetscOptionItem *PetscOptionItem;
108 struct _n_PetscOptionItem {
109   char              *option;
110   char              *text;
111   void              *data;  /* used to hold the default value and then any value it is changed to by GUI */
112   PetscFunctionList  flist; /* used for available values for PetscOptionsList() */
113   const char *const *list;  /* used for available values for PetscOptionsEList() */
114   char               nlist; /* number of entries in list */
115   char              *man;
116   size_t             arraylength; /* number of entries in data in the case that it is an array (of PetscInt etc) */
117   PetscBool          set;         /* the user has changed this value in the GUI */
118   PetscOptionType    type;
119   PetscOptionItem    next;
120   char              *pman;
121   void              *edata;
122 };
123 
124 typedef struct _p_PetscOptionItems {
125   PetscInt        count;
126   PetscOptionItem next;
127   char           *prefix, *pprefix;
128   char           *title;
129   MPI_Comm        comm;
130   PetscBool       printhelp, changedmethod, alreadyprinted;
131   PetscObject     object;
132   PetscOptions    options;
133 } PetscOptionItems;
134 
135 #if defined(PETSC_CLANG_STATIC_ANALYZER)
136 extern PetscOptionItems *PetscOptionsObject; /* declare this so that the PetscOptions stubs work */
137 PetscErrorCode           PetscOptionsBegin(MPI_Comm, const char *, const char *, const char *);
138 PetscErrorCode           PetscObjectOptionsBegin(PetscObject);
139 PetscErrorCode           PetscOptionsEnd(void);
140 #else
141   /*MC
142     PetscOptionsBegin - Begins a set of queries on the options database that are related and should be
143      displayed on the same window of a GUI that allows the user to set the options interactively. Often one should
144      use `PetscObjectOptionsBegin()` rather than this call.
145 
146    Synopsis:
147     #include <petscoptions.h>
148     PetscErrorCode PetscOptionsBegin(MPI_Comm comm,const char prefix[],const char title[],const char mansec[])
149 
150     Collective
151 
152   Input Parameters:
153 +   comm - communicator that shares GUI
154 .   prefix - options prefix for all options displayed on window (optional)
155 .   title - short descriptive text, for example "Krylov Solver Options"
156 -   mansec - section of manual pages for options, for example `KSP` (optional)
157 
158   Level: intermediate
159 
160   Notes:
161     This is a macro that handles its own error checking, it does not return an error code.
162 
163     The set of queries needs to be ended by a call to `PetscOptionsEnd()`.
164 
165     One can add subheadings with `PetscOptionsHeadBegin()`.
166 
167   Developer Notes:
168       `PetscOptionsPublish` is set in `PetscOptionsCheckInitial_Private()` with `-saws_options`. When `PetscOptionsPublish` is set the
169       loop between `PetscOptionsBegin()` and `PetscOptionsEnd()` is run THREE times with `PetscOptionsPublishCount` of values -1,0,1.
170       Otherwise the loop is run ONCE with a `PetscOptionsPublishCount` of 1.
171 +      \-1 - `PetscOptionsInt()` etc. just call `PetscOptionsGetInt()` etc.
172 .      0  - The GUI objects are created in `PetscOptionsInt()` etc. and displayed in `PetscOptionsEnd()` and the options
173                database updated with user changes; `PetscOptionsGetInt()` etc. are also called.
174 -      1 - `PetscOptionsInt()` etc. again call `PetscOptionsGetInt()` etc. (possibly getting new values), in addition the help message and
175               default values are printed if -help was given.
176       When `PetscOptionsObject.changedmethod` is set this causes `PetscOptionsPublishCount` to be reset to -2 (so in the next loop iteration it is -1)
177       and the whole process is repeated. This is to handle when, for example, the `KSPType` is changed thus changing the list of
178       options available so they need to be redisplayed so the user can change the. Changing `PetscOptionsObjects.changedmethod` is never
179       currently set.
180 
181    Fortran Note:
182    Returns ierr error code per PETSc Fortran API
183 
184 .seealso: `PetscOptionsGetReal()`, `PetscOptionsHasName()`, `PetscOptionsGetString()`, `PetscOptionsGetInt()`,
185           `PetscOptionsGetIntArray()`, `PetscOptionsGetRealArray()`, `PetscOptionsBool()`
186           `PetscOptionsInt()`, `PetscOptionsString()`, `PetscOptionsReal()`, `PetscOptionsBool()`,
187           `PetscOptionsName()`, `PetscOptionsEnd()`, `PetscOptionsHeadBegin()`,
188           `PetscOptionsStringArray()`, `PetscOptionsRealArray()`, `PetscOptionsScalar()`,
189           `PetscOptionsBoolGroupBegin()`, `PetscOptionsBoolGroup()`, `PetscOptionsBoolGroupEnd()`,
190           `PetscOptionsFList()`, `PetscOptionsEList()`, `PetscObjectOptionsBegin()`
191 M*/
192   #define PetscOptionsBegin(comm, prefix, mess, sec) \
193     do { \
194       PetscOptionItems  PetscOptionsObjectBase; \
195       PetscOptionItems *PetscOptionsObject = &PetscOptionsObjectBase; \
196       PetscCall(PetscMemzero(PetscOptionsObject, sizeof(*PetscOptionsObject))); \
197       for (PetscOptionsObject->count = (PetscOptionsPublish ? -1 : 1); PetscOptionsObject->count < 2; PetscOptionsObject->count++) { \
198         PetscCall(PetscOptionsBegin_Private(PetscOptionsObject, comm, prefix, mess, sec))
199 
200   /*MC
201     PetscObjectOptionsBegin - Begins a set of queries on the options database that are related and should be
202      displayed on the same window of a GUI that allows the user to set the options interactively.
203 
204    Synopsis:
205     #include <petscoptions.h>
206     PetscErrorCode PetscObjectOptionsBegin(PetscObject obj)
207 
208     Collective
209 
210   Input Parameter:
211 .   obj - object to set options for
212 
213   Level: intermediate
214 
215   Notes:
216     This is a macro that handles its own error checking, it does not return an error code.
217 
218     Needs to be ended by a call the `PetscOptionsEnd()`
219 
220     Can add subheadings with `PetscOptionsHeadBegin()`
221 
222 .seealso: `PetscOptionsGetReal()`, `PetscOptionsHasName()`, `PetscOptionsGetString()`, `PetscOptionsGetInt()`,
223           `PetscOptionsGetIntArray()`, `PetscOptionsGetRealArray()`, `PetscOptionsBool()`
224           `PetscOptionsInt()`, `PetscOptionsString()`, `PetscOptionsReal()`, `PetscOptionsBool()`,
225           `PetscOptionsName()`, `PetscOptionsBegin()`, `PetscOptionsEnd()`, `PetscOptionsHeadBegin()`,
226           `PetscOptionsStringArray()`, `PetscOptionsRealArray()`, `PetscOptionsScalar()`,
227           `PetscOptionsBoolGroupBegin()`, `PetscOptionsBoolGroup()`, `PetscOptionsBoolGroupEnd()`,
228           `PetscOptionsFList()`, `PetscOptionsEList()`
229 M*/
230   #define PetscObjectOptionsBegin(obj) \
231     do { \
232       PetscOptionItems  PetscOptionsObjectBase; \
233       PetscOptionItems *PetscOptionsObject = &PetscOptionsObjectBase; \
234       PetscOptionsObject->options          = ((PetscObject)obj)->options; \
235       for (PetscOptionsObject->count = (PetscOptionsPublish ? -1 : 1); PetscOptionsObject->count < 2; PetscOptionsObject->count++) { \
236         PetscCall(PetscObjectOptionsBegin_Private(obj, PetscOptionsObject))
237 
238   /*MC
239     PetscOptionsEnd - Ends a set of queries on the options database that are related and should be
240      displayed on the same window of a GUI that allows the user to set the options interactively.
241 
242    Synopsis:
243      #include <petscoptions.h>
244      PetscErrorCode PetscOptionsEnd(void)
245 
246     Collective on the comm used in `PetscOptionsBegin()` or obj used in `PetscObjectOptionsBegin()`
247 
248   Level: intermediate
249 
250   Notes:
251     Needs to be preceded by a call to `PetscOptionsBegin()` or `PetscObjectOptionsBegin()`
252 
253     This is a macro that handles its own error checking, it does not return an error code.
254 
255   Fortran Note:
256    Returns ierr error code per PETSc Fortran API
257 
258 .seealso: `PetscOptionsGetReal()`, `PetscOptionsHasName()`, `PetscOptionsGetString()`, `PetscOptionsGetInt()`,
259           `PetscOptionsGetIntArray()`, `PetscOptionsGetRealArray()`, `PetscOptionsBool()`
260           `PetscOptionsInt()`, `PetscOptionsString()`, `PetscOptionsReal()`, `PetscOptionsBool()`,
261           `PetscOptionsName()`, `PetscOptionsBegin()`, `PetscOptionsHeadBegin()`,
262           `PetscOptionsStringArray()`, `PetscOptionsRealArray()`, `PetscOptionsScalar()`,
263           `PetscOptionsBoolGroupBegin()`, `PetscOptionsBoolGroup()`, `PetscOptionsBoolGroupEnd()`,
264           `PetscOptionsFList()`, `PetscOptionsEList()`, `PetscObjectOptionsBegin()`
265 M*/
266   #define PetscOptionsEnd() \
267     PetscCall(PetscOptionsEnd_Private(PetscOptionsObject)); \
268     } \
269     } \
270     while (0)
271 #endif /* PETSC_CLANG_STATIC_ANALYZER */
272 
273 PETSC_EXTERN PetscErrorCode PetscOptionsBegin_Private(PetscOptionItems *, MPI_Comm, const char[], const char[], const char[]);
274 PETSC_EXTERN PetscErrorCode PetscObjectOptionsBegin_Private(PetscObject, PetscOptionItems *);
275 PETSC_EXTERN PetscErrorCode PetscOptionsEnd_Private(PetscOptionItems *);
276 PETSC_EXTERN PetscErrorCode PetscOptionsHeadBegin(PetscOptionItems *, const char[]);
277 
278 #if defined(PETSC_CLANG_STATIC_ANALYZER)
279 template <typename... T>
280 void PetscOptionsHeadBegin(T...);
281 void PetscOptionsHeadEnd(void);
282 template <typename... T>
283 PetscErrorCode PetscOptionsEnum(T...);
284 template <typename... T>
285 PetscErrorCode PetscOptionsInt(T...);
286 template <typename... T>
287 PetscErrorCode PetscOptionsBoundedInt(T...);
288 template <typename... T>
289 PetscErrorCode PetscOptionsRangeInt(T...);
290 template <typename... T>
291 PetscErrorCode PetscOptionsReal(T...);
292 template <typename... T>
293 PetscErrorCode PetscOptionsScalar(T...);
294 template <typename... T>
295 PetscErrorCode PetscOptionsName(T...);
296 template <typename... T>
297 PetscErrorCode PetscOptionsString(T...);
298 template <typename... T>
299 PetscErrorCode PetscOptionsBool(T...);
300 template <typename... T>
301 PetscErrorCode PetscOptionsBoolGroupBegin(T...);
302 template <typename... T>
303 PetscErrorCode PetscOptionsBoolGroup(T...);
304 template <typename... T>
305 PetscErrorCode PetscOptionsBoolGroupEnd(T...);
306 template <typename... T>
307 PetscErrorCode PetscOptionsFList(T...);
308 template <typename... T>
309 PetscErrorCode PetscOptionsEList(T...);
310 template <typename... T>
311 PetscErrorCode PetscOptionsRealArray(T...);
312 template <typename... T>
313 PetscErrorCode PetscOptionsScalarArray(T...);
314 template <typename... T>
315 PetscErrorCode PetscOptionsIntArray(T...);
316 template <typename... T>
317 PetscErrorCode PetscOptionsStringArray(T...);
318 template <typename... T>
319 PetscErrorCode PetscOptionsBoolArray(T...);
320 template <typename... T>
321 PetscErrorCode PetscOptionsEnumArray(T...);
322 template <typename... T>
323 PetscErrorCode PetscOptionsDeprecated(T...);
324 template <typename... T>
325 PetscErrorCode PetscOptionsDeprecatedNoObject(T...);
326 #else
327   /*MC
328      PetscOptionsHeadBegin - Puts a heading before listing any more published options. Used, for example,
329             in `KSPSetFromOptions_GMRES()`.
330 
331    Logically Collective on the communicator passed in `PetscOptionsBegin()`
332 
333    Input Parameter:
334 .   head - the heading text
335 
336    Level: developer
337 
338    Notes:
339     Handles errors directly, hence does not return an error code
340 
341     Must be between a `PetscOptionsBegin()` and a `PetscOptionsEnd()`, and `PetscOptionsObject` created in `PetscOptionsBegin()` should be the first argument
342 
343     Must be followed by a call to `PetscOptionsHeadEnd()` in the same function.
344 
345 .seealso: `PetscOptionsGetInt()`, `PetscOptionsGetReal()`,
346           `PetscOptionsHasName()`, `PetscOptionsGetIntArray()`, `PetscOptionsGetRealArray()`, `PetscOptionsBool()`,
347           `PetscOptionsName()`, `PetscOptionsBegin()`, `PetscOptionsEnd()`, `PetscOptionsHeadBegin()`,
348           `PetscOptionsStringArray()`, `PetscOptionsRealArray()`, `PetscOptionsScalar()`,
349           `PetscOptionsBoolGroupBegin()`, `PetscOptionsBoolGroup()`, `PetscOptionsBoolGroupEnd()`,
350           `PetscOptionsFList()`, `PetscOptionsEList()`
351 @*/
352   #define PetscOptionsHeadBegin(PetscOptionsObject, head) \
353     do { \
354       if (PetscOptionsObject->printhelp && PetscOptionsObject->count == 1 && !PetscOptionsObject->alreadyprinted) PetscCall((*PetscHelpPrintf)(PetscOptionsObject->comm, "  %s\n", head)); \
355     } while (0)
356 
357   #define PetscOptionsHead(...) PETSC_DEPRECATED_MACRO("GCC warning \"Use PetscOptionsHeadBegin() (since version 3.18)\"") PetscOptionsHeadBegin(__VA_ARGS__)
358 
359   /*MC
360      PetscOptionsHeadEnd - Ends a section of options begun with `PetscOptionsHeadBegin()`
361             See, for example, `KSPSetFromOptions_GMRES()`.
362 
363    Synopsis:
364      #include <petscoptions.h>
365      PetscErrorCode PetscOptionsHeadEnd(void)
366 
367     Collective on the comm used in `PetscOptionsBegin()` or obj used in `PetscObjectOptionsBegin()`
368 
369   Level: intermediate
370 
371    Notes:
372     Must be between a `PetscOptionsBegin()` or `PetscObjectOptionsBegin()` and a `PetscOptionsEnd()`
373 
374     Must be preceded by a call to `PetscOptionsHeadBegin()` in the same function.
375 
376     This needs to be used only if the code below `PetscOptionsHeadEnd()` can be run ONLY once.
377     See, for example, `PCSetFromOptions_Composite()`. This is a `return(0)` in it for early exit
378     from the function.
379 
380           This is only for use with the PETSc options GUI
381 
382 .seealso: `PetscOptionsGetInt()`, `PetscOptionsGetReal()`,
383           `PetscOptionsHasName()`, `PetscOptionsGetIntArray()`, `PetscOptionsGetRealArray()`, `PetscOptionsBool()`,
384           `PetscOptionsName()`, `PetscOptionsBegin()`, `PetscOptionsEnd()`, `PetscOptionsHeadBegin()`,
385           `PetscOptionsStringArray()`, `PetscOptionsRealArray()`, `PetscOptionsScalar()`,
386           `PetscOptionsBoolGroupBegin()`, `PetscOptionsBoolGroup()`, `PetscOptionsBoolGroupEnd()`,
387           `PetscOptionsFList()`, `PetscOptionsEList()`, `PetscOptionsEnum()`
388 M*/
389   #define PetscOptionsHeadEnd() \
390     do { \
391       if (PetscOptionsObject->count != 1) PetscFunctionReturn(PETSC_SUCCESS); \
392     } while (0)
393 
394   #define PetscOptionsTail(...) PETSC_DEPRECATED_MACRO("GCC warning \"Use PetscOptionsHeadEnd() (since version 3.18)\"") PetscOptionsHeadEnd(__VA_ARGS__)
395 
396   #define PetscOptionsEnum(a, b, c, d, e, f, g)        PetscOptionsEnum_Private(PetscOptionsObject, a, b, c, d, e, f, g)
397   #define PetscOptionsInt(a, b, c, d, e, f)            PetscOptionsInt_Private(PetscOptionsObject, a, b, c, d, e, f, PETSC_MIN_INT, PETSC_MAX_INT)
398   #define PetscOptionsBoundedInt(a, b, c, d, e, f, g)  PetscOptionsInt_Private(PetscOptionsObject, a, b, c, d, e, f, g, PETSC_MAX_INT)
399   #define PetscOptionsRangeInt(a, b, c, d, e, f, g, h) PetscOptionsInt_Private(PetscOptionsObject, a, b, c, d, e, f, g, h)
400   #define PetscOptionsReal(a, b, c, d, e, f)           PetscOptionsReal_Private(PetscOptionsObject, a, b, c, d, e, f)
401   #define PetscOptionsScalar(a, b, c, d, e, f)         PetscOptionsScalar_Private(PetscOptionsObject, a, b, c, d, e, f)
402   #define PetscOptionsName(a, b, c, d)                 PetscOptionsName_Private(PetscOptionsObject, a, b, c, d)
403   #define PetscOptionsString(a, b, c, d, e, f, g)      PetscOptionsString_Private(PetscOptionsObject, a, b, c, d, e, f, g)
404   #define PetscOptionsBool(a, b, c, d, e, f)           PetscOptionsBool_Private(PetscOptionsObject, a, b, c, d, e, f)
405   #define PetscOptionsBoolGroupBegin(a, b, c, d)       PetscOptionsBoolGroupBegin_Private(PetscOptionsObject, a, b, c, d)
406   #define PetscOptionsBoolGroup(a, b, c, d)            PetscOptionsBoolGroup_Private(PetscOptionsObject, a, b, c, d)
407   #define PetscOptionsBoolGroupEnd(a, b, c, d)         PetscOptionsBoolGroupEnd_Private(PetscOptionsObject, a, b, c, d)
408   #define PetscOptionsFList(a, b, c, d, e, f, g, h)    PetscOptionsFList_Private(PetscOptionsObject, a, b, c, d, e, f, g, h)
409   #define PetscOptionsEList(a, b, c, d, e, f, g, h)    PetscOptionsEList_Private(PetscOptionsObject, a, b, c, d, e, f, g, h)
410   #define PetscOptionsRealArray(a, b, c, d, e, f)      PetscOptionsRealArray_Private(PetscOptionsObject, a, b, c, d, e, f)
411   #define PetscOptionsScalarArray(a, b, c, d, e, f)    PetscOptionsScalarArray_Private(PetscOptionsObject, a, b, c, d, e, f)
412   #define PetscOptionsIntArray(a, b, c, d, e, f)       PetscOptionsIntArray_Private(PetscOptionsObject, a, b, c, d, e, f)
413   #define PetscOptionsStringArray(a, b, c, d, e, f)    PetscOptionsStringArray_Private(PetscOptionsObject, a, b, c, d, e, f)
414   #define PetscOptionsBoolArray(a, b, c, d, e, f)      PetscOptionsBoolArray_Private(PetscOptionsObject, a, b, c, d, e, f)
415   #define PetscOptionsEnumArray(a, b, c, d, e, f, g)   PetscOptionsEnumArray_Private(PetscOptionsObject, a, b, c, d, e, f, g)
416   #define PetscOptionsDeprecated(a, b, c, d)           PetscOptionsDeprecated_Private(PetscOptionsObject, a, b, c, d)
417   #define PetscOptionsDeprecatedNoObject(a, b, c, d)   PetscOptionsDeprecated_Private(NULL, a, b, c, d)
418 #endif /* PETSC_CLANG_STATIC_ANALYZER */
419 
420 PETSC_EXTERN PetscErrorCode PetscOptionsEnum_Private(PetscOptionItems *, const char[], const char[], const char[], const char *const *, PetscEnum, PetscEnum *, PetscBool *);
421 PETSC_EXTERN PetscErrorCode PetscOptionsInt_Private(PetscOptionItems *, const char[], const char[], const char[], PetscInt, PetscInt *, PetscBool *, PetscInt, PetscInt);
422 PETSC_EXTERN PetscErrorCode PetscOptionsReal_Private(PetscOptionItems *, const char[], const char[], const char[], PetscReal, PetscReal *, PetscBool *);
423 PETSC_EXTERN PetscErrorCode PetscOptionsScalar_Private(PetscOptionItems *, const char[], const char[], const char[], PetscScalar, PetscScalar *, PetscBool *);
424 PETSC_EXTERN PetscErrorCode PetscOptionsName_Private(PetscOptionItems *, const char[], const char[], const char[], PetscBool *);
425 PETSC_EXTERN PetscErrorCode PetscOptionsString_Private(PetscOptionItems *, const char[], const char[], const char[], const char[], char *, size_t, PetscBool *);
426 PETSC_EXTERN PetscErrorCode PetscOptionsBool_Private(PetscOptionItems *, const char[], const char[], const char[], PetscBool, PetscBool *, PetscBool *);
427 PETSC_EXTERN PetscErrorCode PetscOptionsBoolGroupBegin_Private(PetscOptionItems *, const char[], const char[], const char[], PetscBool *);
428 PETSC_EXTERN PetscErrorCode PetscOptionsBoolGroup_Private(PetscOptionItems *, const char[], const char[], const char[], PetscBool *);
429 PETSC_EXTERN PetscErrorCode PetscOptionsBoolGroupEnd_Private(PetscOptionItems *, const char[], const char[], const char[], PetscBool *);
430 PETSC_EXTERN PetscErrorCode PetscOptionsFList_Private(PetscOptionItems *, const char[], const char[], const char[], PetscFunctionList, const char[], char[], size_t, PetscBool *);
431 PETSC_EXTERN PetscErrorCode PetscOptionsEList_Private(PetscOptionItems *, const char[], const char[], const char[], const char *const *, PetscInt, const char[], PetscInt *, PetscBool *);
432 PETSC_EXTERN PetscErrorCode PetscOptionsRealArray_Private(PetscOptionItems *, const char[], const char[], const char[], PetscReal[], PetscInt *, PetscBool *);
433 PETSC_EXTERN PetscErrorCode PetscOptionsScalarArray_Private(PetscOptionItems *, const char[], const char[], const char[], PetscScalar[], PetscInt *, PetscBool *);
434 PETSC_EXTERN PetscErrorCode PetscOptionsIntArray_Private(PetscOptionItems *, const char[], const char[], const char[], PetscInt[], PetscInt *, PetscBool *);
435 PETSC_EXTERN PetscErrorCode PetscOptionsStringArray_Private(PetscOptionItems *, const char[], const char[], const char[], char *[], PetscInt *, PetscBool *);
436 PETSC_EXTERN PetscErrorCode PetscOptionsBoolArray_Private(PetscOptionItems *, const char[], const char[], const char[], PetscBool[], PetscInt *, PetscBool *);
437 PETSC_EXTERN PetscErrorCode PetscOptionsEnumArray_Private(PetscOptionItems *, const char[], const char[], const char[], const char *const *, PetscEnum[], PetscInt *, PetscBool *);
438 PETSC_EXTERN PetscErrorCode PetscOptionsDeprecated_Private(PetscOptionItems *, const char[], const char[], const char[], const char[]);
439 
440 PETSC_EXTERN PetscErrorCode PetscOptionsSAWsDestroy(void);
441 
442 PETSC_EXTERN PetscErrorCode PetscObjectAddOptionsHandler(PetscObject, PetscErrorCode (*)(PetscObject, PetscOptionItems *, void *), PetscErrorCode (*)(PetscObject, void *), void *);
443 PETSC_EXTERN PetscErrorCode PetscObjectProcessOptionsHandlers(PetscObject, PetscOptionItems *);
444 PETSC_EXTERN PetscErrorCode PetscObjectDestroyOptionsHandlers(PetscObject);
445 
446 PETSC_EXTERN PetscErrorCode PetscOptionsLeftError(void);
447 #endif
448