184cb2905SBarry Smith /* 2b0a32e0cSBarry Smith PetscViewers are objects where other objects can be looked at or stored. 384cb2905SBarry Smith */ 4a4963045SJacob Faibussowitsch #pragma once 5dfbe8321SBarry Smith 66420c192SJed Brown #include <petscsys.h> 7c619b03eSJed Brown #include <petscviewertypes.h> 80954c5ccSStefano Zampini #include <petscdrawtypes.h> 9e9fa29b7SSatish Balay 10ac09b921SBarry Smith /* SUBMANSEC = Viewer */ 11ac09b921SBarry Smith 12014dd563SJed Brown PETSC_EXTERN PetscClassId PETSC_VIEWER_CLASSID; 13e9fa29b7SSatish Balay 1476bdecfbSBarry Smith /*J 1587497f52SBarry Smith PetscViewerType - String with the name of a PETSc `PetscViewer` implementation 16b9617806SBarry Smith 17b9617806SBarry Smith Level: beginner 18b9617806SBarry Smith 19d1f92df0SBarry Smith .seealso: [](sec_viewers), `PetscViewerSetType()`, `PetscViewer`, `PetscViewerRegister()`, `PetscViewerCreate()` 2076bdecfbSBarry Smith J*/ 2119fd82e9SBarry Smith typedef const char *PetscViewerType; 222692d6eeSBarry Smith #define PETSCVIEWERSOCKET "socket" 232692d6eeSBarry Smith #define PETSCVIEWERASCII "ascii" 242692d6eeSBarry Smith #define PETSCVIEWERBINARY "binary" 252692d6eeSBarry Smith #define PETSCVIEWERSTRING "string" 262692d6eeSBarry Smith #define PETSCVIEWERDRAW "draw" 272692d6eeSBarry Smith #define PETSCVIEWERVU "vu" 282692d6eeSBarry Smith #define PETSCVIEWERMATHEMATICA "mathematica" 292692d6eeSBarry Smith #define PETSCVIEWERHDF5 "hdf5" 304061b8bfSJed Brown #define PETSCVIEWERVTK "vtk" 312692d6eeSBarry Smith #define PETSCVIEWERMATLAB "matlab" 32e04113cfSBarry Smith #define PETSCVIEWERSAWS "saws" 338135c375SStefano Zampini #define PETSCVIEWERGLVIS "glvis" 344c02969dSBarry Smith #define PETSCVIEWERADIOS "adios" 351e50132fSMatthew G. Knepley #define PETSCVIEWEREXODUSII "exodusii" 365f34f2dcSJed Brown #define PETSCVIEWERCGNS "cgns" 3777ed5343SBarry Smith 38140e18c1SBarry Smith PETSC_EXTERN PetscFunctionList PetscViewerList; 39607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerInitializePackage(void); 404bf303faSJacob Faibussowitsch PETSC_EXTERN PetscErrorCode PetscViewerFinalizePackage(void); 417b2a1423SBarry Smith 42bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerRegister(const char[], PetscErrorCode (*)(PetscViewer)); 4330de9b25SBarry Smith 44014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerCreate(MPI_Comm, PetscViewer *); 45014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetFromOptions(PetscViewer); 46014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpenWithFILE(MPI_Comm, FILE *, PetscViewer *); 477b2a1423SBarry Smith 48014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpen(MPI_Comm, const char[], PetscViewer *); 49014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISetFILE(PetscViewer, FILE *); 50014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryOpen(MPI_Comm, const char[], PetscFileMode, PetscViewer *); 51a56f64adSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerADIOSOpen(MPI_Comm, const char[], PetscFileMode, PetscViewer *); 52014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetFlowControl(PetscViewer, PetscInt *); 53014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetFlowControl(PetscViewer, PetscInt); 54bc196f7cSDave May PETSC_EXTERN PetscErrorCode PetscViewerBinarySetUseMPIIO(PetscViewer, PetscBool); 55bc196f7cSDave May PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetUseMPIIO(PetscViewer, PetscBool *); 560fc9d207SBarry Smith #if defined(PETSC_HAVE_MPIIO) 57014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIODescriptor(PetscViewer, MPI_File *); 58014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIOOffset(PetscViewer, MPI_Offset *); 59014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryAddMPIIOOffset(PetscViewer, MPI_Offset); 60951e3c8eSBarry Smith #endif 6139802e9eSBarry Smith 62014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSocketOpen(MPI_Comm, const char[], int, PetscViewer *); 6389d949e2SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringOpen(MPI_Comm, char[], size_t, PetscViewer *); 64014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawOpen(MPI_Comm, const char[], const char[], int, int, int, int, PetscViewer *); 65d1da0b69SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerDrawSetDrawType(PetscViewer, PetscDrawType); 661f49e1f7SLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDrawType(PetscViewer, PetscDrawType *); 67f55236e4SLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerDrawSetTitle(PetscViewer, const char[]); 68f55236e4SLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerDrawGetTitle(PetscViewer, const char *[]); 690954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDraw(PetscViewer, PetscInt, PetscDraw *); 700954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawBaseAdd(PetscViewer, PetscInt); 710954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawBaseSet(PetscViewer, PetscInt); 720954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDrawLG(PetscViewer, PetscInt, PetscDrawLG *); 730954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDrawAxis(PetscViewer, PetscInt, PetscDrawAxis *); 740954c5ccSStefano Zampini 75014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *); 76014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabOpen(MPI_Comm, const char[], PetscFileMode, PetscViewer *); 774b0e389bSBarry Smith 788135c375SStefano Zampini /*E 793f423023SBarry Smith PetscViewerGLVisType - indicates what type of `PETSCVIEWERGLVIS` viewer to use 808135c375SStefano Zampini 813f423023SBarry Smith Values: 823f423023SBarry Smith + `PETSC_VIEWER_GLVIS_DUMP` - save the data to a file 833f423023SBarry Smith - `PETSC_VIEWER_GLVIS_SOCKET` - communicate the data to another program via a socket 843f423023SBarry Smith 8516a05f60SBarry Smith Level: beginner 8616a05f60SBarry Smith 873f423023SBarry Smith .seealso: [](sec_viewers), `PETSCVIEWERGLVIS`, `PetscViewerGLVisOpen()` 888135c375SStefano Zampini E*/ 899371c9d4SSatish Balay typedef enum { 909371c9d4SSatish Balay PETSC_VIEWER_GLVIS_DUMP, 919371c9d4SSatish Balay PETSC_VIEWER_GLVIS_SOCKET 929371c9d4SSatish Balay } PetscViewerGLVisType; 938135c375SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisOpen(MPI_Comm, PetscViewerGLVisType, const char *, PetscInt, PetscViewer *); 9477eacf09SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetPrecision(PetscViewer, PetscInt); 958135c375SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetSnapId(PetscViewer, PetscInt); 964cac2994SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetFields(PetscViewer, PetscInt, const char *[], PetscInt[], PetscErrorCode (*)(PetscObject, PetscInt, PetscObject[], void *), PetscObject[], void *, PetscErrorCode (*)(void *)); 978135c375SStefano Zampini 9819fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerGetType(PetscViewer, PetscViewerType *); 9919fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerSetType(PetscViewer, PetscViewerType); 100014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDestroy(PetscViewer *); 1013f08860eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerGetSubViewer(PetscViewer, MPI_Comm, PetscViewer *); 1023f08860eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerRestoreSubViewer(PetscViewer, MPI_Comm, PetscViewer *); 103ae39576cSLois Curfman McInnes 104014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetUp(PetscViewer); 105014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerView(PetscViewer, PetscViewer); 106fe2efc57SMark PETSC_EXTERN PetscErrorCode PetscViewerViewFromOptions(PetscViewer, PetscObject, const char[]); 107f69a0ea3SMatthew Knepley 108014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetOptionsPrefix(PetscViewer, const char[]); 109014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerAppendOptionsPrefix(PetscViewer, const char[]); 110014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerGetOptionsPrefix(PetscViewer, const char *[]); 111090de74eSSatish Balay 112e24fdd67SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerReadable(PetscViewer, PetscBool *); 113e24fdd67SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerWritable(PetscViewer, PetscBool *); 114d01f05b1SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerCheckReadable(PetscViewer); 115d01f05b1SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerCheckWritable(PetscViewer); 116e24fdd67SVaclav Hapla 117edd03b47SJacob Faibussowitsch #define PETSC_VIEWER_ASCII_VTK_ATTR PETSC_VIEWER_ASCII_VTK PETSC_DEPRECATED_ENUM(3, 14, 0, "PetscViewerVTKOpen() with XML (.vtr.vts.vtu) format", ) 118edd03b47SJacob Faibussowitsch #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", ) 119edd03b47SJacob Faibussowitsch #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", ) 120b9617806SBarry Smith /*E 121b9617806SBarry Smith PetscViewerFormat - Way a viewer presents the object 122b9617806SBarry Smith 1233f423023SBarry Smith Values: 1243f423023SBarry Smith + `PETSC_VIEWER_DEFAULT` - default format for the specific object being viewed 1253f423023SBarry Smith . `PETSC_VIEWER_ASCII_MATLAB` - MATLAB format 126af27ebaaSBarry Smith . `PETSC_VIEWER_ASCII_DENSE` - print matrix as a dense two dimensiona array 127af27ebaaSBarry Smith . `PETSC_VIEWER_ASCII_IMPL` - implementation-specific format (which is in many cases the same as the default) 1283f423023SBarry Smith . `PETSC_VIEWER_ASCII_INFO` - basic information about object 129bd6a2ce3SJunchao Zhang . `PETSC_VIEWER_ASCII_INFO_DETAIL` - more detailed info about object (but still not vector or matrix entries) 130af27ebaaSBarry Smith . `PETSC_VIEWER_ASCII_COMMON` - identical output format for all objects of a particular type 131af27ebaaSBarry Smith . `PETSC_VIEWER_ASCII_INDEX` - (for vectors) prints the vector element number next to each vector entry 132af27ebaaSBarry Smith . `PETSC_VIEWER_ASCII_SYMMODU` - print parallel vectors without indicating the MPI process ranges that own the entries 1333f423023SBarry Smith . `PETSC_VIEWER_ASCII_VTK` - outputs the object to a VTK file (deprecated since v3.14) 134af27ebaaSBarry Smith . `PETSC_VIEWER_NATIVE` - store the object to the binary file in its native format (for example, dense 1353f423023SBarry Smith matrices are stored as dense), `DMDA` vectors are dumped directly to the 1363f423023SBarry Smith file instead of being first put in the natural ordering 1373f423023SBarry Smith . `PETSC_VIEWER_ASCII_LATEX` - output the data in LaTeX 1383f423023SBarry Smith . `PETSC_VIEWER_BINARY_MATLAB` - output additional information that can be used to read the data into MATLAB 1393f423023SBarry Smith . `PETSC_VIEWER_DRAW_BASIC` - views the vector with a simple 1d plot 1403f423023SBarry Smith . `PETSC_VIEWER_DRAW_LG` - views the vector with a line graph 1413f423023SBarry Smith - `PETSC_VIEWER_DRAW_CONTOUR` - views the vector with a contour plot 1423f423023SBarry Smith 14316a05f60SBarry Smith Level: beginner 14416a05f60SBarry Smith 1453f423023SBarry Smith Note: 1463f423023SBarry Smith A variety of specialized formats also exist 1473f423023SBarry Smith 148d1f92df0SBarry Smith .seealso: [](sec_viewers), `PetscViewer`, `PetscViewerType`, `PetscViewerPushFormat()`, `PetscViewerPopFormat()` 149b9617806SBarry Smith E*/ 150fb9695e5SSatish Balay typedef enum { 151117016b1SBarry Smith PETSC_VIEWER_DEFAULT, 152f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_MATLAB, 1534ebda54eSMatthew Knepley PETSC_VIEWER_ASCII_MATHEMATICA, 154f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_IMPL, 155f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_INFO, 156456192e2SBarry Smith PETSC_VIEWER_ASCII_INFO_DETAIL, 157f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_COMMON, 158f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_SYMMODU, 159f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_INDEX, 160f3ef73ceSBarry Smith PETSC_VIEWER_ASCII_DENSE, 1613c215bfdSMatthew Knepley PETSC_VIEWER_ASCII_MATRIXMARKET, 1628ec8862eSJed Brown PETSC_VIEWER_ASCII_VTK_DEPRECATED, 1638ec8862eSJed Brown PETSC_VIEWER_ASCII_VTK_ATTR = PETSC_VIEWER_ASCII_VTK_DEPRECATED, 1648ec8862eSJed Brown PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED, 1658ec8862eSJed Brown PETSC_VIEWER_ASCII_VTK_CELL_ATTR = PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED, 1668ec8862eSJed Brown PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED, 1678ec8862eSJed Brown PETSC_VIEWER_ASCII_VTK_COORDS_ATTR = PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED, 168493617b5SMatthew Knepley PETSC_VIEWER_ASCII_PCICE, 169cfaaf4edSHong Zhang PETSC_VIEWER_ASCII_PYTHON, 170cfaaf4edSHong Zhang PETSC_VIEWER_ASCII_FACTOR_INFO, 17167ad5babSMatthew G Knepley PETSC_VIEWER_ASCII_LATEX, 172bb1d7374SBarry Smith PETSC_VIEWER_ASCII_XML, 173d0a29bd7SConnor Ward PETSC_VIEWER_ASCII_FLAMEGRAPH, 1748135c375SStefano Zampini PETSC_VIEWER_ASCII_GLVIS, 17538144912Sdeepblu2718 PETSC_VIEWER_ASCII_CSV, 176f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_BASIC, 177f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_LG, 178bb046f40SHong Zhang PETSC_VIEWER_DRAW_LG_XRANGE, 179f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_CONTOUR, 180f3ef73ceSBarry Smith PETSC_VIEWER_DRAW_PORTS, 1814061b8bfSJed Brown PETSC_VIEWER_VTK_VTS, 182a13bc4e3SShao-Ching Huang PETSC_VIEWER_VTK_VTR, 183b263465dSJed Brown PETSC_VIEWER_VTK_VTU, 184a261c58fSBarry Smith PETSC_VIEWER_BINARY_MATLAB, 185f3ef73ceSBarry Smith PETSC_VIEWER_NATIVE, 1868aa4816bSVaclav Hapla PETSC_VIEWER_HDF5_PETSC, 187ffe0aed0SMatthew G. Knepley PETSC_VIEWER_HDF5_VIZ, 1888aa4816bSVaclav Hapla PETSC_VIEWER_HDF5_XDMF, 189cbb4c999SVaclav Hapla PETSC_VIEWER_HDF5_MAT, 190ef5fdb51SBarry Smith PETSC_VIEWER_NOFORMAT, 191eafd5ff0SAlex Lindsay PETSC_VIEWER_LOAD_BALANCE, 1927962402dSFande Kong PETSC_VIEWER_FAILED, 1937962402dSFande Kong PETSC_VIEWER_ALL 194cfaaf4edSHong Zhang } PetscViewerFormat; 195014dd563SJed Brown PETSC_EXTERN const char *const PetscViewerFormats[]; 196090de74eSSatish Balay 197edd03b47SJacob Faibussowitsch PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 7, 0, "PetscViewerPushFormat() / PetscViewerPopFormat()", ) PetscErrorCode PetscViewerSetFormat(PetscViewer, PetscViewerFormat); 198014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerPushFormat(PetscViewer, PetscViewerFormat); 199014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerPopFormat(PetscViewer); 200014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerGetFormat(PetscViewer, PetscViewerFormat *); 201014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFlush(PetscViewer); 2024b0e389bSBarry Smith 203648c30bcSBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsPushCreateViewerOff(PetscBool); 204648c30bcSBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsPopCreateViewerOff(void); 205648c30bcSBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsGetCreateViewerOff(PetscBool *); 206648c30bcSBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsCreateViewer(MPI_Comm, PetscOptions, const char[], const char[], PetscViewer *, PetscViewerFormat *, PetscBool *); 207648c30bcSBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsCreateViewers(MPI_Comm, PetscOptions, const char[], const char[], PetscInt *, PetscViewer *, PetscViewerFormat *, PetscBool *); 208e83a5d19SLisandro Dalcin #define PetscOptionsViewer(a, b, c, d, e, f) PetscOptionsViewer_Private(PetscOptionsObject, a, b, c, d, e, f) 2094416b707SBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsViewer_Private(PetscOptionItems *, const char[], const char[], const char[], PetscViewer *, PetscViewerFormat *, PetscBool *); 210648c30bcSBarry Smith 211648c30bcSBarry Smith PETSC_DEPRECATED_FUNCTION(3, 22, 0, "PetscViewerDestroy()", ) static inline PetscErrorCode PetscOptionsRestoreViewer(PetscViewer *viewer) 212648c30bcSBarry Smith { 213648c30bcSBarry Smith return PetscViewerDestroy(viewer); 214648c30bcSBarry Smith } 215648c30bcSBarry Smith 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) 216648c30bcSBarry Smith { 217648c30bcSBarry Smith return PetscOptionsCreateViewer(comm, op, a, b, v, f, fg); 218648c30bcSBarry Smith } 219648c30bcSBarry Smith 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) 220648c30bcSBarry Smith { 221648c30bcSBarry Smith return PetscOptionsCreateViewers(comm, op, a, b, n, v, f, fg); 222648c30bcSBarry Smith } 223648c30bcSBarry Smith PETSC_DEPRECATED_FUNCTION(3, 22, 0, "PetscOptionsGetCreateViewerOff()", ) static inline PetscErrorCode PetscOptionsGetViewerOff(PetscBool *fg) 224648c30bcSBarry Smith { 225648c30bcSBarry Smith return PetscOptionsGetCreateViewerOff(fg); 226648c30bcSBarry Smith } 227648c30bcSBarry Smith PETSC_DEPRECATED_FUNCTION(3, 22, 0, "PetscOptionsPushCreateViewerOff()", ) static inline PetscErrorCode PetscOptionsPushGetViewerOff(PetscBool fg) 228648c30bcSBarry Smith { 229648c30bcSBarry Smith return PetscOptionsPushCreateViewerOff(fg); 230648c30bcSBarry Smith } 231648c30bcSBarry Smith PETSC_DEPRECATED_FUNCTION(3, 22, 0, "PetscOptionsPushCreateViewerOff()", ) static inline PetscErrorCode PetscOptionsPopGetViewerOff(void) 232648c30bcSBarry Smith { 233648c30bcSBarry Smith return PetscOptionsPopCreateViewerOff(); 234648c30bcSBarry Smith } 2352bf49c77SBarry Smith 2369371c9d4SSatish Balay typedef struct { 2379371c9d4SSatish Balay PetscViewer viewer; 2389371c9d4SSatish Balay PetscViewerFormat format; 2399371c9d4SSatish Balay PetscDrawLG lg; 2409812b6beSJed Brown PetscInt view_interval; 2419371c9d4SSatish Balay void *data; 2429371c9d4SSatish Balay } PetscViewerAndFormat; 243d7cbc13eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerAndFormatCreate(PetscViewer, PetscViewerFormat, PetscViewerAndFormat **); 244fe01d993SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerAndFormatDestroy(PetscViewerAndFormat **); 245fe01d993SBarry Smith 24677ed5343SBarry Smith /* 24777ed5343SBarry Smith Operations explicit to a particular class of viewers 24877ed5343SBarry Smith */ 249ed5c6e3eSMatthew Knepley 250014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetPointer(PetscViewer, FILE **); 251014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileGetMode(PetscViewer, PetscFileMode *); 252014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileSetMode(PetscViewer, PetscFileMode); 253060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerRead(PetscViewer, void *, PetscInt, PetscInt *, PetscDataType); 2543ca90d2dSJacob Faibussowitsch PETSC_EXTERN PetscErrorCode PetscViewerASCIIPrintf(PetscViewer, const char[], ...) PETSC_ATTRIBUTE_FORMAT(2, 3); 2553ca90d2dSJacob Faibussowitsch PETSC_EXTERN PetscErrorCode PetscViewerASCIISynchronizedPrintf(PetscViewer, const char[], ...) PETSC_ATTRIBUTE_FORMAT(2, 3); 2561575c14dSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushSynchronized(PetscViewer); 2571575c14dSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopSynchronized(PetscViewer); 258014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushTab(PetscViewer); 259014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopTab(PetscViewer); 260014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIUseTabs(PetscViewer, PetscBool); 261014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISetTab(PetscViewer, PetscInt); 262014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetTab(PetscViewer, PetscInt *); 263014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIAddTab(PetscViewer, PetscInt); 264014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISubtractTab(PetscViewer, PetscInt); 265060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerASCIIRead(PetscViewer, void *, PetscInt, PetscInt *, PetscDataType); 266014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetDescriptor(PetscViewer, int *); 267014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetInfoPointer(PetscViewer, FILE **); 268060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerBinaryRead(PetscViewer, void *, PetscInt, PetscInt *, PetscDataType); 269f253e43cSLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerBinaryWrite(PetscViewer, const void *, PetscInt, PetscDataType); 270*3e1d7bceSPierre Jolivet PETSC_EXTERN PetscErrorCode PetscViewerBinaryReadAll(PetscViewer, void *, PetscCount, PetscCount, PetscCount, PetscDataType); 2716497c311SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerBinaryWriteAll(PetscViewer, const void *, PetscCount, PetscCount, PetscCount, PetscDataType); 2723ca90d2dSJacob Faibussowitsch PETSC_EXTERN PetscErrorCode PetscViewerStringSPrintf(PetscViewer, const char[], ...) PETSC_ATTRIBUTE_FORMAT(2, 3); 27336a9e3b9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringSetString(PetscViewer, char[], size_t); 27436a9e3b9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringGetStringRead(PetscViewer, const char *[], size_t *); 27536a9e3b9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringSetOwnString(PetscViewer); 276014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawClear(PetscViewer); 277014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetHold(PetscViewer, PetscBool); 278014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetHold(PetscViewer, PetscBool *); 279014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetPause(PetscViewer, PetscReal); 280014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetPause(PetscViewer, PetscReal *); 281014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetInfo(PetscViewer, const char[], const char[], int, int, int, int); 282014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawResize(PetscViewer, int, int); 283014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetBounds(PetscViewer, PetscInt, const PetscReal *); 284014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetBounds(PetscViewer, PetscInt *, const PetscReal **); 285014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSocketSetConnection(PetscViewer, const char[], int); 286014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySkipInfo(PetscViewer); 287807ea322SDave May PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipInfo(PetscViewer, PetscBool); 288807ea322SDave May PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipInfo(PetscViewer, PetscBool *); 289014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipOptions(PetscViewer, PetscBool); 290014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipOptions(PetscViewer, PetscBool *); 291014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipHeader(PetscViewer, PetscBool); 292014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipHeader(PetscViewer, PetscBool *); 293014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryReadStringArray(PetscViewer, char ***); 29478fbdcc8SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerBinaryWriteStringArray(PetscViewer, const char *const *); 295c655490fSBarry Smith 296014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileSetName(PetscViewer, const char[]); 297014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileGetName(PetscViewer, const char **); 29877ed5343SBarry Smith 299014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUGetPointer(PetscViewer, FILE **); 300014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUSetVecSeen(PetscViewer, PetscBool); 301014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUGetVecSeen(PetscViewer, PetscBool *); 3023ca90d2dSJacob Faibussowitsch PETSC_EXTERN PetscErrorCode PetscViewerVUPrintDeferred(PetscViewer, const char[], ...) PETSC_ATTRIBUTE_FORMAT(2, 3); 303014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUFlushDeferred(PetscViewer); 30455dcf840SMatthew Knepley 3057e4fd573SVaclav Hapla /*@C 3067e4fd573SVaclav Hapla PetscViewerVUSetMode - Sets the mode in which to open the file. 3077e4fd573SVaclav Hapla 3087e4fd573SVaclav Hapla Not Collective 3097e4fd573SVaclav Hapla 3107e4fd573SVaclav Hapla Input Parameters: 31187497f52SBarry Smith + viewer - The `PetscViewer` 3127e4fd573SVaclav Hapla - mode - The file mode 3137e4fd573SVaclav Hapla 3147e4fd573SVaclav Hapla Level: deprecated 3157e4fd573SVaclav Hapla 3167e4fd573SVaclav Hapla Note: 31787497f52SBarry Smith Use `PetscViewerFileSetMode()` instead. 3187e4fd573SVaclav Hapla 3193f423023SBarry Smith .seealso: [](sec_viewers), `PetscViewer`, `PetscViewerFileSetMode()` 3207e4fd573SVaclav Hapla @*/ 321edd03b47SJacob Faibussowitsch PETSC_DEPRECATED_FUNCTION(3, 15, 0, "PetscViewerFileSetMode()", ) static inline PetscErrorCode PetscViewerVUSetMode(PetscViewer viewer, PetscFileMode mode) 322d71ae5a4SJacob Faibussowitsch { 3239371c9d4SSatish Balay return PetscViewerFileSetMode(viewer, mode); 3249371c9d4SSatish Balay } 3257e4fd573SVaclav Hapla 326607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerMathematicaInitializePackage(void); 327014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaFinalizePackage(void); 328014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaGetName(PetscViewer, const char **); 329014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSetName(PetscViewer, const char[]); 330014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaClearName(PetscViewer); 331014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSkipPackets(PetscViewer, int); 3324ebda54eSMatthew Knepley 333014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloClearName(PetscViewer); 334014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloClearMeshName(PetscViewer); 3354ebda54eSMatthew Knepley 3369371c9d4SSatish Balay typedef enum { 3379371c9d4SSatish Balay PETSC_VTK_INVALID, 3389371c9d4SSatish Balay PETSC_VTK_POINT_FIELD, 3399371c9d4SSatish Balay PETSC_VTK_POINT_VECTOR_FIELD, 3409371c9d4SSatish Balay PETSC_VTK_CELL_FIELD, 3419371c9d4SSatish Balay PETSC_VTK_CELL_VECTOR_FIELD 3429371c9d4SSatish Balay } PetscViewerVTKFieldType; 343e630c359SToby Isaac PETSC_EXTERN PetscErrorCode PetscViewerVTKAddField(PetscViewer, PetscObject, PetscErrorCode (*PetscViewerVTKWriteFunction)(PetscObject, PetscViewer), PetscInt, PetscViewerVTKFieldType, PetscBool, PetscObject); 344a8f87f1dSPatrick Sanan PETSC_EXTERN PetscErrorCode PetscViewerVTKGetDM(PetscViewer, PetscObject *); 345014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVTKOpen(MPI_Comm, const char[], PetscFileMode, PetscViewer *); 3464061b8bfSJed Brown 34777ed5343SBarry Smith /* 348d70abbfaSBarry Smith These are all the default viewers that do not have to be explicitly opened 34977ed5343SBarry Smith */ 350014dd563SJed Brown PETSC_EXTERN PetscViewer PETSC_VIEWER_STDOUT_(MPI_Comm); 351014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStdout(MPI_Comm, PetscViewer *); 352014dd563SJed Brown PETSC_EXTERN PetscViewer PETSC_VIEWER_STDERR_(MPI_Comm); 353014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStderr(MPI_Comm, PetscViewer *); 354014dd563SJed Brown PETSC_EXTERN PetscViewer PETSC_VIEWER_DRAW_(MPI_Comm); 355014dd563SJed Brown PETSC_EXTERN PetscViewer PETSC_VIEWER_SOCKET_(MPI_Comm); 356014dd563SJed Brown PETSC_EXTERN PetscViewer PETSC_VIEWER_BINARY_(MPI_Comm); 357014dd563SJed Brown PETSC_EXTERN PetscViewer PETSC_VIEWER_MATLAB_(MPI_Comm); 358a75e6a4aSMatthew G. Knepley PETSC_EXTERN PetscViewer PETSC_VIEWER_HDF5_(MPI_Comm); 3598135c375SStefano Zampini PETSC_EXTERN PetscViewer PETSC_VIEWER_GLVIS_(MPI_Comm); 3601e50132fSMatthew G. Knepley PETSC_EXTERN PetscViewer PETSC_VIEWER_EXODUSII_(MPI_Comm); 361014dd563SJed Brown PETSC_EXTERN PetscViewer PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE; 3625311e20fSBarry Smith 363f09f0971SVáclav Hapla /*MC 36487497f52SBarry Smith PETSC_VIEWER_STDERR_SELF - same as `PETSC_VIEWER_STDERR_`(PETSC_COMM_SELF) 365f09f0971SVáclav Hapla 366f09f0971SVáclav Hapla Level: beginner 367f09f0971SVáclav Hapla M*/ 368b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_SELF PETSC_VIEWER_STDERR_(PETSC_COMM_SELF) 369f09f0971SVáclav Hapla 370f09f0971SVáclav Hapla /*MC 37187497f52SBarry Smith PETSC_VIEWER_STDERR_WORLD - same as `PETSC_VIEWER_STDERR_`(PETSC_COMM_WORLD) 372f09f0971SVáclav Hapla 373f09f0971SVáclav Hapla Level: beginner 374f09f0971SVáclav Hapla M*/ 375b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD) 37630de9b25SBarry Smith 37730de9b25SBarry Smith /*MC 37887497f52SBarry Smith PETSC_VIEWER_STDOUT_WORLD - same as `PETSC_VIEWER_STDOUT_`(PETSC_COMM_WORLD) 37930de9b25SBarry Smith 38030de9b25SBarry Smith Level: beginner 38130de9b25SBarry Smith M*/ 38230de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD) 38330de9b25SBarry Smith 38430de9b25SBarry Smith /*MC 38587497f52SBarry Smith PETSC_VIEWER_STDOUT_SELF - same as `PETSC_VIEWER_STDOUT_`(PETSC_COMM_SELF) 38630de9b25SBarry Smith 38730de9b25SBarry Smith Level: beginner 38830de9b25SBarry Smith M*/ 38930de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_SELF PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF) 39030de9b25SBarry Smith 39130de9b25SBarry Smith /*MC 39287497f52SBarry Smith PETSC_VIEWER_DRAW_WORLD - same as `PETSC_VIEWER_DRAW_`(PETSC_COMM_WORLD) 39330de9b25SBarry Smith 39430de9b25SBarry Smith Level: intermediate 39530de9b25SBarry Smith M*/ 396b0a32e0cSBarry Smith #define PETSC_VIEWER_DRAW_WORLD PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD) 39730de9b25SBarry Smith 39830de9b25SBarry Smith /*MC 39987497f52SBarry Smith PETSC_VIEWER_DRAW_SELF - same as `PETSC_VIEWER_DRAW_`(PETSC_COMM_SELF) 40030de9b25SBarry Smith 40130de9b25SBarry Smith Level: intermediate 40230de9b25SBarry Smith M*/ 40330de9b25SBarry Smith #define PETSC_VIEWER_DRAW_SELF PETSC_VIEWER_DRAW_(PETSC_COMM_SELF) 40430de9b25SBarry Smith 40530de9b25SBarry Smith /*MC 40687497f52SBarry Smith PETSC_VIEWER_SOCKET_WORLD - same as `PETSC_VIEWER_SOCKET_`(PETSC_COMM_WORLD) 40730de9b25SBarry Smith 40830de9b25SBarry Smith Level: intermediate 40930de9b25SBarry Smith M*/ 410b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD) 41130de9b25SBarry Smith 41230de9b25SBarry Smith /*MC 41387497f52SBarry Smith PETSC_VIEWER_SOCKET_SELF - same as `PETSC_VIEWER_SOCKET_`(PETSC_COMM_SELF) 41430de9b25SBarry Smith 41530de9b25SBarry Smith Level: intermediate 41630de9b25SBarry Smith M*/ 417b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_SELF PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF) 41830de9b25SBarry Smith 41930de9b25SBarry Smith /*MC 42087497f52SBarry Smith PETSC_VIEWER_BINARY_WORLD - same as `PETSC_VIEWER_BINARY_`(PETSC_COMM_WORLD) 42130de9b25SBarry Smith 42230de9b25SBarry Smith Level: intermediate 42330de9b25SBarry Smith M*/ 424b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD) 42530de9b25SBarry Smith 42630de9b25SBarry Smith /*MC 42787497f52SBarry Smith PETSC_VIEWER_BINARY_SELF - same as `PETSC_VIEWER_BINARY_`(PETSC_COMM_SELF) 42830de9b25SBarry Smith 42930de9b25SBarry Smith Level: intermediate 43030de9b25SBarry Smith M*/ 431b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_SELF PETSC_VIEWER_BINARY_(PETSC_COMM_SELF) 43230de9b25SBarry Smith 433cbb32127SBarry Smith /*MC 43487497f52SBarry Smith PETSC_VIEWER_MATLAB_WORLD - same as `PETSC_VIEWER_MATLAB_`(PETSC_COMM_WORLD) 435cbb32127SBarry Smith 436cbb32127SBarry Smith Level: intermediate 437cbb32127SBarry Smith M*/ 438cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD) 439cbb32127SBarry Smith 440cbb32127SBarry Smith /*MC 44187497f52SBarry Smith PETSC_VIEWER_MATLAB_SELF - same as `PETSC_VIEWER_MATLAB_`(PETSC_COMM_SELF) 442cbb32127SBarry Smith 443cbb32127SBarry Smith Level: intermediate 444cbb32127SBarry Smith M*/ 445cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_SELF PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF) 446cbb32127SBarry Smith 4477eb62a3eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(), PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE) 44865ef3172SBarry Smith 4494a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStart(PetscViewer, PetscInt *, PetscInt *); 4509dddd249SSatish Balay PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepMain(PetscViewer, PetscInt, PetscInt *, PetscInt); 4519dddd249SSatish Balay PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndMain(PetscViewer, PetscInt *); 4524a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepWorker(PetscViewer, PetscMPIInt, PetscInt *); 4534a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndWorker(PetscViewer, PetscInt *); 454edd03b47SJacob Faibussowitsch PETSC_DEPRECATED_FUNCTION(3, 15, 0, "PetscViewerFlowControlStepMain()", ) static inline PetscErrorCode PetscViewerFlowControlStepMaster(PetscViewer viewer, PetscInt i, PetscInt *mcnt, PetscInt cnt) 455d71ae5a4SJacob Faibussowitsch { 4569371c9d4SSatish Balay return PetscViewerFlowControlStepMain(viewer, i, mcnt, cnt); 4579371c9d4SSatish Balay } 458edd03b47SJacob Faibussowitsch PETSC_DEPRECATED_FUNCTION(3, 15, 0, "PetscViewerFlowControlEndMain()", ) static inline PetscErrorCode PetscViewerFlowControlEndMaster(PetscViewer viewer, PetscInt *mcnt) 459d71ae5a4SJacob Faibussowitsch { 4609371c9d4SSatish Balay return PetscViewerFlowControlEndMain(viewer, mcnt); 4619371c9d4SSatish Balay } 462e03d165dSBarry Smith 46377ed5343SBarry Smith /* 464a5057860SBarry Smith PetscViewer writes to MATLAB .mat file 465cbb32127SBarry Smith */ 466014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutArray(PetscViewer, int, int, const PetscScalar *, const char *); 467014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabGetArray(PetscViewer, int, int, PetscScalar *, const char *); 468014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutVariable(PetscViewer, const char *, void *); 469cbb32127SBarry Smith 470e04113cfSBarry Smith #if defined(PETSC_HAVE_SAWS) 471e04113cfSBarry Smith PETSC_EXTERN PetscErrorCode PetscObjectViewSAWs(PetscObject, PetscViewer); 472bfb97211SBarry Smith #endif 473bfb97211SBarry Smith 474b9617806SBarry Smith /*S 4753f423023SBarry Smith PetscViewers - Abstract collection of `PetscViewer`s. It is stored as an expandable array of viewers. 476b9617806SBarry Smith 477b9617806SBarry Smith Level: intermediate 478b9617806SBarry Smith 479d1f92df0SBarry Smith .seealso: [](sec_viewers), `PetscViewerCreate()`, `PetscViewerSetType()`, `PetscViewerType`, `PetscViewer`, `PetscViewersCreate()`, 480db781477SPatrick Sanan `PetscViewersGetViewer()` 481b9617806SBarry Smith S*/ 48295fbd943SSatish Balay typedef struct _n_PetscViewers *PetscViewers; 483014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersCreate(MPI_Comm, PetscViewers *); 484014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersDestroy(PetscViewers *); 485014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersGetViewer(PetscViewers, PetscInt, PetscViewer *); 486