xref: /petsc/include/petscviewer.h (revision 5972f5f36d4ccb11a34326fd4190a2adb145ce02)
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"
3555d657eeSBarry Smith #define PETSCVIEWERADIOS2       "adios2"
361e50132fSMatthew G. Knepley #define PETSCVIEWEREXODUSII     "exodusii"
3777ed5343SBarry Smith 
38140e18c1SBarry Smith PETSC_EXTERN PetscFunctionList PetscViewerList;
39607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerInitializePackage(void);
407b2a1423SBarry Smith 
41bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerRegister(const char[],PetscErrorCode (*)(PetscViewer));
4230de9b25SBarry Smith 
43014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerCreate(MPI_Comm,PetscViewer*);
44014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetFromOptions(PetscViewer);
45014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpenWithFILE(MPI_Comm,FILE*,PetscViewer*);
467b2a1423SBarry Smith 
47014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpen(MPI_Comm,const char[],PetscViewer*);
48014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISetFILE(PetscViewer,FILE*);
49014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
50a56f64adSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerADIOSOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
5155d657eeSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerADIOS2Open(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 PetscViewerSiloOpen(MPI_Comm, const char[], PetscViewer *);
77014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
784b0e389bSBarry Smith 
798135c375SStefano Zampini /*E
808135c375SStefano Zampini     PetscViewerGLVisType - indicates what type of GLVis viewer to use
818135c375SStefano Zampini 
828135c375SStefano Zampini     Level: beginner
838135c375SStefano Zampini 
848135c375SStefano Zampini .seealso: PetscViewerGLVisOpen()
858135c375SStefano Zampini E*/
868135c375SStefano Zampini typedef enum {PETSC_VIEWER_GLVIS_DUMP, PETSC_VIEWER_GLVIS_SOCKET} PetscViewerGLVisType;
878135c375SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisOpen(MPI_Comm,PetscViewerGLVisType,const char*,PetscInt,PetscViewer*);
8877eacf09SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetPrecision(PetscViewer,PetscInt);
898135c375SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetSnapId(PetscViewer,PetscInt);
904cac2994SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetFields(PetscViewer,PetscInt,const char*[],PetscInt[],PetscErrorCode(*)(PetscObject,PetscInt,PetscObject[],void*),PetscObject[],void*,PetscErrorCode(*)(void*));
918135c375SStefano Zampini 
9219fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerGetType(PetscViewer,PetscViewerType*);
9319fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerSetType(PetscViewer,PetscViewerType);
94014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDestroy(PetscViewer*);
953f08860eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerGetSubViewer(PetscViewer,MPI_Comm,PetscViewer*);
963f08860eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerRestoreSubViewer(PetscViewer,MPI_Comm,PetscViewer*);
97ae39576cSLois Curfman McInnes 
98014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetUp(PetscViewer);
99014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerView(PetscViewer,PetscViewer);
100fe2efc57SMark PETSC_EXTERN PetscErrorCode PetscViewerViewFromOptions(PetscViewer,PetscObject,const char[]);
101f69a0ea3SMatthew Knepley 
102014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetOptionsPrefix(PetscViewer,const char[]);
103014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerAppendOptionsPrefix(PetscViewer,const char[]);
104014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerGetOptionsPrefix(PetscViewer,const char*[]);
105090de74eSSatish Balay 
106e24fdd67SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerReadable(PetscViewer,PetscBool*);
107e24fdd67SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerWritable(PetscViewer,PetscBool*);
108d01f05b1SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerCheckReadable(PetscViewer);
109d01f05b1SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerCheckWritable(PetscViewer);
110e24fdd67SVaclav Hapla 
111b9617806SBarry Smith /*E
112b9617806SBarry Smith     PetscViewerFormat - Way a viewer presents the object
113b9617806SBarry Smith 
114b9617806SBarry Smith    Level: beginner
115b9617806SBarry Smith 
1166a9046bcSBarry Smith .seealso: PetscViewer, PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat()
117b9617806SBarry Smith E*/
118fb9695e5SSatish Balay typedef enum {
119117016b1SBarry Smith   PETSC_VIEWER_DEFAULT,
120f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_MATLAB,
1214ebda54eSMatthew Knepley   PETSC_VIEWER_ASCII_MATHEMATICA,
122f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_IMPL,
123f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INFO,
124456192e2SBarry Smith   PETSC_VIEWER_ASCII_INFO_DETAIL,
125f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_COMMON,
126f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_SYMMODU,
127f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INDEX,
128f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_DENSE,
1293c215bfdSMatthew Knepley   PETSC_VIEWER_ASCII_MATRIXMARKET,
130a505fa5bSMatthew Knepley   PETSC_VIEWER_ASCII_VTK,
131b85befe5SMatthew Knepley   PETSC_VIEWER_ASCII_VTK_CELL,
132b6d733afSMatthew Knepley   PETSC_VIEWER_ASCII_VTK_COORDS,
133493617b5SMatthew Knepley   PETSC_VIEWER_ASCII_PCICE,
134cfaaf4edSHong Zhang   PETSC_VIEWER_ASCII_PYTHON,
135cfaaf4edSHong Zhang   PETSC_VIEWER_ASCII_FACTOR_INFO,
13667ad5babSMatthew G Knepley   PETSC_VIEWER_ASCII_LATEX,
137bb1d7374SBarry Smith   PETSC_VIEWER_ASCII_XML,
1388135c375SStefano Zampini   PETSC_VIEWER_ASCII_GLVIS,
13938144912Sdeepblu2718   PETSC_VIEWER_ASCII_CSV,
140f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_BASIC,
141f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_LG,
142bb046f40SHong Zhang   PETSC_VIEWER_DRAW_LG_XRANGE,
143f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_CONTOUR,
144f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_PORTS,
1454061b8bfSJed Brown   PETSC_VIEWER_VTK_VTS,
146a13bc4e3SShao-Ching Huang   PETSC_VIEWER_VTK_VTR,
147b263465dSJed Brown   PETSC_VIEWER_VTK_VTU,
148a261c58fSBarry Smith   PETSC_VIEWER_BINARY_MATLAB,
149f3ef73ceSBarry Smith   PETSC_VIEWER_NATIVE,
1508aa4816bSVaclav Hapla   PETSC_VIEWER_HDF5_PETSC,
151ffe0aed0SMatthew G. Knepley   PETSC_VIEWER_HDF5_VIZ,
1528aa4816bSVaclav Hapla   PETSC_VIEWER_HDF5_XDMF,
153cbb4c999SVaclav Hapla   PETSC_VIEWER_HDF5_MAT,
154ef5fdb51SBarry Smith   PETSC_VIEWER_NOFORMAT,
155ef5fdb51SBarry Smith   PETSC_VIEWER_LOAD_BALANCE
156cfaaf4edSHong Zhang   } PetscViewerFormat;
157014dd563SJed Brown PETSC_EXTERN const char *const PetscViewerFormats[];
158090de74eSSatish Balay 
15925ef9dfeSBarry Smith PETSC_EXTERN PETSC_DEPRECATED_FUNCTION("Use PetscViewerPushFormat()/PetscViewerPopFormat()") PetscErrorCode PetscViewerSetFormat(PetscViewer,PetscViewerFormat);
160014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerPushFormat(PetscViewer,PetscViewerFormat);
161014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerPopFormat(PetscViewer);
162014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerGetFormat(PetscViewer,PetscViewerFormat*);
163014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFlush(PetscViewer);
1644b0e389bSBarry Smith 
165eb55bdffSLawrence Mitchell PETSC_EXTERN PetscErrorCode PetscOptionsPushGetViewerOff(PetscBool);
166a30ec4eaSSatish Balay PETSC_EXTERN PetscErrorCode PetscOptionsPopGetViewerOff(void);
167eb55bdffSLawrence Mitchell PETSC_EXTERN PetscErrorCode PetscOptionsGetViewerOff(PetscBool*);
16816413a6aSBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsGetViewer(MPI_Comm,PetscOptions,const char[],const char[],PetscViewer*,PetscViewerFormat*,PetscBool*);
169e83a5d19SLisandro Dalcin #define PetscOptionsViewer(a,b,c,d,e,f) PetscOptionsViewer_Private(PetscOptionsObject,a,b,c,d,e,f)
1704416b707SBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsViewer_Private(PetscOptionItems*,const char[],const char[],const char[],PetscViewer*,PetscViewerFormat *,PetscBool *);
1712bf49c77SBarry Smith 
172fe01d993SBarry Smith typedef struct {PetscViewer viewer;PetscViewerFormat format;} PetscViewerAndFormat;
173d7cbc13eSBarry Smith PETSC_EXTERN PetscErrorCode  PetscViewerAndFormatCreate(PetscViewer,PetscViewerFormat,PetscViewerAndFormat**);
174fe01d993SBarry Smith PETSC_EXTERN PetscErrorCode  PetscViewerAndFormatDestroy(PetscViewerAndFormat**);
175fe01d993SBarry Smith 
17677ed5343SBarry Smith /*
17777ed5343SBarry Smith    Operations explicit to a particular class of viewers
17877ed5343SBarry Smith */
179ed5c6e3eSMatthew Knepley 
180014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetPointer(PetscViewer,FILE**);
181014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileGetMode(PetscViewer,PetscFileMode*);
182014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileSetMode(PetscViewer,PetscFileMode);
183060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerRead(PetscViewer,void*,PetscInt,PetscInt*,PetscDataType);
184014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPrintf(PetscViewer,const char[],...);
185014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISynchronizedPrintf(PetscViewer,const char[],...);
1861575c14dSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushSynchronized(PetscViewer);
1871575c14dSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopSynchronized(PetscViewer);
188014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushTab(PetscViewer);
189014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopTab(PetscViewer);
190014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIUseTabs(PetscViewer,PetscBool );
191014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISetTab(PetscViewer,PetscInt);
192014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetTab(PetscViewer,PetscInt*);
193014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIAddTab(PetscViewer,PetscInt);
194014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISubtractTab(PetscViewer,PetscInt);
195060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerASCIIRead(PetscViewer,void *,PetscInt,PetscInt*,PetscDataType);
196014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetDescriptor(PetscViewer,int*);
197014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetInfoPointer(PetscViewer,FILE **);
198060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerBinaryRead(PetscViewer,void*,PetscInt,PetscInt*,PetscDataType);
199f253e43cSLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerBinaryWrite(PetscViewer,const void*,PetscInt,PetscDataType);
200*5972f5f3SLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerBinaryReadAll(PetscViewer,void*,PetscInt,PetscInt,PetscInt,PetscDataType);
201*5972f5f3SLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerBinaryWriteAll(PetscViewer,const void*,PetscInt,PetscInt,PetscInt,PetscDataType);
202014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerStringSPrintf(PetscViewer,const char[],...);
20336a9e3b9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringSetString(PetscViewer,char[],size_t);
20436a9e3b9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringGetStringRead(PetscViewer,const char*[],size_t*);
20536a9e3b9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringSetOwnString(PetscViewer);
206014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawClear(PetscViewer);
207014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetHold(PetscViewer,PetscBool);
208014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetHold(PetscViewer,PetscBool*);
209014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetPause(PetscViewer,PetscReal);
210014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetPause(PetscViewer,PetscReal*);
211014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetInfo(PetscViewer,const char[],const char[],int,int,int,int);
212014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawResize(PetscViewer,int,int);
213014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetBounds(PetscViewer,PetscInt,const PetscReal*);
214014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetBounds(PetscViewer,PetscInt*,const PetscReal**);
215014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSocketSetConnection(PetscViewer,const char[],int);
216014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySkipInfo(PetscViewer);
217807ea322SDave May PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipInfo(PetscViewer,PetscBool);
218807ea322SDave May PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipInfo(PetscViewer,PetscBool*);
219014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipOptions(PetscViewer,PetscBool );
220014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipOptions(PetscViewer,PetscBool *);
221014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipHeader(PetscViewer,PetscBool);
222014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipHeader(PetscViewer,PetscBool*);
223014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryReadStringArray(PetscViewer,char***);
22478fbdcc8SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerBinaryWriteStringArray(PetscViewer,const char *const*);
225c655490fSBarry Smith 
226014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileSetName(PetscViewer,const char[]);
227014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileGetName(PetscViewer,const char**);
22877ed5343SBarry Smith 
229014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUGetPointer(PetscViewer, FILE**);
230014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUSetVecSeen(PetscViewer, PetscBool );
231014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUGetVecSeen(PetscViewer, PetscBool  *);
232014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUPrintDeferred(PetscViewer, const char [], ...);
233014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUFlushDeferred(PetscViewer);
23455dcf840SMatthew Knepley 
235607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerMathematicaInitializePackage(void);
236014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaFinalizePackage(void);
237014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaGetName(PetscViewer, const char **);
238014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSetName(PetscViewer, const char []);
239014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaClearName(PetscViewer);
240014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSkipPackets(PetscViewer, int);
2414ebda54eSMatthew Knepley 
242014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloGetName(PetscViewer, char **);
243014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloSetName(PetscViewer, const char []);
244014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloClearName(PetscViewer);
245014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloGetMeshName(PetscViewer, char **);
246014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloSetMeshName(PetscViewer, const char []);
247014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloClearMeshName(PetscViewer);
2484ebda54eSMatthew Knepley 
249e630c359SToby 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;
250e630c359SToby Isaac PETSC_EXTERN PetscErrorCode PetscViewerVTKAddField(PetscViewer,PetscObject,PetscErrorCode (*PetscViewerVTKWriteFunction)(PetscObject,PetscViewer),PetscInt,PetscViewerVTKFieldType,PetscBool,PetscObject);
251a8f87f1dSPatrick Sanan PETSC_EXTERN PetscErrorCode PetscViewerVTKGetDM(PetscViewer,PetscObject*);
252014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVTKOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
2534061b8bfSJed Brown 
25477ed5343SBarry Smith /*
255d70abbfaSBarry Smith      These are all the default viewers that do not have to be explicitly opened
25677ed5343SBarry Smith */
257014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_STDOUT_(MPI_Comm);
258014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStdout(MPI_Comm,PetscViewer*);
259014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_STDERR_(MPI_Comm);
260014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStderr(MPI_Comm,PetscViewer*);
261014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_DRAW_(MPI_Comm);
262014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_SOCKET_(MPI_Comm);
263014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_BINARY_(MPI_Comm);
264014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_MATLAB_(MPI_Comm);
265a75e6a4aSMatthew G. Knepley PETSC_EXTERN PetscViewer    PETSC_VIEWER_HDF5_(MPI_Comm);
2668135c375SStefano Zampini PETSC_EXTERN PetscViewer    PETSC_VIEWER_GLVIS_(MPI_Comm);
2671e50132fSMatthew G. Knepley PETSC_EXTERN PetscViewer    PETSC_VIEWER_EXODUSII_(MPI_Comm);
268014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE;
2695311e20fSBarry Smith 
270f09f0971SVáclav Hapla /*MC
271f09f0971SVáclav Hapla   PETSC_VIEWER_STDERR_SELF  - same as PETSC_VIEWER_STDERR_(PETSC_COMM_SELF)
272f09f0971SVáclav Hapla 
273f09f0971SVáclav Hapla   Level: beginner
274f09f0971SVáclav Hapla M*/
275b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_SELF  PETSC_VIEWER_STDERR_(PETSC_COMM_SELF)
276f09f0971SVáclav Hapla 
277f09f0971SVáclav Hapla /*MC
278f09f0971SVáclav Hapla   PETSC_VIEWER_STDERR_WORLD  - same as PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD)
279f09f0971SVáclav Hapla 
280f09f0971SVáclav Hapla   Level: beginner
281f09f0971SVáclav Hapla M*/
282b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD)
28330de9b25SBarry Smith 
28430de9b25SBarry Smith /*MC
28530de9b25SBarry Smith   PETSC_VIEWER_STDOUT_WORLD  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
28630de9b25SBarry Smith 
28730de9b25SBarry Smith   Level: beginner
28830de9b25SBarry Smith M*/
28930de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
29030de9b25SBarry Smith 
29130de9b25SBarry Smith /*MC
29230de9b25SBarry Smith   PETSC_VIEWER_STDOUT_SELF  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
29330de9b25SBarry Smith 
29430de9b25SBarry Smith   Level: beginner
29530de9b25SBarry Smith M*/
29630de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_SELF  PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
29730de9b25SBarry Smith 
29830de9b25SBarry Smith /*MC
29930de9b25SBarry Smith   PETSC_VIEWER_DRAW_WORLD  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
30030de9b25SBarry Smith 
30130de9b25SBarry Smith   Level: intermediate
30230de9b25SBarry Smith M*/
303b0a32e0cSBarry Smith #define PETSC_VIEWER_DRAW_WORLD   PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
30430de9b25SBarry Smith 
30530de9b25SBarry Smith /*MC
30630de9b25SBarry Smith   PETSC_VIEWER_DRAW_SELF  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
30730de9b25SBarry Smith 
30830de9b25SBarry Smith   Level: intermediate
30930de9b25SBarry Smith M*/
31030de9b25SBarry Smith #define PETSC_VIEWER_DRAW_SELF    PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
31130de9b25SBarry Smith 
31230de9b25SBarry Smith /*MC
31330de9b25SBarry Smith   PETSC_VIEWER_SOCKET_WORLD  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
31430de9b25SBarry Smith 
31530de9b25SBarry Smith   Level: intermediate
31630de9b25SBarry Smith M*/
317b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
31830de9b25SBarry Smith 
31930de9b25SBarry Smith /*MC
32030de9b25SBarry Smith   PETSC_VIEWER_SOCKET_SELF  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
32130de9b25SBarry Smith 
32230de9b25SBarry Smith   Level: intermediate
32330de9b25SBarry Smith M*/
324b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_SELF  PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
32530de9b25SBarry Smith 
32630de9b25SBarry Smith /*MC
32730de9b25SBarry Smith   PETSC_VIEWER_BINARY_WORLD  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
32830de9b25SBarry Smith 
32930de9b25SBarry Smith   Level: intermediate
33030de9b25SBarry Smith M*/
331b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
33230de9b25SBarry Smith 
33330de9b25SBarry Smith /*MC
33430de9b25SBarry Smith   PETSC_VIEWER_BINARY_SELF  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
33530de9b25SBarry Smith 
33630de9b25SBarry Smith   Level: intermediate
33730de9b25SBarry Smith M*/
338b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_SELF  PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
33930de9b25SBarry Smith 
340cbb32127SBarry Smith /*MC
341cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_WORLD  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
342cbb32127SBarry Smith 
343cbb32127SBarry Smith   Level: intermediate
344cbb32127SBarry Smith M*/
345cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
346cbb32127SBarry Smith 
347cbb32127SBarry Smith /*MC
348cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_SELF  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
349cbb32127SBarry Smith 
350cbb32127SBarry Smith   Level: intermediate
351cbb32127SBarry Smith M*/
352cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_SELF  PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
353cbb32127SBarry Smith 
3547eb62a3eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(),PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE)
35565ef3172SBarry Smith 
3564a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStart(PetscViewer,PetscInt*,PetscInt*);
3574a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepMaster(PetscViewer,PetscInt,PetscInt*,PetscInt);
3584a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndMaster(PetscViewer,PetscInt*);
3594a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepWorker(PetscViewer,PetscMPIInt,PetscInt*);
3604a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndWorker(PetscViewer,PetscInt*);
361e03d165dSBarry Smith 
36277ed5343SBarry Smith /*
363a5057860SBarry Smith    PetscViewer writes to MATLAB .mat file
364cbb32127SBarry Smith */
365014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutArray(PetscViewer,int,int,const PetscScalar*,const char*);
366014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabGetArray(PetscViewer,int,int,PetscScalar*,const char*);
367014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutVariable(PetscViewer,const char*,void*);
368cbb32127SBarry Smith 
369e04113cfSBarry Smith #if defined(PETSC_HAVE_SAWS)
370e04113cfSBarry Smith PETSC_EXTERN PetscErrorCode PetscObjectViewSAWs(PetscObject,PetscViewer);
371bfb97211SBarry Smith #endif
372bfb97211SBarry Smith 
373b9617806SBarry Smith /*S
3741890ba74SBarry Smith      PetscViewers - Abstract collection of PetscViewers. It is just an expandable array of viewers.
375b9617806SBarry Smith 
376b9617806SBarry Smith    Level: intermediate
377b9617806SBarry Smith 
378b9617806SBarry Smith .seealso:  PetscViewerCreate(), PetscViewerSetType(), PetscViewerType, PetscViewer, PetscViewersCreate(),
379b9617806SBarry Smith            PetscViewersGetViewer()
380b9617806SBarry Smith S*/
38195fbd943SSatish Balay typedef struct _n_PetscViewers* PetscViewers;
382014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersCreate(MPI_Comm,PetscViewers*);
383014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersDestroy(PetscViewers*);
384014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersGetViewer(PetscViewers,PetscInt,PetscViewer*);
385d132466eSBarry Smith 
386cb5b572fSBarry Smith #endif
387