xref: /petsc/include/petscviewer.h (revision 9fbee5477fd88ea4536ebb185f3c80da15fb55c0)
184cb2905SBarry Smith /*
2b0a32e0cSBarry Smith      PetscViewers are objects where other objects can be looked at or stored.
384cb2905SBarry Smith */
43c119ea2SBarry Smith 
526bd1501SBarry Smith #if !defined(PETSCVIEWER_H)
626bd1501SBarry Smith #define PETSCVIEWER_H
7dfbe8321SBarry Smith 
86420c192SJed Brown #include <petscsys.h>
9c619b03eSJed Brown #include <petscviewertypes.h>
100954c5ccSStefano Zampini #include <petscdrawtypes.h>
11e9fa29b7SSatish Balay 
12014dd563SJed Brown PETSC_EXTERN PetscClassId PETSC_VIEWER_CLASSID;
13e9fa29b7SSatish Balay 
1476bdecfbSBarry Smith /*J
15b9617806SBarry Smith     PetscViewerType - String with the name of a PETSc PETScViewer
16b9617806SBarry Smith 
17b9617806SBarry Smith    Level: beginner
18b9617806SBarry Smith 
198f6c3df8SBarry Smith .seealso: 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"
3677ed5343SBarry Smith 
37140e18c1SBarry Smith PETSC_EXTERN PetscFunctionList PetscViewerList;
38607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerInitializePackage(void);
397b2a1423SBarry Smith 
40bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerRegister(const char[],PetscErrorCode (*)(PetscViewer));
4130de9b25SBarry Smith 
42014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerCreate(MPI_Comm,PetscViewer*);
43014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetFromOptions(PetscViewer);
44014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpenWithFILE(MPI_Comm,FILE*,PetscViewer*);
457b2a1423SBarry Smith 
46014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpen(MPI_Comm,const char[],PetscViewer*);
47014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISetFILE(PetscViewer,FILE*);
48014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
49a56f64adSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerADIOSOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
50014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetFlowControl(PetscViewer,PetscInt*);
51014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetFlowControl(PetscViewer,PetscInt);
52bc196f7cSDave May PETSC_EXTERN PetscErrorCode PetscViewerBinarySetUseMPIIO(PetscViewer,PetscBool);
53bc196f7cSDave May PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetUseMPIIO(PetscViewer,PetscBool *);
540fc9d207SBarry Smith #if defined(PETSC_HAVE_MPIIO)
55014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIODescriptor(PetscViewer,MPI_File*);
56014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIOOffset(PetscViewer,MPI_Offset*);
57014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryAddMPIIOOffset(PetscViewer,MPI_Offset);
58951e3c8eSBarry Smith #endif
5939802e9eSBarry Smith 
60014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSocketOpen(MPI_Comm,const char[],int,PetscViewer*);
6189d949e2SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringOpen(MPI_Comm,char[],size_t,PetscViewer*);
62014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawOpen(MPI_Comm,const char[],const char[],int,int,int,int,PetscViewer*);
63d1da0b69SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerDrawSetDrawType(PetscViewer,PetscDrawType);
641f49e1f7SLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDrawType(PetscViewer,PetscDrawType*);
65f55236e4SLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerDrawSetTitle(PetscViewer,const char[]);
66f55236e4SLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerDrawGetTitle(PetscViewer,const char*[]);
670954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDraw(PetscViewer,PetscInt,PetscDraw*);
680954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawBaseAdd(PetscViewer,PetscInt);
690954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawBaseSet(PetscViewer,PetscInt);
700954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDrawLG(PetscViewer,PetscInt,PetscDrawLG*);
710954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDrawAxis(PetscViewer,PetscInt,PetscDrawAxis*);
720954c5ccSStefano Zampini 
73014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *);
74014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloOpen(MPI_Comm, const char[], PetscViewer *);
75014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
764b0e389bSBarry Smith 
778135c375SStefano Zampini /*E
788135c375SStefano Zampini     PetscViewerGLVisType - indicates what type of GLVis viewer to use
798135c375SStefano Zampini 
808135c375SStefano Zampini     Level: beginner
818135c375SStefano Zampini 
828135c375SStefano Zampini .seealso: PetscViewerGLVisOpen()
838135c375SStefano Zampini E*/
848135c375SStefano Zampini typedef enum {PETSC_VIEWER_GLVIS_DUMP, PETSC_VIEWER_GLVIS_SOCKET} PetscViewerGLVisType;
858135c375SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisOpen(MPI_Comm,PetscViewerGLVisType,const char*,PetscInt,PetscViewer*);
8677eacf09SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetPrecision(PetscViewer,PetscInt);
878135c375SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetSnapId(PetscViewer,PetscInt);
884cac2994SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetFields(PetscViewer,PetscInt,const char*[],PetscInt[],PetscErrorCode(*)(PetscObject,PetscInt,PetscObject[],void*),PetscObject[],void*,PetscErrorCode(*)(void*));
898135c375SStefano Zampini 
9019fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerGetType(PetscViewer,PetscViewerType*);
9119fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerSetType(PetscViewer,PetscViewerType);
92014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDestroy(PetscViewer*);
933f08860eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerGetSubViewer(PetscViewer,MPI_Comm,PetscViewer*);
943f08860eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerRestoreSubViewer(PetscViewer,MPI_Comm,PetscViewer*);
95ae39576cSLois Curfman McInnes 
96014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetUp(PetscViewer);
97014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerView(PetscViewer,PetscViewer);
98fe2efc57SMark PETSC_EXTERN PetscErrorCode PetscViewerViewFromOptions(PetscViewer,PetscObject,const char[]);
99f69a0ea3SMatthew Knepley 
100014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetOptionsPrefix(PetscViewer,const char[]);
101014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerAppendOptionsPrefix(PetscViewer,const char[]);
102014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerGetOptionsPrefix(PetscViewer,const char*[]);
103090de74eSSatish Balay 
104e24fdd67SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerReadable(PetscViewer,PetscBool*);
105e24fdd67SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerWritable(PetscViewer,PetscBool*);
106d01f05b1SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerCheckReadable(PetscViewer);
107d01f05b1SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerCheckWritable(PetscViewer);
108e24fdd67SVaclav Hapla 
1098ec8862eSJed Brown #define PETSC_VIEWER_ASCII_VTK_ATTR        PETSC_VIEWER_ASCII_VTK        PETSC_DEPRECATED_ENUM("Legacy VTK deprecated; use PetscViewerVTKOpen() with XML (.vtr .vts .vtu) format (since 3.14)")
1108ec8862eSJed Brown #define PETSC_VIEWER_ASCII_VTK_CELL_ATTR   PETSC_VIEWER_ASCII_VTK_CELL   PETSC_DEPRECATED_ENUM("Legacy VTK deprecated; use PetscViewerVTKOpen() with XML (.vtr .vts .vtu) format (since 3.14)")
1118ec8862eSJed Brown #define PETSC_VIEWER_ASCII_VTK_COORDS_ATTR PETSC_VIEWER_ASCII_VTK_COORDS PETSC_DEPRECATED_ENUM("Legacy VTK deprecated; use PetscViewerVTKOpen() with XML (.vtr .vts .vtu) format (since 3.14)")
112b9617806SBarry Smith /*E
113b9617806SBarry Smith     PetscViewerFormat - Way a viewer presents the object
114b9617806SBarry Smith 
115b9617806SBarry Smith    Level: beginner
116b9617806SBarry Smith 
1176a9046bcSBarry Smith .seealso: PetscViewer, PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat()
118b9617806SBarry Smith E*/
119fb9695e5SSatish Balay typedef enum {
120117016b1SBarry Smith   PETSC_VIEWER_DEFAULT,
121f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_MATLAB,
1224ebda54eSMatthew Knepley   PETSC_VIEWER_ASCII_MATHEMATICA,
123f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_IMPL,
124f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INFO,
125456192e2SBarry Smith   PETSC_VIEWER_ASCII_INFO_DETAIL,
126f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_COMMON,
127f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_SYMMODU,
128f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INDEX,
129f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_DENSE,
1303c215bfdSMatthew Knepley   PETSC_VIEWER_ASCII_MATRIXMARKET,
1318ec8862eSJed Brown   PETSC_VIEWER_ASCII_VTK_DEPRECATED,
1328ec8862eSJed Brown   PETSC_VIEWER_ASCII_VTK_ATTR = PETSC_VIEWER_ASCII_VTK_DEPRECATED,
1338ec8862eSJed Brown   PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED,
1348ec8862eSJed Brown   PETSC_VIEWER_ASCII_VTK_CELL_ATTR = PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED,
1358ec8862eSJed Brown   PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED,
1368ec8862eSJed Brown   PETSC_VIEWER_ASCII_VTK_COORDS_ATTR = PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED,
137493617b5SMatthew Knepley   PETSC_VIEWER_ASCII_PCICE,
138cfaaf4edSHong Zhang   PETSC_VIEWER_ASCII_PYTHON,
139cfaaf4edSHong Zhang   PETSC_VIEWER_ASCII_FACTOR_INFO,
14067ad5babSMatthew G Knepley   PETSC_VIEWER_ASCII_LATEX,
141bb1d7374SBarry Smith   PETSC_VIEWER_ASCII_XML,
142d0a29bd7SConnor Ward   PETSC_VIEWER_ASCII_FLAMEGRAPH,
1438135c375SStefano Zampini   PETSC_VIEWER_ASCII_GLVIS,
14438144912Sdeepblu2718   PETSC_VIEWER_ASCII_CSV,
145f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_BASIC,
146f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_LG,
147bb046f40SHong Zhang   PETSC_VIEWER_DRAW_LG_XRANGE,
148f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_CONTOUR,
149f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_PORTS,
1504061b8bfSJed Brown   PETSC_VIEWER_VTK_VTS,
151a13bc4e3SShao-Ching Huang   PETSC_VIEWER_VTK_VTR,
152b263465dSJed Brown   PETSC_VIEWER_VTK_VTU,
153a261c58fSBarry Smith   PETSC_VIEWER_BINARY_MATLAB,
154f3ef73ceSBarry Smith   PETSC_VIEWER_NATIVE,
1558aa4816bSVaclav Hapla   PETSC_VIEWER_HDF5_PETSC,
156ffe0aed0SMatthew G. Knepley   PETSC_VIEWER_HDF5_VIZ,
1578aa4816bSVaclav Hapla   PETSC_VIEWER_HDF5_XDMF,
158cbb4c999SVaclav Hapla   PETSC_VIEWER_HDF5_MAT,
159ef5fdb51SBarry Smith   PETSC_VIEWER_NOFORMAT,
160eafd5ff0SAlex Lindsay   PETSC_VIEWER_LOAD_BALANCE,
161eafd5ff0SAlex Lindsay   PETSC_VIEWER_FAILED
162cfaaf4edSHong Zhang   } PetscViewerFormat;
163014dd563SJed Brown PETSC_EXTERN const char *const PetscViewerFormats[];
164090de74eSSatish Balay 
16525ef9dfeSBarry Smith PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use PetscViewerPushFormat()/PetscViewerPopFormat()") PetscErrorCode PetscViewerSetFormat(PetscViewer,PetscViewerFormat);
166014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerPushFormat(PetscViewer,PetscViewerFormat);
167014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerPopFormat(PetscViewer);
168014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerGetFormat(PetscViewer,PetscViewerFormat*);
169014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFlush(PetscViewer);
1704b0e389bSBarry Smith 
171eb55bdffSLawrence Mitchell PETSC_EXTERN PetscErrorCode PetscOptionsPushGetViewerOff(PetscBool);
172a30ec4eaSSatish Balay PETSC_EXTERN PetscErrorCode PetscOptionsPopGetViewerOff(void);
173eb55bdffSLawrence Mitchell PETSC_EXTERN PetscErrorCode PetscOptionsGetViewerOff(PetscBool*);
17416413a6aSBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsGetViewer(MPI_Comm,PetscOptions,const char[],const char[],PetscViewer*,PetscViewerFormat*,PetscBool*);
175e83a5d19SLisandro Dalcin #define PetscOptionsViewer(a,b,c,d,e,f) PetscOptionsViewer_Private(PetscOptionsObject,a,b,c,d,e,f)
1764416b707SBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsViewer_Private(PetscOptionItems*,const char[],const char[],const char[],PetscViewer*,PetscViewerFormat *,PetscBool *);
1772bf49c77SBarry Smith 
178798534f6SMatthew G. Knepley typedef struct {PetscViewer viewer;PetscViewerFormat format;PetscDrawLG lg;void *data;} PetscViewerAndFormat;
179d7cbc13eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerAndFormatCreate(PetscViewer,PetscViewerFormat,PetscViewerAndFormat**);
180fe01d993SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerAndFormatDestroy(PetscViewerAndFormat**);
181fe01d993SBarry Smith 
18277ed5343SBarry Smith /*
18377ed5343SBarry Smith    Operations explicit to a particular class of viewers
18477ed5343SBarry Smith */
185ed5c6e3eSMatthew Knepley 
186014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetPointer(PetscViewer,FILE**);
187014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileGetMode(PetscViewer,PetscFileMode*);
188014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileSetMode(PetscViewer,PetscFileMode);
189060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerRead(PetscViewer,void*,PetscInt,PetscInt*,PetscDataType);
1903ca90d2dSJacob Faibussowitsch PETSC_EXTERN PetscErrorCode PetscViewerASCIIPrintf(PetscViewer,const char[],...) PETSC_ATTRIBUTE_FORMAT(2,3);
1913ca90d2dSJacob Faibussowitsch PETSC_EXTERN PetscErrorCode PetscViewerASCIISynchronizedPrintf(PetscViewer,const char[],...) PETSC_ATTRIBUTE_FORMAT(2,3);
1921575c14dSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushSynchronized(PetscViewer);
1931575c14dSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopSynchronized(PetscViewer);
194014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushTab(PetscViewer);
195014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopTab(PetscViewer);
196014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIUseTabs(PetscViewer,PetscBool);
197014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISetTab(PetscViewer,PetscInt);
198014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetTab(PetscViewer,PetscInt*);
199014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIAddTab(PetscViewer,PetscInt);
200014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISubtractTab(PetscViewer,PetscInt);
201060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerASCIIRead(PetscViewer,void *,PetscInt,PetscInt*,PetscDataType);
202014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetDescriptor(PetscViewer,int*);
203014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetInfoPointer(PetscViewer,FILE **);
204060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerBinaryRead(PetscViewer,void*,PetscInt,PetscInt*,PetscDataType);
205f253e43cSLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerBinaryWrite(PetscViewer,const void*,PetscInt,PetscDataType);
2065972f5f3SLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerBinaryReadAll(PetscViewer,void*,PetscInt,PetscInt,PetscInt,PetscDataType);
2075972f5f3SLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerBinaryWriteAll(PetscViewer,const void*,PetscInt,PetscInt,PetscInt,PetscDataType);
2083ca90d2dSJacob Faibussowitsch PETSC_EXTERN PetscErrorCode PetscViewerStringSPrintf(PetscViewer,const char[],...) PETSC_ATTRIBUTE_FORMAT(2,3);
20936a9e3b9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringSetString(PetscViewer,char[],size_t);
21036a9e3b9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringGetStringRead(PetscViewer,const char*[],size_t*);
21136a9e3b9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringSetOwnString(PetscViewer);
212014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawClear(PetscViewer);
213014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetHold(PetscViewer,PetscBool);
214014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetHold(PetscViewer,PetscBool*);
215014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetPause(PetscViewer,PetscReal);
216014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetPause(PetscViewer,PetscReal*);
217014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetInfo(PetscViewer,const char[],const char[],int,int,int,int);
218014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawResize(PetscViewer,int,int);
219014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetBounds(PetscViewer,PetscInt,const PetscReal*);
220014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetBounds(PetscViewer,PetscInt*,const PetscReal**);
221014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSocketSetConnection(PetscViewer,const char[],int);
222014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySkipInfo(PetscViewer);
223807ea322SDave May PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipInfo(PetscViewer,PetscBool);
224807ea322SDave May PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipInfo(PetscViewer,PetscBool*);
225014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipOptions(PetscViewer,PetscBool);
226014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipOptions(PetscViewer,PetscBool *);
227014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipHeader(PetscViewer,PetscBool);
228014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipHeader(PetscViewer,PetscBool*);
229014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryReadStringArray(PetscViewer,char***);
23078fbdcc8SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerBinaryWriteStringArray(PetscViewer,const char *const*);
231c655490fSBarry Smith 
232014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileSetName(PetscViewer,const char[]);
233014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileGetName(PetscViewer,const char**);
23477ed5343SBarry Smith 
235014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUGetPointer(PetscViewer, FILE**);
236014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUSetVecSeen(PetscViewer, PetscBool);
237014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUGetVecSeen(PetscViewer, PetscBool  *);
2383ca90d2dSJacob Faibussowitsch PETSC_EXTERN PetscErrorCode PetscViewerVUPrintDeferred(PetscViewer, const char [], ...) PETSC_ATTRIBUTE_FORMAT(2,3);
239014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUFlushDeferred(PetscViewer);
24055dcf840SMatthew Knepley 
2417e4fd573SVaclav Hapla /*@C
2427e4fd573SVaclav Hapla   PetscViewerVUSetMode - Sets the mode in which to open the file.
2437e4fd573SVaclav Hapla 
2447e4fd573SVaclav Hapla   Not Collective
2457e4fd573SVaclav Hapla 
2467e4fd573SVaclav Hapla   Input Parameters:
2477e4fd573SVaclav Hapla + viewer - The PetscViewer
2487e4fd573SVaclav Hapla - mode   - The file mode
2497e4fd573SVaclav Hapla 
2507e4fd573SVaclav Hapla   Level: deprecated
2517e4fd573SVaclav Hapla 
2527e4fd573SVaclav Hapla   Note:
2537e4fd573SVaclav Hapla   Use PetscViewerFileSetMode() instead.
2547e4fd573SVaclav Hapla 
2557e4fd573SVaclav Hapla .seealso: PetscViewerFileSetMode()
2567e4fd573SVaclav Hapla @*/
257*9fbee547SJacob Faibussowitsch PETSC_DEPRECATED_FUNCTION("Use PetscViewerFileSetMode (since v3.15)") static inline PetscErrorCode PetscViewerVUSetMode(PetscViewer viewer, PetscFileMode mode) {return PetscViewerFileSetMode(viewer, mode);}
2587e4fd573SVaclav Hapla 
259607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerMathematicaInitializePackage(void);
260014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaFinalizePackage(void);
261014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaGetName(PetscViewer, const char **);
262014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSetName(PetscViewer, const char []);
263014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaClearName(PetscViewer);
264014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSkipPackets(PetscViewer, int);
2654ebda54eSMatthew Knepley 
266014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloGetName(PetscViewer, char **);
267014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloSetName(PetscViewer, const char []);
268014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloClearName(PetscViewer);
269014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloGetMeshName(PetscViewer, char **);
270014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloSetMeshName(PetscViewer, const char []);
271014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloClearMeshName(PetscViewer);
2724ebda54eSMatthew Knepley 
273e630c359SToby Isaac typedef enum {PETSC_VTK_INVALID, PETSC_VTK_POINT_FIELD, PETSC_VTK_POINT_VECTOR_FIELD, PETSC_VTK_CELL_FIELD, PETSC_VTK_CELL_VECTOR_FIELD} PetscViewerVTKFieldType;
274e630c359SToby Isaac PETSC_EXTERN PetscErrorCode PetscViewerVTKAddField(PetscViewer,PetscObject,PetscErrorCode (*PetscViewerVTKWriteFunction)(PetscObject,PetscViewer),PetscInt,PetscViewerVTKFieldType,PetscBool,PetscObject);
275a8f87f1dSPatrick Sanan PETSC_EXTERN PetscErrorCode PetscViewerVTKGetDM(PetscViewer,PetscObject*);
276014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVTKOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
2774061b8bfSJed Brown 
27877ed5343SBarry Smith /*
279d70abbfaSBarry Smith      These are all the default viewers that do not have to be explicitly opened
28077ed5343SBarry Smith */
281014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_STDOUT_(MPI_Comm);
282014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStdout(MPI_Comm,PetscViewer*);
283014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_STDERR_(MPI_Comm);
284014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStderr(MPI_Comm,PetscViewer*);
285014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_DRAW_(MPI_Comm);
286014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_SOCKET_(MPI_Comm);
287014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_BINARY_(MPI_Comm);
288014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_MATLAB_(MPI_Comm);
289a75e6a4aSMatthew G. Knepley PETSC_EXTERN PetscViewer    PETSC_VIEWER_HDF5_(MPI_Comm);
2908135c375SStefano Zampini PETSC_EXTERN PetscViewer    PETSC_VIEWER_GLVIS_(MPI_Comm);
2911e50132fSMatthew G. Knepley PETSC_EXTERN PetscViewer    PETSC_VIEWER_EXODUSII_(MPI_Comm);
292014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE;
2935311e20fSBarry Smith 
294f09f0971SVáclav Hapla /*MC
295f09f0971SVáclav Hapla   PETSC_VIEWER_STDERR_SELF  - same as PETSC_VIEWER_STDERR_(PETSC_COMM_SELF)
296f09f0971SVáclav Hapla 
297f09f0971SVáclav Hapla   Level: beginner
298f09f0971SVáclav Hapla M*/
299b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_SELF  PETSC_VIEWER_STDERR_(PETSC_COMM_SELF)
300f09f0971SVáclav Hapla 
301f09f0971SVáclav Hapla /*MC
302f09f0971SVáclav Hapla   PETSC_VIEWER_STDERR_WORLD  - same as PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD)
303f09f0971SVáclav Hapla 
304f09f0971SVáclav Hapla   Level: beginner
305f09f0971SVáclav Hapla M*/
306b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD)
30730de9b25SBarry Smith 
30830de9b25SBarry Smith /*MC
30930de9b25SBarry Smith   PETSC_VIEWER_STDOUT_WORLD  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
31030de9b25SBarry Smith 
31130de9b25SBarry Smith   Level: beginner
31230de9b25SBarry Smith M*/
31330de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
31430de9b25SBarry Smith 
31530de9b25SBarry Smith /*MC
31630de9b25SBarry Smith   PETSC_VIEWER_STDOUT_SELF  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
31730de9b25SBarry Smith 
31830de9b25SBarry Smith   Level: beginner
31930de9b25SBarry Smith M*/
32030de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_SELF  PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
32130de9b25SBarry Smith 
32230de9b25SBarry Smith /*MC
32330de9b25SBarry Smith   PETSC_VIEWER_DRAW_WORLD  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
32430de9b25SBarry Smith 
32530de9b25SBarry Smith   Level: intermediate
32630de9b25SBarry Smith M*/
327b0a32e0cSBarry Smith #define PETSC_VIEWER_DRAW_WORLD   PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
32830de9b25SBarry Smith 
32930de9b25SBarry Smith /*MC
33030de9b25SBarry Smith   PETSC_VIEWER_DRAW_SELF  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
33130de9b25SBarry Smith 
33230de9b25SBarry Smith   Level: intermediate
33330de9b25SBarry Smith M*/
33430de9b25SBarry Smith #define PETSC_VIEWER_DRAW_SELF    PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
33530de9b25SBarry Smith 
33630de9b25SBarry Smith /*MC
33730de9b25SBarry Smith   PETSC_VIEWER_SOCKET_WORLD  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
33830de9b25SBarry Smith 
33930de9b25SBarry Smith   Level: intermediate
34030de9b25SBarry Smith M*/
341b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
34230de9b25SBarry Smith 
34330de9b25SBarry Smith /*MC
34430de9b25SBarry Smith   PETSC_VIEWER_SOCKET_SELF  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
34530de9b25SBarry Smith 
34630de9b25SBarry Smith   Level: intermediate
34730de9b25SBarry Smith M*/
348b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_SELF  PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
34930de9b25SBarry Smith 
35030de9b25SBarry Smith /*MC
35130de9b25SBarry Smith   PETSC_VIEWER_BINARY_WORLD  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
35230de9b25SBarry Smith 
35330de9b25SBarry Smith   Level: intermediate
35430de9b25SBarry Smith M*/
355b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
35630de9b25SBarry Smith 
35730de9b25SBarry Smith /*MC
35830de9b25SBarry Smith   PETSC_VIEWER_BINARY_SELF  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
35930de9b25SBarry Smith 
36030de9b25SBarry Smith   Level: intermediate
36130de9b25SBarry Smith M*/
362b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_SELF  PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
36330de9b25SBarry Smith 
364cbb32127SBarry Smith /*MC
365cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_WORLD  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
366cbb32127SBarry Smith 
367cbb32127SBarry Smith   Level: intermediate
368cbb32127SBarry Smith M*/
369cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
370cbb32127SBarry Smith 
371cbb32127SBarry Smith /*MC
372cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_SELF  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
373cbb32127SBarry Smith 
374cbb32127SBarry Smith   Level: intermediate
375cbb32127SBarry Smith M*/
376cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_SELF  PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
377cbb32127SBarry Smith 
3787eb62a3eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(),PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE)
37965ef3172SBarry Smith 
3804a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStart(PetscViewer,PetscInt*,PetscInt*);
3819dddd249SSatish Balay PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepMain(PetscViewer,PetscInt,PetscInt*,PetscInt);
3829dddd249SSatish Balay PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndMain(PetscViewer,PetscInt*);
3834a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepWorker(PetscViewer,PetscMPIInt,PetscInt*);
3844a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndWorker(PetscViewer,PetscInt*);
385*9fbee547SJacob Faibussowitsch PETSC_DEPRECATED_FUNCTION("Use PetscViewerFlowControlStepMaster (since v3.15)") static inline PetscErrorCode PetscViewerFlowControlStepMaster(PetscViewer viewer,PetscInt i,PetscInt *mcnt,PetscInt cnt) {return PetscViewerFlowControlStepMain(viewer,i,mcnt,cnt);}
386*9fbee547SJacob Faibussowitsch PETSC_DEPRECATED_FUNCTION("Use PetscViewerFlowControlEndMaster (since v3.15)") static inline PetscErrorCode PetscViewerFlowControlEndMaster(PetscViewer viewer, PetscInt *mcnt) {return PetscViewerFlowControlEndMain(viewer,mcnt);}
387e03d165dSBarry Smith 
38877ed5343SBarry Smith /*
389a5057860SBarry Smith    PetscViewer writes to MATLAB .mat file
390cbb32127SBarry Smith */
391014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutArray(PetscViewer,int,int,const PetscScalar*,const char*);
392014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabGetArray(PetscViewer,int,int,PetscScalar*,const char*);
393014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutVariable(PetscViewer,const char*,void*);
394cbb32127SBarry Smith 
395e04113cfSBarry Smith #if defined(PETSC_HAVE_SAWS)
396e04113cfSBarry Smith PETSC_EXTERN PetscErrorCode PetscObjectViewSAWs(PetscObject,PetscViewer);
397bfb97211SBarry Smith #endif
398bfb97211SBarry Smith 
399b9617806SBarry Smith /*S
4001890ba74SBarry Smith      PetscViewers - Abstract collection of PetscViewers. It is just an expandable array of viewers.
401b9617806SBarry Smith 
402b9617806SBarry Smith    Level: intermediate
403b9617806SBarry Smith 
404b9617806SBarry Smith .seealso:  PetscViewerCreate(), PetscViewerSetType(), PetscViewerType, PetscViewer, PetscViewersCreate(),
405b9617806SBarry Smith            PetscViewersGetViewer()
406b9617806SBarry Smith S*/
40795fbd943SSatish Balay typedef struct _n_PetscViewers* PetscViewers;
408014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersCreate(MPI_Comm,PetscViewers*);
409014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersDestroy(PetscViewers*);
410014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersGetViewer(PetscViewers,PetscInt,PetscViewer*);
411d132466eSBarry Smith 
412cb5b572fSBarry Smith #endif
413