Actual source code: petscviewer.h
1: /*
2: PetscViewers are objects where other objects can be looked at or stored.
3: */
4: #pragma once
6: #include <petscviewertypes.h>
7: #include <petscoptionstypes.h>
8: #include <petscdrawtypes.h>
9: #include <stdio.h>
11: /* MANSEC = Sys */
12: /* SUBMANSEC = Viewer */
14: PETSC_EXTERN PetscClassId PETSC_VIEWER_CLASSID;
16: PETSC_EXTERN PetscFunctionList PetscViewerList;
17: PETSC_EXTERN PetscErrorCode PetscViewerInitializePackage(void);
18: PETSC_EXTERN PetscErrorCode PetscViewerFinalizePackage(void);
20: PETSC_EXTERN PetscErrorCode PetscViewerRegister(const char[], PetscErrorCode (*)(PetscViewer));
22: PETSC_EXTERN PetscErrorCode PetscViewerCreate(MPI_Comm, PetscViewer *);
23: PETSC_EXTERN PetscErrorCode PetscViewerSetFromOptions(PetscViewer);
24: PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpenWithFILE(MPI_Comm, FILE *, PetscViewer *);
26: PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpen(MPI_Comm, const char[], PetscViewer *);
27: PETSC_EXTERN PetscErrorCode PetscViewerASCIISetFILE(PetscViewer, FILE *);
28: PETSC_EXTERN PetscErrorCode PetscViewerBinaryOpen(MPI_Comm, const char[], PetscFileMode, PetscViewer *);
29: PETSC_EXTERN PetscErrorCode PetscViewerADIOSOpen(MPI_Comm, const char[], PetscFileMode, PetscViewer *);
30: PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetFlowControl(PetscViewer, PetscInt *);
31: PETSC_EXTERN PetscErrorCode PetscViewerBinarySetFlowControl(PetscViewer, PetscInt);
32: PETSC_EXTERN PetscErrorCode PetscViewerBinarySetUseMPIIO(PetscViewer, PetscBool);
33: PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetUseMPIIO(PetscViewer, PetscBool *);
34: #if PetscDefined(HAVE_MPIIO)
35: PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIODescriptor(PetscViewer, MPI_File *);
36: PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIOOffset(PetscViewer, MPI_Offset *);
37: PETSC_EXTERN PetscErrorCode PetscViewerBinaryAddMPIIOOffset(PetscViewer, MPI_Offset);
38: #endif
40: PETSC_EXTERN PetscErrorCode PetscViewerSocketOpen(MPI_Comm, const char[], int, PetscViewer *);
41: PETSC_EXTERN PetscErrorCode PetscViewerStringOpen(MPI_Comm, char[], size_t, PetscViewer *);
42: PETSC_EXTERN PetscErrorCode PetscViewerDrawOpen(MPI_Comm, const char[], const char[], int, int, int, int, PetscViewer *);
43: PETSC_EXTERN PetscErrorCode PetscViewerDrawSetDrawType(PetscViewer, PetscDrawType);
45: PETSC_EXTERN PetscErrorCode PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *);
46: PETSC_EXTERN PetscErrorCode PetscViewerMatlabOpen(MPI_Comm, const char[], PetscFileMode, PetscViewer *);
48: PETSC_EXTERN PetscErrorCode PetscViewerGLVisOpen(MPI_Comm, PetscViewerGLVisType, const char *, PetscInt, PetscViewer *);
49: PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetPrecision(PetscViewer, PetscInt);
50: PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetSnapId(PetscViewer, PetscInt);
51: PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetFields(PetscViewer, PetscInt, const char *[], PetscInt[], PetscErrorCode (*)(PetscObject, PetscInt, PetscObject[], void *), PetscObject[], void *, PetscCtxDestroyFn *);
53: PETSC_EXTERN PetscErrorCode PetscViewerGetType(PetscViewer, PetscViewerType *);
54: PETSC_EXTERN PetscErrorCode PetscViewerSetType(PetscViewer, PetscViewerType);
55: PETSC_EXTERN PetscErrorCode PetscViewerDestroy(PetscViewer *);
56: PETSC_EXTERN PetscErrorCode PetscViewerGetSubViewer(PetscViewer, MPI_Comm, PetscViewer *);
57: PETSC_EXTERN PetscErrorCode PetscViewerRestoreSubViewer(PetscViewer, MPI_Comm, PetscViewer *);
59: PETSC_EXTERN PetscErrorCode PetscViewerSetUp(PetscViewer);
60: PETSC_EXTERN PetscErrorCode PetscViewerView(PetscViewer, PetscViewer);
61: PETSC_EXTERN PetscErrorCode PetscViewerViewFromOptions(PetscViewer, PetscObject, const char[]);
63: PETSC_EXTERN PetscErrorCode PetscViewerSetOptionsPrefix(PetscViewer, const char[]);
64: PETSC_EXTERN PetscErrorCode PetscViewerAppendOptionsPrefix(PetscViewer, const char[]);
65: PETSC_EXTERN PetscErrorCode PetscViewerGetOptionsPrefix(PetscViewer, const char *[]);
67: PETSC_EXTERN PetscErrorCode PetscViewerReadable(PetscViewer, PetscBool *);
68: PETSC_EXTERN PetscErrorCode PetscViewerWritable(PetscViewer, PetscBool *);
69: PETSC_EXTERN PetscErrorCode PetscViewerCheckReadable(PetscViewer);
70: PETSC_EXTERN PetscErrorCode PetscViewerCheckWritable(PetscViewer);
72: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 7, 0, "PetscViewerPushFormat() / PetscViewerPopFormat()", ) PetscErrorCode PetscViewerSetFormat(PetscViewer, PetscViewerFormat);
73: PETSC_EXTERN PetscErrorCode PetscViewerPushFormat(PetscViewer, PetscViewerFormat);
74: PETSC_EXTERN PetscErrorCode PetscViewerPopFormat(PetscViewer);
75: PETSC_EXTERN PetscErrorCode PetscViewerGetFormat(PetscViewer, PetscViewerFormat *);
76: PETSC_EXTERN PetscErrorCode PetscViewerFlush(PetscViewer);
78: PETSC_EXTERN PetscErrorCode PetscOptionsPushCreateViewerOff(PetscBool);
79: PETSC_EXTERN PetscErrorCode PetscOptionsPopCreateViewerOff(void);
80: PETSC_EXTERN PetscErrorCode PetscOptionsGetCreateViewerOff(PetscBool *);
81: PETSC_EXTERN PetscErrorCode PetscOptionsCreateViewer(MPI_Comm, PetscOptions, const char[], const char[], PetscViewer *, PetscViewerFormat *, PetscBool *);
82: PETSC_EXTERN PetscErrorCode PetscOptionsCreateViewers(MPI_Comm, PetscOptions, const char[], const char[], PetscInt *, PetscViewer *, PetscViewerFormat *, PetscBool *);
83: /*MC
84: PetscOptionsViewer - From a `PetscOptionsBegin()`/`PetscOptionsEnd()` block, read a viewer specification from the options database and create the requested `PetscViewer`
86: Synopsis:
87: #include <petscviewer.h>
88: PetscErrorCode PetscOptionsViewer(const char opt[], const char text[], const char man[], PetscViewer *viewer, PetscViewerFormat *format, PetscBool *set)
90: Logically Collective
92: Input Parameters:
93: + opt - the option name, for example `-vec_view`
94: . text - help string shown by `-help`
95: - man - manual page name (the name of an `.html` file under the PETSc doc tree)
97: Output Parameters:
98: + viewer - the `PetscViewer` created, or `NULL` if the option was not given
99: . format - the `PetscViewerFormat` requested by the option, or the default
100: - set - `PETSC_TRUE` if the user supplied the option, `PETSC_FALSE` otherwise
102: Level: beginner
104: Notes:
105: See `PetscOptionsCreateViewer()` for the format of the viewer specification
107: Must be called between `PetscOptionsBegin()` and `PetscOptionsEnd()`; expands to a call to the internal `PetscOptionsViewer_Private()`, which has access to the current `PetscOptionsObject`. Destroy `viewer` with `PetscViewerDestroy()` when finished.
109: .seealso: `PetscOptionsCreateViewer()`, `PetscOptionsBegin()`, `PetscOptionsEnd()`, `PetscViewer`, `PetscViewerFormat`,
110: `PetscViewerDestroy()`
111: M*/
112: #define PetscOptionsViewer(a, b, c, d, e, f) PetscOptionsViewer_Private(PetscOptionsObject, a, b, c, d, e, f)
113: PETSC_EXTERN PetscErrorCode PetscOptionsViewer_Private(PetscOptionItems, const char[], const char[], const char[], PetscViewer *, PetscViewerFormat *, PetscBool *);
115: PETSC_DEPRECATED_FUNCTION(3, 22, 0, "PetscViewerDestroy()", ) static inline PetscErrorCode PetscOptionsRestoreViewer(PetscViewer *viewer)
116: {
117: return PetscViewerDestroy(viewer);
118: }
119: PETSC_DEPRECATED_FUNCTION(3, 22, 0, "PetscOptionsCreateViewer()", ) static inline PetscErrorCode PetscOptionsGetViewer(MPI_Comm comm, PetscOptions op, const char a[], const char b[], PetscViewer *v, PetscViewerFormat *f, PetscBool *fg)
120: {
121: return PetscOptionsCreateViewer(comm, op, a, b, v, f, fg);
122: }
123: PETSC_DEPRECATED_FUNCTION(3, 22, 0, "PetscOptionsCreateViewers()", ) static inline PetscErrorCode PetscOptionsGetViewers(MPI_Comm comm, PetscOptions op, const char a[], const char b[], PetscInt *n, PetscViewer *v, PetscViewerFormat *f, PetscBool *fg)
124: {
125: return PetscOptionsCreateViewers(comm, op, a, b, n, v, f, fg);
126: }
127: PETSC_DEPRECATED_FUNCTION(3, 22, 0, "PetscOptionsGetCreateViewerOff()", ) static inline PetscErrorCode PetscOptionsGetViewerOff(PetscBool *fg)
128: {
129: return PetscOptionsGetCreateViewerOff(fg);
130: }
131: PETSC_DEPRECATED_FUNCTION(3, 22, 0, "PetscOptionsPushCreateViewerOff()", ) static inline PetscErrorCode PetscOptionsPushGetViewerOff(PetscBool fg)
132: {
133: return PetscOptionsPushCreateViewerOff(fg);
134: }
135: PETSC_DEPRECATED_FUNCTION(3, 22, 0, "PetscOptionsPushCreateViewerOff()", ) static inline PetscErrorCode PetscOptionsPopGetViewerOff(void)
136: {
137: return PetscOptionsPopCreateViewerOff();
138: }
140: PETSC_EXTERN PetscErrorCode PetscViewerAndFormatCreate(PetscViewer, PetscViewerFormat, PetscViewerAndFormat **);
141: PETSC_EXTERN PetscErrorCode PetscViewerAndFormatDestroy(PetscViewerAndFormat **);
143: /*
144: Operations explicit to a particular class of viewers
145: */
147: PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetPointer(PetscViewer, FILE **);
148: PETSC_EXTERN PetscErrorCode PetscViewerFileGetMode(PetscViewer, PetscFileMode *);
149: PETSC_EXTERN PetscErrorCode PetscViewerFileSetMode(PetscViewer, PetscFileMode);
150: PETSC_EXTERN PetscErrorCode PetscViewerRead(PetscViewer, void *, PetscInt, PetscInt *, PetscDataType);
151: PETSC_EXTERN PetscErrorCode PetscViewerASCIIPrintf(PetscViewer, const char[], ...) PETSC_ATTRIBUTE_FORMAT(2, 3);
152: PETSC_EXTERN PetscErrorCode PetscViewerASCIISynchronizedPrintf(PetscViewer, const char[], ...) PETSC_ATTRIBUTE_FORMAT(2, 3);
153: PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushSynchronized(PetscViewer);
154: PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopSynchronized(PetscViewer);
155: PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushTab(PetscViewer);
156: PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopTab(PetscViewer);
157: PETSC_EXTERN PetscErrorCode PetscViewerASCIIUseTabs(PetscViewer, PetscBool);
158: PETSC_EXTERN PetscErrorCode PetscViewerASCIISetTab(PetscViewer, PetscInt);
159: PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetTab(PetscViewer, PetscInt *);
160: PETSC_EXTERN PetscErrorCode PetscViewerASCIIAddTab(PetscViewer, PetscInt);
161: PETSC_EXTERN PetscErrorCode PetscViewerASCIISubtractTab(PetscViewer, PetscInt);
162: PETSC_EXTERN PetscErrorCode PetscViewerASCIIRead(PetscViewer, void *, PetscInt, PetscInt *, PetscDataType);
163: PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetDescriptor(PetscViewer, int *);
164: PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetInfoPointer(PetscViewer, FILE **);
165: PETSC_EXTERN PetscErrorCode PetscViewerBinaryRead(PetscViewer, void *, PetscInt, PetscInt *, PetscDataType);
166: PETSC_EXTERN PetscErrorCode PetscViewerBinaryWrite(PetscViewer, const void *, PetscInt, PetscDataType);
167: PETSC_EXTERN PetscErrorCode PetscViewerBinaryReadAll(PetscViewer, void *, PetscCount, PetscCount, PetscCount, PetscDataType);
168: PETSC_EXTERN PetscErrorCode PetscViewerBinaryWriteAll(PetscViewer, const void *, PetscCount, PetscCount, PetscCount, PetscDataType);
169: PETSC_EXTERN PetscErrorCode PetscViewerStringSPrintf(PetscViewer, const char[], ...) PETSC_ATTRIBUTE_FORMAT(2, 3);
170: PETSC_EXTERN PetscErrorCode PetscViewerStringSetString(PetscViewer, char[], size_t);
171: PETSC_EXTERN PetscErrorCode PetscViewerStringGetStringRead(PetscViewer, const char *[], size_t *);
172: PETSC_EXTERN PetscErrorCode PetscViewerStringSetOwnString(PetscViewer);
173: PETSC_EXTERN PetscErrorCode PetscViewerDrawClear(PetscViewer);
174: PETSC_EXTERN PetscErrorCode PetscViewerDrawSetHold(PetscViewer, PetscBool);
175: PETSC_EXTERN PetscErrorCode PetscViewerDrawGetHold(PetscViewer, PetscBool *);
176: PETSC_EXTERN PetscErrorCode PetscViewerDrawSetPause(PetscViewer, PetscReal);
177: PETSC_EXTERN PetscErrorCode PetscViewerDrawGetPause(PetscViewer, PetscReal *);
178: PETSC_EXTERN PetscErrorCode PetscViewerDrawSetInfo(PetscViewer, const char[], const char[], int, int, int, int);
179: PETSC_EXTERN PetscErrorCode PetscViewerDrawResize(PetscViewer, int, int);
180: PETSC_EXTERN PetscErrorCode PetscViewerDrawSetBounds(PetscViewer, PetscInt, const PetscReal *);
181: PETSC_EXTERN PetscErrorCode PetscViewerDrawGetBounds(PetscViewer, PetscInt *, const PetscReal **);
182: PETSC_EXTERN PetscErrorCode PetscViewerSocketSetConnection(PetscViewer, const char[], int);
183: PETSC_EXTERN PetscErrorCode PetscViewerBinarySkipInfo(PetscViewer);
184: PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipInfo(PetscViewer, PetscBool);
185: PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipInfo(PetscViewer, PetscBool *);
186: PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipOptions(PetscViewer, PetscBool);
187: PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipOptions(PetscViewer, PetscBool *);
188: PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipHeader(PetscViewer, PetscBool);
189: PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipHeader(PetscViewer, PetscBool *);
190: PETSC_EXTERN PetscErrorCode PetscViewerBinaryReadStringArray(PetscViewer, char ***);
191: PETSC_EXTERN PetscErrorCode PetscViewerBinaryWriteStringArray(PetscViewer, const char *const *);
193: PETSC_EXTERN PetscErrorCode PetscViewerFileSetName(PetscViewer, const char[]);
194: PETSC_EXTERN PetscErrorCode PetscViewerFileGetName(PetscViewer, const char *[]);
196: PETSC_EXTERN PetscErrorCode PetscViewerVUGetPointer(PetscViewer, FILE **);
197: PETSC_EXTERN PetscErrorCode PetscViewerVUSetVecSeen(PetscViewer, PetscBool);
198: PETSC_EXTERN PetscErrorCode PetscViewerVUGetVecSeen(PetscViewer, PetscBool *);
199: PETSC_EXTERN PetscErrorCode PetscViewerVUPrintDeferred(PetscViewer, const char[], ...) PETSC_ATTRIBUTE_FORMAT(2, 3);
200: PETSC_EXTERN PetscErrorCode PetscViewerVUFlushDeferred(PetscViewer);
202: /*@
203: PetscViewerVUSetMode - Sets the mode in which to open the file.
205: Not Collective
207: Input Parameters:
208: + viewer - The `PetscViewer`
209: - mode - The file mode
211: Level: deprecated
213: Note:
214: Use `PetscViewerFileSetMode()` instead.
216: .seealso: [](sec_viewers), `PetscViewer`, `PetscViewerFileSetMode()`
217: @*/
218: PETSC_DEPRECATED_FUNCTION(3, 15, 0, "PetscViewerFileSetMode()", ) static inline PetscErrorCode PetscViewerVUSetMode(PetscViewer viewer, PetscFileMode mode)
219: {
220: return PetscViewerFileSetMode(viewer, mode);
221: }
223: PETSC_EXTERN PetscErrorCode PetscViewerMathematicaInitializePackage(void);
224: PETSC_EXTERN PetscErrorCode PetscViewerMathematicaFinalizePackage(void);
225: PETSC_EXTERN PetscErrorCode PetscViewerMathematicaGetName(PetscViewer, const char *[]);
226: PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSetName(PetscViewer, const char[]);
227: PETSC_EXTERN PetscErrorCode PetscViewerMathematicaClearName(PetscViewer);
228: PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSkipPackets(PetscViewer, int);
230: /*S
231: PetscViewerVTKWriteFn - A prototype of the function argument `PetscViewerVTKAddField()` that writes to the VTK file
233: Calling Sequence:
234: + obj - the `PetscObject` to write
235: - viewer - the `PetscViewer` of `PetscViewerType` `PETSCVIEWERVTK` to write to
237: Level: advanced
239: .seealso: `PetscViewer`, `PetscViewerType`, `PETSCVIEWERVTK`, `PetscViewerVTKAddField()`
240: S*/
241: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode PetscViewerVTKWriteFn(PetscObject obj, PetscViewer viewer);
243: PETSC_EXTERN PetscErrorCode PetscViewerVTKAddField(PetscViewer, PetscObject, PetscViewerVTKWriteFn *, PetscInt, PetscViewerVTKFieldType, PetscBool, PetscObject);
244: PETSC_EXTERN PetscErrorCode PetscViewerVTKGetDM(PetscViewer, PetscObject *);
245: PETSC_EXTERN PetscErrorCode PetscViewerVTKOpen(MPI_Comm, const char[], PetscFileMode, PetscViewer *);
247: /*
248: These are all the default viewers that do not have to be explicitly opened
249: */
250: PETSC_EXTERN PetscViewer PETSC_VIEWER_STDOUT_(MPI_Comm);
251: PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStdout(MPI_Comm, PetscViewer *);
252: PETSC_EXTERN PetscViewer PETSC_VIEWER_STDERR_(MPI_Comm);
253: PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStderr(MPI_Comm, PetscViewer *);
254: PETSC_EXTERN PetscViewer PETSC_VIEWER_DRAW_(MPI_Comm);
255: PETSC_EXTERN PetscViewer PETSC_VIEWER_SOCKET_(MPI_Comm);
256: PETSC_EXTERN PetscViewer PETSC_VIEWER_BINARY_(MPI_Comm);
257: PETSC_EXTERN PetscViewer PETSC_VIEWER_MATLAB_(MPI_Comm);
258: PETSC_EXTERN PetscViewer PETSC_VIEWER_HDF5_(MPI_Comm);
259: PETSC_EXTERN PetscViewer PETSC_VIEWER_GLVIS_(MPI_Comm);
260: PETSC_EXTERN PetscViewer PETSC_VIEWER_EXODUSII_(MPI_Comm);
261: PETSC_EXTERN PetscViewer PETSC_VIEWER_PYTHON_(MPI_Comm);
262: PETSC_EXTERN PetscViewer PETSC_VIEWER_PYVISTA_(MPI_Comm);
263: PETSC_EXTERN PetscViewer PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE;
265: /*MC
266: PETSC_VIEWER_STDERR_SELF - same as `PETSC_VIEWER_STDERR_`(PETSC_COMM_SELF)
268: Level: beginner
269: M*/
270: #define PETSC_VIEWER_STDERR_SELF PETSC_VIEWER_STDERR_(PETSC_COMM_SELF)
272: /*MC
273: PETSC_VIEWER_STDERR_WORLD - same as `PETSC_VIEWER_STDERR_`(PETSC_COMM_WORLD)
275: Level: beginner
276: M*/
277: #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD)
279: /*MC
280: PETSC_VIEWER_STDOUT_WORLD - same as `PETSC_VIEWER_STDOUT_`(PETSC_COMM_WORLD)
282: Level: beginner
283: M*/
284: #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
286: /*MC
287: PETSC_VIEWER_STDOUT_SELF - same as `PETSC_VIEWER_STDOUT_`(PETSC_COMM_SELF)
289: Level: beginner
290: M*/
291: #define PETSC_VIEWER_STDOUT_SELF PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
293: /*MC
294: PETSC_VIEWER_DRAW_WORLD - same as `PETSC_VIEWER_DRAW_`(PETSC_COMM_WORLD)
296: Level: intermediate
297: M*/
298: #define PETSC_VIEWER_DRAW_WORLD PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
300: /*MC
301: PETSC_VIEWER_DRAW_SELF - same as `PETSC_VIEWER_DRAW_`(PETSC_COMM_SELF)
303: Level: intermediate
304: M*/
305: #define PETSC_VIEWER_DRAW_SELF PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
307: /*MC
308: PETSC_VIEWER_SOCKET_WORLD - same as `PETSC_VIEWER_SOCKET_`(PETSC_COMM_WORLD)
310: Level: intermediate
311: M*/
312: #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
314: /*MC
315: PETSC_VIEWER_SOCKET_SELF - same as `PETSC_VIEWER_SOCKET_`(PETSC_COMM_SELF)
317: Level: intermediate
318: M*/
319: #define PETSC_VIEWER_SOCKET_SELF PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
321: /*MC
322: PETSC_VIEWER_BINARY_WORLD - same as `PETSC_VIEWER_BINARY_`(PETSC_COMM_WORLD)
324: Level: intermediate
325: M*/
326: #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
328: /*MC
329: PETSC_VIEWER_BINARY_SELF - same as `PETSC_VIEWER_BINARY_`(PETSC_COMM_SELF)
331: Level: intermediate
332: M*/
333: #define PETSC_VIEWER_BINARY_SELF PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
335: /*MC
336: PETSC_VIEWER_MATLAB_WORLD - same as `PETSC_VIEWER_MATLAB_`(PETSC_COMM_WORLD)
338: Level: intermediate
339: M*/
340: #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
342: /*MC
343: PETSC_VIEWER_MATLAB_SELF - same as `PETSC_VIEWER_MATLAB_`(PETSC_COMM_SELF)
345: Level: intermediate
346: M*/
347: #define PETSC_VIEWER_MATLAB_SELF PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
349: #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(), PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE)
351: PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStart(PetscViewer, PetscInt *, PetscInt *);
352: PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepMain(PetscViewer, PetscInt, PetscInt *, PetscInt);
353: PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndMain(PetscViewer, PetscInt *);
354: PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepWorker(PetscViewer, PetscMPIInt, PetscInt *);
355: PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndWorker(PetscViewer, PetscInt *);
356: PETSC_DEPRECATED_FUNCTION(3, 15, 0, "PetscViewerFlowControlStepMain()", ) static inline PetscErrorCode PetscViewerFlowControlStepMaster(PetscViewer viewer, PetscInt i, PetscInt *mcnt, PetscInt cnt)
357: {
358: return PetscViewerFlowControlStepMain(viewer, i, mcnt, cnt);
359: }
360: PETSC_DEPRECATED_FUNCTION(3, 15, 0, "PetscViewerFlowControlEndMain()", ) static inline PetscErrorCode PetscViewerFlowControlEndMaster(PetscViewer viewer, PetscInt *mcnt)
361: {
362: return PetscViewerFlowControlEndMain(viewer, mcnt);
363: }
365: /*
366: PetscViewer writes to MATLAB .mat file
367: */
368: PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutArray(PetscViewer, int, int, const PetscScalar *, const char *);
369: PETSC_EXTERN PetscErrorCode PetscViewerMatlabGetArray(PetscViewer, int, int, PetscScalar *, const char *);
370: PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutVariable(PetscViewer, const char *, void *);
372: #if PetscDefined(HAVE_SAWS)
373: PETSC_EXTERN PetscErrorCode PetscObjectViewSAWs(PetscObject, PetscViewer);
374: #endif
376: PETSC_EXTERN PetscErrorCode PetscViewerPythonSetType(PetscViewer, const char[]);
377: PETSC_EXTERN PetscErrorCode PetscViewerPythonGetType(PetscViewer, const char *[]);
378: PETSC_EXTERN PetscErrorCode PetscViewerPythonCreate(MPI_Comm, const char[], PetscViewer *);
379: PETSC_EXTERN PetscErrorCode PetscViewerPythonViewObject(PetscViewer, PetscObject);
381: PETSC_EXTERN PetscErrorCode PetscViewerMonitorLGSetUp(PetscViewer, const char[], const char[], const char[], PetscInt, const char *[], int, int, int, int);
383: PETSC_EXTERN PetscErrorCode PetscViewersCreate(MPI_Comm, PetscViewers *);
384: PETSC_EXTERN PetscErrorCode PetscViewersDestroy(PetscViewers *);
385: PETSC_EXTERN PetscErrorCode PetscViewersGetViewer(PetscViewers, PetscInt, PetscViewer *);
387: PETSC_EXTERN PetscErrorCode PetscViewerCGNSOpen(MPI_Comm, const char[], PetscFileMode, PetscViewer *);
388: PETSC_EXTERN PetscErrorCode PetscViewerCGNSSetSolutionIndex(PetscViewer, PetscInt);
389: PETSC_EXTERN PetscErrorCode PetscViewerCGNSGetSolutionIndex(PetscViewer, PetscInt *);
390: PETSC_EXTERN PetscErrorCode PetscViewerCGNSGetSolutionTime(PetscViewer, PetscReal *, PetscBool *);
391: PETSC_EXTERN PetscErrorCode PetscViewerCGNSGetSolutionIteration(PetscViewer, PetscInt *, PetscBool *);
392: PETSC_EXTERN PetscErrorCode PetscViewerCGNSGetSolutionName(PetscViewer, const char *[]);
393: PETSC_EXTERN PetscErrorCode PetscViewerCGNSGetDescriptors(PetscViewer, PetscInt *, char ***, char ***);
394: PETSC_EXTERN PetscErrorCode PetscViewerCGNSRestoreDescriptors(PetscViewer, PetscInt *, char ***, char ***);
395: PETSC_EXTERN PetscErrorCode PetscViewerCGNSSetDescriptor(PetscViewer, const char[], const char[]);
397: PETSC_EXTERN PetscErrorCode PetscViewerExodusIIOpen(MPI_Comm, const char[], PetscFileMode, PetscViewer *);
398: PETSC_EXTERN PetscErrorCode PetscViewerExodusIIGetNodalVariableIndex(PetscViewer, const char[], PetscExodusIIInt *);
399: PETSC_EXTERN PetscErrorCode PetscViewerExodusIIGetZonalVariableIndex(PetscViewer, const char[], PetscExodusIIInt *);
400: PETSC_EXTERN PetscErrorCode PetscViewerExodusIIGetId(PetscViewer, PetscExodusIIInt *);
401: PETSC_EXTERN PetscErrorCode PetscViewerExodusIISetOrder(PetscViewer, PetscInt);
402: PETSC_EXTERN PetscErrorCode PetscViewerExodusIIGetOrder(PetscViewer, PetscInt *);
403: PETSC_EXTERN PetscErrorCode PetscViewerExodusIISetZonalVariable(PetscViewer, PetscExodusIIInt);
404: PETSC_EXTERN PetscErrorCode PetscViewerExodusIISetNodalVariable(PetscViewer, PetscExodusIIInt);
405: PETSC_EXTERN PetscErrorCode PetscViewerExodusIIGetZonalVariable(PetscViewer, PetscExodusIIInt *);
406: PETSC_EXTERN PetscErrorCode PetscViewerExodusIIGetNodalVariable(PetscViewer, PetscExodusIIInt *);
407: PETSC_EXTERN PetscErrorCode PetscViewerExodusIISetZonalVariableName(PetscViewer, PetscExodusIIInt, const char[]);
408: PETSC_EXTERN PetscErrorCode PetscViewerExodusIISetNodalVariableName(PetscViewer, PetscExodusIIInt, const char[]);
409: PETSC_EXTERN PetscErrorCode PetscViewerExodusIIGetZonalVariableName(PetscViewer, PetscExodusIIInt, const char *[]);
410: PETSC_EXTERN PetscErrorCode PetscViewerExodusIIGetNodalVariableName(PetscViewer, PetscExodusIIInt, const char *[]);
411: PETSC_EXTERN PetscErrorCode PetscViewerExodusIISetZonalVariableNames(PetscViewer, const char *const[]);
412: PETSC_EXTERN PetscErrorCode PetscViewerExodusIISetNodalVariableNames(PetscViewer, const char *const[]);
413: PETSC_EXTERN PetscErrorCode PetscViewerExodusIIGetZonalVariableNames(PetscViewer, PetscExodusIIInt *, const char *const *[]);
414: PETSC_EXTERN PetscErrorCode PetscViewerExodusIIGetNodalVariableNames(PetscViewer, PetscExodusIIInt *, const char *const *[]);