xref: /petsc/include/petscviewer.h (revision bb77a09f7f3252c5ccd8b7f0ad10e118587d6fe7)
184cb2905SBarry Smith /*
2b0a32e0cSBarry Smith      PetscViewers are objects where other objects can be looked at or stored.
384cb2905SBarry Smith */
43c119ea2SBarry Smith 
50a835dfdSSatish Balay #if !defined(__PETSCVIEWER_H)
60a835dfdSSatish Balay #define __PETSCVIEWER_H
7dfbe8321SBarry Smith 
86420c192SJed Brown #include <petscsys.h>
9c619b03eSJed Brown #include <petscviewertypes.h>
10e9fa29b7SSatish Balay 
11014dd563SJed Brown PETSC_EXTERN PetscClassId PETSC_VIEWER_CLASSID;
12e9fa29b7SSatish Balay 
1376bdecfbSBarry Smith /*J
14b9617806SBarry Smith     PetscViewerType - String with the name of a PETSc PETScViewer
15b9617806SBarry Smith 
16b9617806SBarry Smith    Level: beginner
17b9617806SBarry Smith 
188f6c3df8SBarry Smith .seealso: PetscViewerSetType(), PetscViewer, PetscViewerRegister(), PetscViewerCreate()
1976bdecfbSBarry Smith J*/
2019fd82e9SBarry Smith typedef const char* PetscViewerType;
212692d6eeSBarry Smith #define PETSCVIEWERSOCKET       "socket"
222692d6eeSBarry Smith #define PETSCVIEWERASCII        "ascii"
232692d6eeSBarry Smith #define PETSCVIEWERBINARY       "binary"
242692d6eeSBarry Smith #define PETSCVIEWERSTRING       "string"
252692d6eeSBarry Smith #define PETSCVIEWERDRAW         "draw"
262692d6eeSBarry Smith #define PETSCVIEWERVU           "vu"
272692d6eeSBarry Smith #define PETSCVIEWERMATHEMATICA  "mathematica"
282692d6eeSBarry Smith #define PETSCVIEWERHDF5         "hdf5"
294061b8bfSJed Brown #define PETSCVIEWERVTK          "vtk"
302692d6eeSBarry Smith #define PETSCVIEWERMATLAB       "matlab"
31e04113cfSBarry Smith #define PETSCVIEWERSAWS         "saws"
328135c375SStefano Zampini #define PETSCVIEWERGLVIS        "glvis"
3377ed5343SBarry Smith 
34140e18c1SBarry Smith PETSC_EXTERN PetscFunctionList PetscViewerList;
35607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerInitializePackage(void);
367b2a1423SBarry Smith 
37bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerRegister(const char[],PetscErrorCode (*)(PetscViewer));
3830de9b25SBarry Smith 
39014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerCreate(MPI_Comm,PetscViewer*);
40014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetFromOptions(PetscViewer);
41014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpenWithFILE(MPI_Comm,FILE*,PetscViewer*);
427b2a1423SBarry Smith 
43014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpen(MPI_Comm,const char[],PetscViewer*);
44014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISetFILE(PetscViewer,FILE*);
45014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
46014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetFlowControl(PetscViewer,PetscInt*);
47014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetFlowControl(PetscViewer,PetscInt);
48bc196f7cSDave May PETSC_EXTERN PetscErrorCode PetscViewerBinarySetUseMPIIO(PetscViewer,PetscBool);
49bc196f7cSDave May PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetUseMPIIO(PetscViewer,PetscBool *);
500fc9d207SBarry Smith #if defined(PETSC_HAVE_MPIIO)
51014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIODescriptor(PetscViewer,MPI_File*);
52014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIOOffset(PetscViewer,MPI_Offset*);
53014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryAddMPIIOOffset(PetscViewer,MPI_Offset);
54951e3c8eSBarry Smith #endif
5539802e9eSBarry Smith 
56014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSocketOpen(MPI_Comm,const char[],int,PetscViewer*);
5789d949e2SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringOpen(MPI_Comm,char[],size_t,PetscViewer*);
58014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawOpen(MPI_Comm,const char[],const char[],int,int,int,int,PetscViewer*);
59d1da0b69SBarry Smith #include <petscdrawtypes.h>
60d1da0b69SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerDrawSetDrawType(PetscViewer,PetscDrawType);
61014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *);
62014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloOpen(MPI_Comm, const char[], PetscViewer *);
63014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
644b0e389bSBarry Smith 
658135c375SStefano Zampini /*E
668135c375SStefano Zampini     PetscViewerGLVisType - indicates what type of GLVis viewer to use
678135c375SStefano Zampini 
688135c375SStefano Zampini     Level: beginner
698135c375SStefano Zampini 
708135c375SStefano Zampini .seealso: PetscViewerGLVisOpen()
718135c375SStefano Zampini E*/
728135c375SStefano Zampini typedef enum {PETSC_VIEWER_GLVIS_DUMP, PETSC_VIEWER_GLVIS_SOCKET} PetscViewerGLVisType;
738135c375SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisOpen(MPI_Comm,PetscViewerGLVisType,const char*,PetscInt,PetscViewer*);
748135c375SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetSnapId(PetscViewer,PetscInt);
75*bb77a09fSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetFields(PetscViewer,PetscInt,const char*[],const char*[],PetscInt[],PetscInt[],PetscInt[],PetscErrorCode(*)(PetscObject,PetscInt,PetscObject[],void*),void*,PetscErrorCode(*)(void*));
768135c375SStefano Zampini 
7719fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerGetType(PetscViewer,PetscViewerType*);
7819fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerSetType(PetscViewer,PetscViewerType);
79014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDestroy(PetscViewer*);
803f08860eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerGetSubViewer(PetscViewer,MPI_Comm,PetscViewer*);
813f08860eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerRestoreSubViewer(PetscViewer,MPI_Comm,PetscViewer*);
82ae39576cSLois Curfman McInnes 
83014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetUp(PetscViewer);
84014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerView(PetscViewer,PetscViewer);
85685405a1SBarry Smith PETSC_STATIC_INLINE PetscErrorCode PetscViewerViewFromOptions(PetscViewer A,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,obj,name);}
86f69a0ea3SMatthew Knepley 
87014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetOptionsPrefix(PetscViewer,const char[]);
88014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerAppendOptionsPrefix(PetscViewer,const char[]);
89014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerGetOptionsPrefix(PetscViewer,const char*[]);
90090de74eSSatish Balay 
91b9617806SBarry Smith /*E
92b9617806SBarry Smith     PetscViewerFormat - Way a viewer presents the object
93b9617806SBarry Smith 
94b9617806SBarry Smith    Level: beginner
95b9617806SBarry Smith 
96af0996ceSBarry Smith    The values below are also listed in petsc/finclude/petscviewer.h. If another values is added below it
97cfaaf4edSHong Zhang    must also be added there.
98cfaaf4edSHong Zhang 
996a9046bcSBarry Smith .seealso: PetscViewer, PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat()
100b9617806SBarry Smith E*/
101fb9695e5SSatish Balay typedef enum {
102117016b1SBarry Smith   PETSC_VIEWER_DEFAULT,
103f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_MATLAB,
1044ebda54eSMatthew Knepley   PETSC_VIEWER_ASCII_MATHEMATICA,
105f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_IMPL,
106f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INFO,
107456192e2SBarry Smith   PETSC_VIEWER_ASCII_INFO_DETAIL,
108f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_COMMON,
109f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_SYMMODU,
110f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INDEX,
111f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_DENSE,
1123c215bfdSMatthew Knepley   PETSC_VIEWER_ASCII_MATRIXMARKET,
113a505fa5bSMatthew Knepley   PETSC_VIEWER_ASCII_VTK,
114b85befe5SMatthew Knepley   PETSC_VIEWER_ASCII_VTK_CELL,
115b6d733afSMatthew Knepley   PETSC_VIEWER_ASCII_VTK_COORDS,
116493617b5SMatthew Knepley   PETSC_VIEWER_ASCII_PCICE,
117cfaaf4edSHong Zhang   PETSC_VIEWER_ASCII_PYTHON,
118cfaaf4edSHong Zhang   PETSC_VIEWER_ASCII_FACTOR_INFO,
11967ad5babSMatthew G Knepley   PETSC_VIEWER_ASCII_LATEX,
120bb1d7374SBarry Smith   PETSC_VIEWER_ASCII_XML,
1218135c375SStefano Zampini   PETSC_VIEWER_ASCII_GLVIS,
122f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_BASIC,
123f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_LG,
124f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_CONTOUR,
125f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_PORTS,
1264061b8bfSJed Brown   PETSC_VIEWER_VTK_VTS,
127a13bc4e3SShao-Ching Huang   PETSC_VIEWER_VTK_VTR,
128b263465dSJed Brown   PETSC_VIEWER_VTK_VTU,
129a261c58fSBarry Smith   PETSC_VIEWER_BINARY_MATLAB,
130f3ef73ceSBarry Smith   PETSC_VIEWER_NATIVE,
131ffe0aed0SMatthew G. Knepley   PETSC_VIEWER_HDF5_VIZ,
132cfaaf4edSHong Zhang   PETSC_VIEWER_NOFORMAT
133cfaaf4edSHong Zhang   } PetscViewerFormat;
134014dd563SJed Brown PETSC_EXTERN const char *const PetscViewerFormats[];
135090de74eSSatish Balay 
1366a9046bcSBarry Smith PETSC_EXTERN PETSC_DEPRECATED("Use PetscViewerPushFormat()/PetscViewerPopFormat()") PetscErrorCode PetscViewerSetFormat(PetscViewer,PetscViewerFormat);
137014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerPushFormat(PetscViewer,PetscViewerFormat);
138014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerPopFormat(PetscViewer);
139014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerGetFormat(PetscViewer,PetscViewerFormat*);
140014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFlush(PetscViewer);
1414b0e389bSBarry Smith 
142eb55bdffSLawrence Mitchell PETSC_EXTERN PetscErrorCode PetscOptionsPushGetViewerOff(PetscBool);
143a30ec4eaSSatish Balay PETSC_EXTERN PetscErrorCode PetscOptionsPopGetViewerOff(void);
144eb55bdffSLawrence Mitchell PETSC_EXTERN PetscErrorCode PetscOptionsGetViewerOff(PetscBool*);
145cffb1e40SBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsGetViewer(MPI_Comm,const char[],const char[],PetscViewer*,PetscViewerFormat*,PetscBool*);
146e55864a3SBarry Smith #define PetscOptionsViewer(a,b,c,d,e,f) PetscOptionsViewer_Private(PetscOptionsObject,a,b,c,d,e,f);
1474416b707SBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsViewer_Private(PetscOptionItems*,const char[],const char[],const char[],PetscViewer*,PetscViewerFormat *,PetscBool *);
1482bf49c77SBarry Smith 
149fe01d993SBarry Smith typedef struct {PetscViewer viewer;PetscViewerFormat format;} PetscViewerAndFormat;
150d7cbc13eSBarry Smith PETSC_EXTERN PetscErrorCode  PetscViewerAndFormatCreate(PetscViewer,PetscViewerFormat,PetscViewerAndFormat**);
151fe01d993SBarry Smith PETSC_EXTERN PetscErrorCode  PetscViewerAndFormatDestroy(PetscViewerAndFormat**);
152fe01d993SBarry Smith 
15377ed5343SBarry Smith /*
15477ed5343SBarry Smith    Operations explicit to a particular class of viewers
15577ed5343SBarry Smith */
156ed5c6e3eSMatthew Knepley 
157014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetPointer(PetscViewer,FILE**);
158014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileGetMode(PetscViewer,PetscFileMode*);
159014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileSetMode(PetscViewer,PetscFileMode);
160060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerRead(PetscViewer,void*,PetscInt,PetscInt*,PetscDataType);
161014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPrintf(PetscViewer,const char[],...);
162014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISynchronizedPrintf(PetscViewer,const char[],...);
1631575c14dSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushSynchronized(PetscViewer);
1641575c14dSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopSynchronized(PetscViewer);
165014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushTab(PetscViewer);
166014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopTab(PetscViewer);
167014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIUseTabs(PetscViewer,PetscBool );
168014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISetTab(PetscViewer,PetscInt);
169014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetTab(PetscViewer,PetscInt*);
170014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIAddTab(PetscViewer,PetscInt);
171014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISubtractTab(PetscViewer,PetscInt);
172060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerASCIIRead(PetscViewer,void *,PetscInt,PetscInt*,PetscDataType);
173014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetDescriptor(PetscViewer,int*);
174014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetInfoPointer(PetscViewer,FILE **);
175060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerBinaryRead(PetscViewer,void*,PetscInt,PetscInt*,PetscDataType);
176014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryWrite(PetscViewer,void*,PetscInt,PetscDataType,PetscBool );
177014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerStringSPrintf(PetscViewer,const char[],...);
178014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerStringSetString(PetscViewer,char[],PetscInt);
179014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawClear(PetscViewer);
180014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetHold(PetscViewer,PetscBool);
181014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetHold(PetscViewer,PetscBool*);
182014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetPause(PetscViewer,PetscReal);
183014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetPause(PetscViewer,PetscReal*);
184014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetInfo(PetscViewer,const char[],const char[],int,int,int,int);
185014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawResize(PetscViewer,int,int);
186014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetBounds(PetscViewer,PetscInt,const PetscReal*);
187014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetBounds(PetscViewer,PetscInt*,const PetscReal**);
188014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSocketSetConnection(PetscViewer,const char[],int);
189014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySkipInfo(PetscViewer);
190807ea322SDave May PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipInfo(PetscViewer,PetscBool);
191807ea322SDave May PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipInfo(PetscViewer,PetscBool*);
192014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipOptions(PetscViewer,PetscBool );
193014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipOptions(PetscViewer,PetscBool *);
194014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipHeader(PetscViewer,PetscBool);
195014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipHeader(PetscViewer,PetscBool*);
196014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryReadStringArray(PetscViewer,char***);
19778fbdcc8SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerBinaryWriteStringArray(PetscViewer,const char *const*);
198c655490fSBarry Smith 
199014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileSetName(PetscViewer,const char[]);
200014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileGetName(PetscViewer,const char**);
20177ed5343SBarry Smith 
202014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUGetPointer(PetscViewer, FILE**);
203014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUSetVecSeen(PetscViewer, PetscBool );
204014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUGetVecSeen(PetscViewer, PetscBool  *);
205014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUPrintDeferred(PetscViewer, const char [], ...);
206014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUFlushDeferred(PetscViewer);
20755dcf840SMatthew Knepley 
208607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerMathematicaInitializePackage(void);
209014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaFinalizePackage(void);
210014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaGetName(PetscViewer, const char **);
211014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSetName(PetscViewer, const char []);
212014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaClearName(PetscViewer);
213014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSkipPackets(PetscViewer, int);
2144ebda54eSMatthew Knepley 
215014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloGetName(PetscViewer, char **);
216014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloSetName(PetscViewer, const char []);
217014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloClearName(PetscViewer);
218014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloGetMeshName(PetscViewer, char **);
219014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloSetMeshName(PetscViewer, const char []);
220014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloClearMeshName(PetscViewer);
2214ebda54eSMatthew Knepley 
222893c9c94SMatthew G Knepley typedef enum {PETSC_VTK_POINT_FIELD, PETSC_VTK_POINT_VECTOR_FIELD, PETSC_VTK_CELL_FIELD, PETSC_VTK_CELL_VECTOR_FIELD} PetscViewerVTKFieldType;
22318e2ec27SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerVTKAddField(PetscViewer,PetscObject,PetscErrorCode (*PetscViewerVTKWriteFunction)(PetscObject,PetscViewer),PetscViewerVTKFieldType,PetscObject);
224014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVTKOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
2254061b8bfSJed Brown 
22677ed5343SBarry Smith /*
227d70abbfaSBarry Smith      These are all the default viewers that do not have to be explicitly opened
22877ed5343SBarry Smith */
229014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_STDOUT_(MPI_Comm);
230014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStdout(MPI_Comm,PetscViewer*);
231014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_STDERR_(MPI_Comm);
232014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStderr(MPI_Comm,PetscViewer*);
233014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_DRAW_(MPI_Comm);
234014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_SOCKET_(MPI_Comm);
235014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_BINARY_(MPI_Comm);
236014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_MATLAB_(MPI_Comm);
237a75e6a4aSMatthew G. Knepley PETSC_EXTERN PetscViewer    PETSC_VIEWER_HDF5_(MPI_Comm);
2388135c375SStefano Zampini PETSC_EXTERN PetscViewer    PETSC_VIEWER_GLVIS_(MPI_Comm);
239014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE;
2405311e20fSBarry Smith 
241b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_SELF  PETSC_VIEWER_STDERR_(PETSC_COMM_SELF)
242b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD)
24330de9b25SBarry Smith 
24430de9b25SBarry Smith /*MC
24530de9b25SBarry Smith   PETSC_VIEWER_STDOUT_WORLD  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
24630de9b25SBarry Smith 
24730de9b25SBarry Smith   Level: beginner
24830de9b25SBarry Smith M*/
24930de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
25030de9b25SBarry Smith 
25130de9b25SBarry Smith /*MC
25230de9b25SBarry Smith   PETSC_VIEWER_STDOUT_SELF  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
25330de9b25SBarry Smith 
25430de9b25SBarry Smith   Level: beginner
25530de9b25SBarry Smith M*/
25630de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_SELF  PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
25730de9b25SBarry Smith 
25830de9b25SBarry Smith /*MC
25930de9b25SBarry Smith   PETSC_VIEWER_DRAW_WORLD  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
26030de9b25SBarry Smith 
26130de9b25SBarry Smith   Level: intermediate
26230de9b25SBarry Smith M*/
263b0a32e0cSBarry Smith #define PETSC_VIEWER_DRAW_WORLD   PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
26430de9b25SBarry Smith 
26530de9b25SBarry Smith /*MC
26630de9b25SBarry Smith   PETSC_VIEWER_DRAW_SELF  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
26730de9b25SBarry Smith 
26830de9b25SBarry Smith   Level: intermediate
26930de9b25SBarry Smith M*/
27030de9b25SBarry Smith #define PETSC_VIEWER_DRAW_SELF    PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
27130de9b25SBarry Smith 
27230de9b25SBarry Smith /*MC
27330de9b25SBarry Smith   PETSC_VIEWER_SOCKET_WORLD  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
27430de9b25SBarry Smith 
27530de9b25SBarry Smith   Level: intermediate
27630de9b25SBarry Smith M*/
277b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
27830de9b25SBarry Smith 
27930de9b25SBarry Smith /*MC
28030de9b25SBarry Smith   PETSC_VIEWER_SOCKET_SELF  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
28130de9b25SBarry Smith 
28230de9b25SBarry Smith   Level: intermediate
28330de9b25SBarry Smith M*/
284b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_SELF  PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
28530de9b25SBarry Smith 
28630de9b25SBarry Smith /*MC
28730de9b25SBarry Smith   PETSC_VIEWER_BINARY_WORLD  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
28830de9b25SBarry Smith 
28930de9b25SBarry Smith   Level: intermediate
29030de9b25SBarry Smith M*/
291b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
29230de9b25SBarry Smith 
29330de9b25SBarry Smith /*MC
29430de9b25SBarry Smith   PETSC_VIEWER_BINARY_SELF  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
29530de9b25SBarry Smith 
29630de9b25SBarry Smith   Level: intermediate
29730de9b25SBarry Smith M*/
298b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_SELF  PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
29930de9b25SBarry Smith 
300cbb32127SBarry Smith /*MC
301cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_WORLD  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
302cbb32127SBarry Smith 
303cbb32127SBarry Smith   Level: intermediate
304cbb32127SBarry Smith M*/
305cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
306cbb32127SBarry Smith 
307cbb32127SBarry Smith /*MC
308cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_SELF  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
309cbb32127SBarry Smith 
310cbb32127SBarry Smith   Level: intermediate
311cbb32127SBarry Smith M*/
312cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_SELF  PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
313cbb32127SBarry Smith 
3147eb62a3eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(),PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE)
31565ef3172SBarry Smith 
3164a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStart(PetscViewer,PetscInt*,PetscInt*);
3174a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepMaster(PetscViewer,PetscInt,PetscInt*,PetscInt);
3184a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndMaster(PetscViewer,PetscInt*);
3194a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepWorker(PetscViewer,PetscMPIInt,PetscInt*);
3204a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndWorker(PetscViewer,PetscInt*);
321e03d165dSBarry Smith 
32277ed5343SBarry Smith /*
323a5057860SBarry Smith    PetscViewer writes to MATLAB .mat file
324cbb32127SBarry Smith */
325014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutArray(PetscViewer,int,int,const PetscScalar*,const char*);
326014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabGetArray(PetscViewer,int,int,PetscScalar*,const char*);
327014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutVariable(PetscViewer,const char*,void*);
328cbb32127SBarry Smith 
329e04113cfSBarry Smith #if defined(PETSC_HAVE_SAWS)
330e04113cfSBarry Smith PETSC_EXTERN PetscErrorCode PetscObjectViewSAWs(PetscObject,PetscViewer);
331bfb97211SBarry Smith #endif
332bfb97211SBarry Smith 
333b9617806SBarry Smith /*S
3341890ba74SBarry Smith      PetscViewers - Abstract collection of PetscViewers. It is just an expandable array of viewers.
335b9617806SBarry Smith 
336b9617806SBarry Smith    Level: intermediate
337b9617806SBarry Smith 
338b9617806SBarry Smith   Concepts: viewing
339b9617806SBarry Smith 
340b9617806SBarry Smith .seealso:  PetscViewerCreate(), PetscViewerSetType(), PetscViewerType, PetscViewer, PetscViewersCreate(),
341b9617806SBarry Smith            PetscViewersGetViewer()
342b9617806SBarry Smith S*/
34395fbd943SSatish Balay typedef struct _n_PetscViewers* PetscViewers;
344014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersCreate(MPI_Comm,PetscViewers*);
345014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersDestroy(PetscViewers*);
346014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersGetViewer(PetscViewers,PetscInt,PetscViewer*);
347d132466eSBarry Smith 
348cb5b572fSBarry Smith #endif
349