forked from petsc/petsc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpetscviewer.h
462 lines (389 loc) · 22.6 KB
/
petscviewer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
/*
PetscViewers are objects where other objects can be looked at or stored.
*/
#pragma once
#include <petscsys.h>
#include <petscviewertypes.h>
#include <petscdrawtypes.h>
/* SUBMANSEC = Viewer */
PETSC_EXTERN PetscClassId PETSC_VIEWER_CLASSID;
/*J
PetscViewerType - String with the name of a PETSc `PetscViewer` implementation
Level: beginner
.seealso: [](sec_viewers), `PetscViewerSetType()`, `PetscViewer`, `PetscViewerRegister()`, `PetscViewerCreate()`
J*/
typedef const char *PetscViewerType;
#define PETSCVIEWERSOCKET "socket"
#define PETSCVIEWERASCII "ascii"
#define PETSCVIEWERBINARY "binary"
#define PETSCVIEWERSTRING "string"
#define PETSCVIEWERDRAW "draw"
#define PETSCVIEWERVU "vu"
#define PETSCVIEWERMATHEMATICA "mathematica"
#define PETSCVIEWERHDF5 "hdf5"
#define PETSCVIEWERVTK "vtk"
#define PETSCVIEWERMATLAB "matlab"
#define PETSCVIEWERSAWS "saws"
#define PETSCVIEWERGLVIS "glvis"
#define PETSCVIEWERADIOS "adios"
#define PETSCVIEWEREXODUSII "exodusii"
#define PETSCVIEWERCGNS "cgns"
PETSC_EXTERN PetscFunctionList PetscViewerList;
PETSC_EXTERN PetscErrorCode PetscViewerInitializePackage(void);
PETSC_EXTERN PetscErrorCode PetscViewerFinalizePackage(void);
PETSC_EXTERN PetscErrorCode PetscViewerRegister(const char[], PetscErrorCode (*)(PetscViewer));
PETSC_EXTERN PetscErrorCode PetscViewerCreate(MPI_Comm, PetscViewer *);
PETSC_EXTERN PetscErrorCode PetscViewerSetFromOptions(PetscViewer);
PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpenWithFILE(MPI_Comm, FILE *, PetscViewer *);
PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpen(MPI_Comm, const char[], PetscViewer *);
PETSC_EXTERN PetscErrorCode PetscViewerASCIISetFILE(PetscViewer, FILE *);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryOpen(MPI_Comm, const char[], PetscFileMode, PetscViewer *);
PETSC_EXTERN PetscErrorCode PetscViewerADIOSOpen(MPI_Comm, const char[], PetscFileMode, PetscViewer *);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetFlowControl(PetscViewer, PetscInt *);
PETSC_EXTERN PetscErrorCode PetscViewerBinarySetFlowControl(PetscViewer, PetscInt);
PETSC_EXTERN PetscErrorCode PetscViewerBinarySetUseMPIIO(PetscViewer, PetscBool);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetUseMPIIO(PetscViewer, PetscBool *);
#if defined(PETSC_HAVE_MPIIO)
PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIODescriptor(PetscViewer, MPI_File *);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIOOffset(PetscViewer, MPI_Offset *);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryAddMPIIOOffset(PetscViewer, MPI_Offset);
#endif
PETSC_EXTERN PetscErrorCode PetscViewerSocketOpen(MPI_Comm, const char[], int, PetscViewer *);
PETSC_EXTERN PetscErrorCode PetscViewerStringOpen(MPI_Comm, char[], size_t, PetscViewer *);
PETSC_EXTERN PetscErrorCode PetscViewerDrawOpen(MPI_Comm, const char[], const char[], int, int, int, int, PetscViewer *);
PETSC_EXTERN PetscErrorCode PetscViewerDrawSetDrawType(PetscViewer, PetscDrawType);
PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDrawType(PetscViewer, PetscDrawType *);
PETSC_EXTERN PetscErrorCode PetscViewerDrawSetTitle(PetscViewer, const char[]);
PETSC_EXTERN PetscErrorCode PetscViewerDrawGetTitle(PetscViewer, const char *[]);
PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDraw(PetscViewer, PetscInt, PetscDraw *);
PETSC_EXTERN PetscErrorCode PetscViewerDrawBaseAdd(PetscViewer, PetscInt);
PETSC_EXTERN PetscErrorCode PetscViewerDrawBaseSet(PetscViewer, PetscInt);
PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDrawLG(PetscViewer, PetscInt, PetscDrawLG *);
PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDrawAxis(PetscViewer, PetscInt, PetscDrawAxis *);
PETSC_EXTERN PetscErrorCode PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *);
PETSC_EXTERN PetscErrorCode PetscViewerSiloOpen(MPI_Comm, const char[], PetscViewer *);
PETSC_EXTERN PetscErrorCode PetscViewerMatlabOpen(MPI_Comm, const char[], PetscFileMode, PetscViewer *);
/*E
PetscViewerGLVisType - indicates what type of `PETSCVIEWERGLVIS` viewer to use
Values:
+ `PETSC_VIEWER_GLVIS_DUMP` - save the data to a file
- `PETSC_VIEWER_GLVIS_SOCKET` - communicate the data to another program via a socket
Level: beginner
.seealso: [](sec_viewers), `PETSCVIEWERGLVIS`, `PetscViewerGLVisOpen()`
E*/
typedef enum {
PETSC_VIEWER_GLVIS_DUMP,
PETSC_VIEWER_GLVIS_SOCKET
} PetscViewerGLVisType;
PETSC_EXTERN PetscErrorCode PetscViewerGLVisOpen(MPI_Comm, PetscViewerGLVisType, const char *, PetscInt, PetscViewer *);
PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetPrecision(PetscViewer, PetscInt);
PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetSnapId(PetscViewer, PetscInt);
PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetFields(PetscViewer, PetscInt, const char *[], PetscInt[], PetscErrorCode (*)(PetscObject, PetscInt, PetscObject[], void *), PetscObject[], void *, PetscErrorCode (*)(void *));
PETSC_EXTERN PetscErrorCode PetscViewerGetType(PetscViewer, PetscViewerType *);
PETSC_EXTERN PetscErrorCode PetscViewerSetType(PetscViewer, PetscViewerType);
PETSC_EXTERN PetscErrorCode PetscViewerDestroy(PetscViewer *);
PETSC_EXTERN PetscErrorCode PetscViewerGetSubViewer(PetscViewer, MPI_Comm, PetscViewer *);
PETSC_EXTERN PetscErrorCode PetscViewerRestoreSubViewer(PetscViewer, MPI_Comm, PetscViewer *);
PETSC_EXTERN PetscErrorCode PetscViewerSetUp(PetscViewer);
PETSC_EXTERN PetscErrorCode PetscViewerView(PetscViewer, PetscViewer);
PETSC_EXTERN PetscErrorCode PetscViewerViewFromOptions(PetscViewer, PetscObject, const char[]);
PETSC_EXTERN PetscErrorCode PetscViewerSetOptionsPrefix(PetscViewer, const char[]);
PETSC_EXTERN PetscErrorCode PetscViewerAppendOptionsPrefix(PetscViewer, const char[]);
PETSC_EXTERN PetscErrorCode PetscViewerGetOptionsPrefix(PetscViewer, const char *[]);
PETSC_EXTERN PetscErrorCode PetscViewerReadable(PetscViewer, PetscBool *);
PETSC_EXTERN PetscErrorCode PetscViewerWritable(PetscViewer, PetscBool *);
PETSC_EXTERN PetscErrorCode PetscViewerCheckReadable(PetscViewer);
PETSC_EXTERN PetscErrorCode PetscViewerCheckWritable(PetscViewer);
#define PETSC_VIEWER_ASCII_VTK_ATTR PETSC_VIEWER_ASCII_VTK PETSC_DEPRECATED_ENUM(3, 14, 0, "PetscViewerVTKOpen() with XML (.vtr.vts.vtu) format", )
#define PETSC_VIEWER_ASCII_VTK_CELL_ATTR PETSC_VIEWER_ASCII_VTK_CELL PETSC_DEPRECATED_ENUM(3, 14, 0, "PetscViewerVTKOpen() with XML (.vtr.vts.vtu) format", )
#define PETSC_VIEWER_ASCII_VTK_COORDS_ATTR PETSC_VIEWER_ASCII_VTK_COORDS PETSC_DEPRECATED_ENUM(3, 14, 0, "PetscViewerVTKOpen() with XML (.vtr .vts .vtu) format", )
/*E
PetscViewerFormat - Way a viewer presents the object
Values:
+ `PETSC_VIEWER_DEFAULT` - default format for the specific object being viewed
. `PETSC_VIEWER_ASCII_MATLAB` - MATLAB format
. `PETSC_VIEWER_ASCII_DENSE` - print matrix as a dense two dimensiona array
. `PETSC_VIEWER_ASCII_IMPL` - implementation-specific format (which is in many cases the same as the default)
. `PETSC_VIEWER_ASCII_INFO` - basic information about object
. `PETSC_VIEWER_ASCII_INFO_DETAIL` - more detailed info about object
. `PETSC_VIEWER_ASCII_COMMON` - identical output format for all objects of a particular type
. `PETSC_VIEWER_ASCII_INDEX` - (for vectors) prints the vector element number next to each vector entry
. `PETSC_VIEWER_ASCII_SYMMODU` - print parallel vectors without indicating the MPI process ranges that own the entries
. `PETSC_VIEWER_ASCII_VTK` - outputs the object to a VTK file (deprecated since v3.14)
. `PETSC_VIEWER_NATIVE` - store the object to the binary file in its native format (for example, dense
matrices are stored as dense), `DMDA` vectors are dumped directly to the
file instead of being first put in the natural ordering
. `PETSC_VIEWER_ASCII_LATEX` - output the data in LaTeX
. `PETSC_VIEWER_BINARY_MATLAB` - output additional information that can be used to read the data into MATLAB
. `PETSC_VIEWER_DRAW_BASIC` - views the vector with a simple 1d plot
. `PETSC_VIEWER_DRAW_LG` - views the vector with a line graph
- `PETSC_VIEWER_DRAW_CONTOUR` - views the vector with a contour plot
Level: beginner
Note:
A variety of specialized formats also exist
.seealso: [](sec_viewers), `PetscViewer`, `PetscViewerType`, `PetscViewerPushFormat()`, `PetscViewerPopFormat()`
E*/
typedef enum {
PETSC_VIEWER_DEFAULT,
PETSC_VIEWER_ASCII_MATLAB,
PETSC_VIEWER_ASCII_MATHEMATICA,
PETSC_VIEWER_ASCII_IMPL,
PETSC_VIEWER_ASCII_INFO,
PETSC_VIEWER_ASCII_INFO_DETAIL,
PETSC_VIEWER_ASCII_COMMON,
PETSC_VIEWER_ASCII_SYMMODU,
PETSC_VIEWER_ASCII_INDEX,
PETSC_VIEWER_ASCII_DENSE,
PETSC_VIEWER_ASCII_MATRIXMARKET,
PETSC_VIEWER_ASCII_VTK_DEPRECATED,
PETSC_VIEWER_ASCII_VTK_ATTR = PETSC_VIEWER_ASCII_VTK_DEPRECATED,
PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED,
PETSC_VIEWER_ASCII_VTK_CELL_ATTR = PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED,
PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED,
PETSC_VIEWER_ASCII_VTK_COORDS_ATTR = PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED,
PETSC_VIEWER_ASCII_PCICE,
PETSC_VIEWER_ASCII_PYTHON,
PETSC_VIEWER_ASCII_FACTOR_INFO,
PETSC_VIEWER_ASCII_LATEX,
PETSC_VIEWER_ASCII_XML,
PETSC_VIEWER_ASCII_FLAMEGRAPH,
PETSC_VIEWER_ASCII_GLVIS,
PETSC_VIEWER_ASCII_CSV,
PETSC_VIEWER_DRAW_BASIC,
PETSC_VIEWER_DRAW_LG,
PETSC_VIEWER_DRAW_LG_XRANGE,
PETSC_VIEWER_DRAW_CONTOUR,
PETSC_VIEWER_DRAW_PORTS,
PETSC_VIEWER_VTK_VTS,
PETSC_VIEWER_VTK_VTR,
PETSC_VIEWER_VTK_VTU,
PETSC_VIEWER_BINARY_MATLAB,
PETSC_VIEWER_NATIVE,
PETSC_VIEWER_HDF5_PETSC,
PETSC_VIEWER_HDF5_VIZ,
PETSC_VIEWER_HDF5_XDMF,
PETSC_VIEWER_HDF5_MAT,
PETSC_VIEWER_NOFORMAT,
PETSC_VIEWER_LOAD_BALANCE,
PETSC_VIEWER_FAILED,
PETSC_VIEWER_ALL
} PetscViewerFormat;
PETSC_EXTERN const char *const PetscViewerFormats[];
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 7, 0, "PetscViewerPushFormat() / PetscViewerPopFormat()", ) PetscErrorCode PetscViewerSetFormat(PetscViewer, PetscViewerFormat);
PETSC_EXTERN PetscErrorCode PetscViewerPushFormat(PetscViewer, PetscViewerFormat);
PETSC_EXTERN PetscErrorCode PetscViewerPopFormat(PetscViewer);
PETSC_EXTERN PetscErrorCode PetscViewerGetFormat(PetscViewer, PetscViewerFormat *);
PETSC_EXTERN PetscErrorCode PetscViewerFlush(PetscViewer);
PETSC_EXTERN PetscErrorCode PetscOptionsPushGetViewerOff(PetscBool);
PETSC_EXTERN PetscErrorCode PetscOptionsPopGetViewerOff(void);
PETSC_EXTERN PetscErrorCode PetscOptionsGetViewerOff(PetscBool *);
PETSC_EXTERN PetscErrorCode PetscOptionsGetViewer(MPI_Comm, PetscOptions, const char[], const char[], PetscViewer *, PetscViewerFormat *, PetscBool *);
PETSC_EXTERN PetscErrorCode PetscOptionsGetViewers(MPI_Comm, PetscOptions, const char[], const char[], PetscInt *, PetscViewer *, PetscViewerFormat *, PetscBool *);
#define PetscOptionsViewer(a, b, c, d, e, f) PetscOptionsViewer_Private(PetscOptionsObject, a, b, c, d, e, f)
PETSC_EXTERN PetscErrorCode PetscOptionsViewer_Private(PetscOptionItems *, const char[], const char[], const char[], PetscViewer *, PetscViewerFormat *, PetscBool *);
PETSC_EXTERN PetscErrorCode PetscOptionsRestoreViewer(PetscViewer *);
typedef struct {
PetscViewer viewer;
PetscViewerFormat format;
PetscDrawLG lg;
PetscInt view_interval;
void *data;
} PetscViewerAndFormat;
PETSC_EXTERN PetscErrorCode PetscViewerAndFormatCreate(PetscViewer, PetscViewerFormat, PetscViewerAndFormat **);
PETSC_EXTERN PetscErrorCode PetscViewerAndFormatDestroy(PetscViewerAndFormat **);
/*
Operations explicit to a particular class of viewers
*/
PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetPointer(PetscViewer, FILE **);
PETSC_EXTERN PetscErrorCode PetscViewerFileGetMode(PetscViewer, PetscFileMode *);
PETSC_EXTERN PetscErrorCode PetscViewerFileSetMode(PetscViewer, PetscFileMode);
PETSC_EXTERN PetscErrorCode PetscViewerRead(PetscViewer, void *, PetscInt, PetscInt *, PetscDataType);
PETSC_EXTERN PetscErrorCode PetscViewerASCIIPrintf(PetscViewer, const char[], ...) PETSC_ATTRIBUTE_FORMAT(2, 3);
PETSC_EXTERN PetscErrorCode PetscViewerASCIISynchronizedPrintf(PetscViewer, const char[], ...) PETSC_ATTRIBUTE_FORMAT(2, 3);
PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushSynchronized(PetscViewer);
PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopSynchronized(PetscViewer);
PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushTab(PetscViewer);
PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopTab(PetscViewer);
PETSC_EXTERN PetscErrorCode PetscViewerASCIIUseTabs(PetscViewer, PetscBool);
PETSC_EXTERN PetscErrorCode PetscViewerASCIISetTab(PetscViewer, PetscInt);
PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetTab(PetscViewer, PetscInt *);
PETSC_EXTERN PetscErrorCode PetscViewerASCIIAddTab(PetscViewer, PetscInt);
PETSC_EXTERN PetscErrorCode PetscViewerASCIISubtractTab(PetscViewer, PetscInt);
PETSC_EXTERN PetscErrorCode PetscViewerASCIIRead(PetscViewer, void *, PetscInt, PetscInt *, PetscDataType);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetDescriptor(PetscViewer, int *);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetInfoPointer(PetscViewer, FILE **);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryRead(PetscViewer, void *, PetscInt, PetscInt *, PetscDataType);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryWrite(PetscViewer, const void *, PetscInt, PetscDataType);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryReadAll(PetscViewer, void *, PetscInt, PetscInt64, PetscInt64, PetscDataType);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryWriteAll(PetscViewer, const void *, PetscInt, PetscInt64, PetscInt64, PetscDataType);
PETSC_EXTERN PetscErrorCode PetscViewerStringSPrintf(PetscViewer, const char[], ...) PETSC_ATTRIBUTE_FORMAT(2, 3);
PETSC_EXTERN PetscErrorCode PetscViewerStringSetString(PetscViewer, char[], size_t);
PETSC_EXTERN PetscErrorCode PetscViewerStringGetStringRead(PetscViewer, const char *[], size_t *);
PETSC_EXTERN PetscErrorCode PetscViewerStringSetOwnString(PetscViewer);
PETSC_EXTERN PetscErrorCode PetscViewerDrawClear(PetscViewer);
PETSC_EXTERN PetscErrorCode PetscViewerDrawSetHold(PetscViewer, PetscBool);
PETSC_EXTERN PetscErrorCode PetscViewerDrawGetHold(PetscViewer, PetscBool *);
PETSC_EXTERN PetscErrorCode PetscViewerDrawSetPause(PetscViewer, PetscReal);
PETSC_EXTERN PetscErrorCode PetscViewerDrawGetPause(PetscViewer, PetscReal *);
PETSC_EXTERN PetscErrorCode PetscViewerDrawSetInfo(PetscViewer, const char[], const char[], int, int, int, int);
PETSC_EXTERN PetscErrorCode PetscViewerDrawResize(PetscViewer, int, int);
PETSC_EXTERN PetscErrorCode PetscViewerDrawSetBounds(PetscViewer, PetscInt, const PetscReal *);
PETSC_EXTERN PetscErrorCode PetscViewerDrawGetBounds(PetscViewer, PetscInt *, const PetscReal **);
PETSC_EXTERN PetscErrorCode PetscViewerSocketSetConnection(PetscViewer, const char[], int);
PETSC_EXTERN PetscErrorCode PetscViewerBinarySkipInfo(PetscViewer);
PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipInfo(PetscViewer, PetscBool);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipInfo(PetscViewer, PetscBool *);
PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipOptions(PetscViewer, PetscBool);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipOptions(PetscViewer, PetscBool *);
PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipHeader(PetscViewer, PetscBool);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipHeader(PetscViewer, PetscBool *);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryReadStringArray(PetscViewer, char ***);
PETSC_EXTERN PetscErrorCode PetscViewerBinaryWriteStringArray(PetscViewer, const char *const *);
PETSC_EXTERN PetscErrorCode PetscViewerFileSetName(PetscViewer, const char[]);
PETSC_EXTERN PetscErrorCode PetscViewerFileGetName(PetscViewer, const char **);
PETSC_EXTERN PetscErrorCode PetscViewerVUGetPointer(PetscViewer, FILE **);
PETSC_EXTERN PetscErrorCode PetscViewerVUSetVecSeen(PetscViewer, PetscBool);
PETSC_EXTERN PetscErrorCode PetscViewerVUGetVecSeen(PetscViewer, PetscBool *);
PETSC_EXTERN PetscErrorCode PetscViewerVUPrintDeferred(PetscViewer, const char[], ...) PETSC_ATTRIBUTE_FORMAT(2, 3);
PETSC_EXTERN PetscErrorCode PetscViewerVUFlushDeferred(PetscViewer);
/*@C
PetscViewerVUSetMode - Sets the mode in which to open the file.
Not Collective
Input Parameters:
+ viewer - The `PetscViewer`
- mode - The file mode
Level: deprecated
Note:
Use `PetscViewerFileSetMode()` instead.
.seealso: [](sec_viewers), `PetscViewer`, `PetscViewerFileSetMode()`
@*/
PETSC_DEPRECATED_FUNCTION(3, 15, 0, "PetscViewerFileSetMode()", ) static inline PetscErrorCode PetscViewerVUSetMode(PetscViewer viewer, PetscFileMode mode)
{
return PetscViewerFileSetMode(viewer, mode);
}
PETSC_EXTERN PetscErrorCode PetscViewerMathematicaInitializePackage(void);
PETSC_EXTERN PetscErrorCode PetscViewerMathematicaFinalizePackage(void);
PETSC_EXTERN PetscErrorCode PetscViewerMathematicaGetName(PetscViewer, const char **);
PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSetName(PetscViewer, const char[]);
PETSC_EXTERN PetscErrorCode PetscViewerMathematicaClearName(PetscViewer);
PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSkipPackets(PetscViewer, int);
PETSC_EXTERN PetscErrorCode PetscViewerSiloClearName(PetscViewer);
PETSC_EXTERN PetscErrorCode PetscViewerSiloClearMeshName(PetscViewer);
typedef enum {
PETSC_VTK_INVALID,
PETSC_VTK_POINT_FIELD,
PETSC_VTK_POINT_VECTOR_FIELD,
PETSC_VTK_CELL_FIELD,
PETSC_VTK_CELL_VECTOR_FIELD
} PetscViewerVTKFieldType;
PETSC_EXTERN PetscErrorCode PetscViewerVTKAddField(PetscViewer, PetscObject, PetscErrorCode (*PetscViewerVTKWriteFunction)(PetscObject, PetscViewer), PetscInt, PetscViewerVTKFieldType, PetscBool, PetscObject);
PETSC_EXTERN PetscErrorCode PetscViewerVTKGetDM(PetscViewer, PetscObject *);
PETSC_EXTERN PetscErrorCode PetscViewerVTKOpen(MPI_Comm, const char[], PetscFileMode, PetscViewer *);
/*
These are all the default viewers that do not have to be explicitly opened
*/
PETSC_EXTERN PetscViewer PETSC_VIEWER_STDOUT_(MPI_Comm);
PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStdout(MPI_Comm, PetscViewer *);
PETSC_EXTERN PetscViewer PETSC_VIEWER_STDERR_(MPI_Comm);
PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStderr(MPI_Comm, PetscViewer *);
PETSC_EXTERN PetscViewer PETSC_VIEWER_DRAW_(MPI_Comm);
PETSC_EXTERN PetscViewer PETSC_VIEWER_SOCKET_(MPI_Comm);
PETSC_EXTERN PetscViewer PETSC_VIEWER_BINARY_(MPI_Comm);
PETSC_EXTERN PetscViewer PETSC_VIEWER_MATLAB_(MPI_Comm);
PETSC_EXTERN PetscViewer PETSC_VIEWER_HDF5_(MPI_Comm);
PETSC_EXTERN PetscViewer PETSC_VIEWER_GLVIS_(MPI_Comm);
PETSC_EXTERN PetscViewer PETSC_VIEWER_EXODUSII_(MPI_Comm);
PETSC_EXTERN PetscViewer PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE;
/*MC
PETSC_VIEWER_STDERR_SELF - same as `PETSC_VIEWER_STDERR_`(PETSC_COMM_SELF)
Level: beginner
M*/
#define PETSC_VIEWER_STDERR_SELF PETSC_VIEWER_STDERR_(PETSC_COMM_SELF)
/*MC
PETSC_VIEWER_STDERR_WORLD - same as `PETSC_VIEWER_STDERR_`(PETSC_COMM_WORLD)
Level: beginner
M*/
#define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD)
/*MC
PETSC_VIEWER_STDOUT_WORLD - same as `PETSC_VIEWER_STDOUT_`(PETSC_COMM_WORLD)
Level: beginner
M*/
#define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
/*MC
PETSC_VIEWER_STDOUT_SELF - same as `PETSC_VIEWER_STDOUT_`(PETSC_COMM_SELF)
Level: beginner
M*/
#define PETSC_VIEWER_STDOUT_SELF PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
/*MC
PETSC_VIEWER_DRAW_WORLD - same as `PETSC_VIEWER_DRAW_`(PETSC_COMM_WORLD)
Level: intermediate
M*/
#define PETSC_VIEWER_DRAW_WORLD PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
/*MC
PETSC_VIEWER_DRAW_SELF - same as `PETSC_VIEWER_DRAW_`(PETSC_COMM_SELF)
Level: intermediate
M*/
#define PETSC_VIEWER_DRAW_SELF PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
/*MC
PETSC_VIEWER_SOCKET_WORLD - same as `PETSC_VIEWER_SOCKET_`(PETSC_COMM_WORLD)
Level: intermediate
M*/
#define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
/*MC
PETSC_VIEWER_SOCKET_SELF - same as `PETSC_VIEWER_SOCKET_`(PETSC_COMM_SELF)
Level: intermediate
M*/
#define PETSC_VIEWER_SOCKET_SELF PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
/*MC
PETSC_VIEWER_BINARY_WORLD - same as `PETSC_VIEWER_BINARY_`(PETSC_COMM_WORLD)
Level: intermediate
M*/
#define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
/*MC
PETSC_VIEWER_BINARY_SELF - same as `PETSC_VIEWER_BINARY_`(PETSC_COMM_SELF)
Level: intermediate
M*/
#define PETSC_VIEWER_BINARY_SELF PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
/*MC
PETSC_VIEWER_MATLAB_WORLD - same as `PETSC_VIEWER_MATLAB_`(PETSC_COMM_WORLD)
Level: intermediate
M*/
#define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
/*MC
PETSC_VIEWER_MATLAB_SELF - same as `PETSC_VIEWER_MATLAB_`(PETSC_COMM_SELF)
Level: intermediate
M*/
#define PETSC_VIEWER_MATLAB_SELF PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
#define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(), PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE)
PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStart(PetscViewer, PetscInt *, PetscInt *);
PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepMain(PetscViewer, PetscInt, PetscInt *, PetscInt);
PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndMain(PetscViewer, PetscInt *);
PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepWorker(PetscViewer, PetscMPIInt, PetscInt *);
PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndWorker(PetscViewer, PetscInt *);
PETSC_DEPRECATED_FUNCTION(3, 15, 0, "PetscViewerFlowControlStepMain()", ) static inline PetscErrorCode PetscViewerFlowControlStepMaster(PetscViewer viewer, PetscInt i, PetscInt *mcnt, PetscInt cnt)
{
return PetscViewerFlowControlStepMain(viewer, i, mcnt, cnt);
}
PETSC_DEPRECATED_FUNCTION(3, 15, 0, "PetscViewerFlowControlEndMain()", ) static inline PetscErrorCode PetscViewerFlowControlEndMaster(PetscViewer viewer, PetscInt *mcnt)
{
return PetscViewerFlowControlEndMain(viewer, mcnt);
}
/*
PetscViewer writes to MATLAB .mat file
*/
PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutArray(PetscViewer, int, int, const PetscScalar *, const char *);
PETSC_EXTERN PetscErrorCode PetscViewerMatlabGetArray(PetscViewer, int, int, PetscScalar *, const char *);
PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutVariable(PetscViewer, const char *, void *);
#if defined(PETSC_HAVE_SAWS)
PETSC_EXTERN PetscErrorCode PetscObjectViewSAWs(PetscObject, PetscViewer);
#endif
/*S
PetscViewers - Abstract collection of `PetscViewer`s. It is stored as an expandable array of viewers.
Level: intermediate
.seealso: [](sec_viewers), `PetscViewerCreate()`, `PetscViewerSetType()`, `PetscViewerType`, `PetscViewer`, `PetscViewersCreate()`,
`PetscViewersGetViewer()`
S*/
typedef struct _n_PetscViewers *PetscViewers;
PETSC_EXTERN PetscErrorCode PetscViewersCreate(MPI_Comm, PetscViewers *);
PETSC_EXTERN PetscErrorCode PetscViewersDestroy(PetscViewers *);
PETSC_EXTERN PetscErrorCode PetscViewersGetViewer(PetscViewers, PetscInt, PetscViewer *);