xref: /petsc/include/petscviewer.h (revision 36a9e3b9f6565ce1252c167e0dc4a4cf71b0f2ec)
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>
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"
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*);
5055d657eeSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerADIOS2Open(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
51014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetFlowControl(PetscViewer,PetscInt*);
52014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetFlowControl(PetscViewer,PetscInt);
53bc196f7cSDave May PETSC_EXTERN PetscErrorCode PetscViewerBinarySetUseMPIIO(PetscViewer,PetscBool);
54bc196f7cSDave May PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetUseMPIIO(PetscViewer,PetscBool *);
550fc9d207SBarry Smith #if defined(PETSC_HAVE_MPIIO)
56014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIODescriptor(PetscViewer,MPI_File*);
57014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIOOffset(PetscViewer,MPI_Offset*);
58014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryAddMPIIOOffset(PetscViewer,MPI_Offset);
59951e3c8eSBarry Smith #endif
6039802e9eSBarry Smith 
61014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSocketOpen(MPI_Comm,const char[],int,PetscViewer*);
6289d949e2SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringOpen(MPI_Comm,char[],size_t,PetscViewer*);
63014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawOpen(MPI_Comm,const char[],const char[],int,int,int,int,PetscViewer*);
64d1da0b69SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerDrawSetDrawType(PetscViewer,PetscDrawType);
651f49e1f7SLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDrawType(PetscViewer,PetscDrawType*);
66f55236e4SLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerDrawSetTitle(PetscViewer,const char[]);
67f55236e4SLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscViewerDrawGetTitle(PetscViewer,const char*[]);
680954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDraw(PetscViewer,PetscInt,PetscDraw*);
690954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawBaseAdd(PetscViewer,PetscInt);
700954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawBaseSet(PetscViewer,PetscInt);
710954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDrawLG(PetscViewer,PetscInt,PetscDrawLG*);
720954c5ccSStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerDrawGetDrawAxis(PetscViewer,PetscInt,PetscDrawAxis*);
730954c5ccSStefano Zampini 
74014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *);
75014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloOpen(MPI_Comm, const char[], PetscViewer *);
76014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
774b0e389bSBarry Smith 
788135c375SStefano Zampini /*E
798135c375SStefano Zampini     PetscViewerGLVisType - indicates what type of GLVis viewer to use
808135c375SStefano Zampini 
818135c375SStefano Zampini     Level: beginner
828135c375SStefano Zampini 
838135c375SStefano Zampini .seealso: PetscViewerGLVisOpen()
848135c375SStefano Zampini E*/
858135c375SStefano Zampini typedef enum {PETSC_VIEWER_GLVIS_DUMP, PETSC_VIEWER_GLVIS_SOCKET} PetscViewerGLVisType;
868135c375SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisOpen(MPI_Comm,PetscViewerGLVisType,const char*,PetscInt,PetscViewer*);
8777eacf09SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetPrecision(PetscViewer,PetscInt);
888135c375SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetSnapId(PetscViewer,PetscInt);
894cac2994SStefano Zampini PETSC_EXTERN PetscErrorCode PetscViewerGLVisSetFields(PetscViewer,PetscInt,const char*[],PetscInt[],PetscErrorCode(*)(PetscObject,PetscInt,PetscObject[],void*),PetscObject[],void*,PetscErrorCode(*)(void*));
908135c375SStefano Zampini 
9119fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerGetType(PetscViewer,PetscViewerType*);
9219fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerSetType(PetscViewer,PetscViewerType);
93014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDestroy(PetscViewer*);
943f08860eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerGetSubViewer(PetscViewer,MPI_Comm,PetscViewer*);
953f08860eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerRestoreSubViewer(PetscViewer,MPI_Comm,PetscViewer*);
96ae39576cSLois Curfman McInnes 
97014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetUp(PetscViewer);
98014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerView(PetscViewer,PetscViewer);
99685405a1SBarry Smith PETSC_STATIC_INLINE PetscErrorCode PetscViewerViewFromOptions(PetscViewer A,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,obj,name);}
100f69a0ea3SMatthew Knepley 
101014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetOptionsPrefix(PetscViewer,const char[]);
102014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerAppendOptionsPrefix(PetscViewer,const char[]);
103014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerGetOptionsPrefix(PetscViewer,const char*[]);
104090de74eSSatish Balay 
105e24fdd67SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerReadable(PetscViewer,PetscBool*);
106e24fdd67SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerWritable(PetscViewer,PetscBool*);
107d01f05b1SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerCheckReadable(PetscViewer);
108d01f05b1SVaclav Hapla PETSC_EXTERN PetscErrorCode PetscViewerCheckWritable(PetscViewer);
109e24fdd67SVaclav Hapla 
110b9617806SBarry Smith /*E
111b9617806SBarry Smith     PetscViewerFormat - Way a viewer presents the object
112b9617806SBarry Smith 
113b9617806SBarry Smith    Level: beginner
114b9617806SBarry Smith 
1156a9046bcSBarry Smith .seealso: PetscViewer, PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat()
116b9617806SBarry Smith E*/
117fb9695e5SSatish Balay typedef enum {
118117016b1SBarry Smith   PETSC_VIEWER_DEFAULT,
119f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_MATLAB,
1204ebda54eSMatthew Knepley   PETSC_VIEWER_ASCII_MATHEMATICA,
121f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_IMPL,
122f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INFO,
123456192e2SBarry Smith   PETSC_VIEWER_ASCII_INFO_DETAIL,
124f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_COMMON,
125f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_SYMMODU,
126f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INDEX,
127f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_DENSE,
1283c215bfdSMatthew Knepley   PETSC_VIEWER_ASCII_MATRIXMARKET,
129a505fa5bSMatthew Knepley   PETSC_VIEWER_ASCII_VTK,
130b85befe5SMatthew Knepley   PETSC_VIEWER_ASCII_VTK_CELL,
131b6d733afSMatthew Knepley   PETSC_VIEWER_ASCII_VTK_COORDS,
132493617b5SMatthew Knepley   PETSC_VIEWER_ASCII_PCICE,
133cfaaf4edSHong Zhang   PETSC_VIEWER_ASCII_PYTHON,
134cfaaf4edSHong Zhang   PETSC_VIEWER_ASCII_FACTOR_INFO,
13567ad5babSMatthew G Knepley   PETSC_VIEWER_ASCII_LATEX,
136bb1d7374SBarry Smith   PETSC_VIEWER_ASCII_XML,
1378135c375SStefano Zampini   PETSC_VIEWER_ASCII_GLVIS,
138f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_BASIC,
139f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_LG,
140bb046f40SHong Zhang   PETSC_VIEWER_DRAW_LG_XRANGE,
141f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_CONTOUR,
142f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_PORTS,
1434061b8bfSJed Brown   PETSC_VIEWER_VTK_VTS,
144a13bc4e3SShao-Ching Huang   PETSC_VIEWER_VTK_VTR,
145b263465dSJed Brown   PETSC_VIEWER_VTK_VTU,
146a261c58fSBarry Smith   PETSC_VIEWER_BINARY_MATLAB,
147f3ef73ceSBarry Smith   PETSC_VIEWER_NATIVE,
1488aa4816bSVaclav Hapla   PETSC_VIEWER_HDF5_PETSC,
149ffe0aed0SMatthew G. Knepley   PETSC_VIEWER_HDF5_VIZ,
1508aa4816bSVaclav Hapla   PETSC_VIEWER_HDF5_XDMF,
151cbb4c999SVaclav Hapla   PETSC_VIEWER_HDF5_MAT,
152ef5fdb51SBarry Smith   PETSC_VIEWER_NOFORMAT,
153ef5fdb51SBarry Smith   PETSC_VIEWER_LOAD_BALANCE
154cfaaf4edSHong Zhang   } PetscViewerFormat;
155014dd563SJed Brown PETSC_EXTERN const char *const PetscViewerFormats[];
156090de74eSSatish Balay 
1576a9046bcSBarry Smith PETSC_EXTERN PETSC_DEPRECATED("Use PetscViewerPushFormat()/PetscViewerPopFormat()") PetscErrorCode PetscViewerSetFormat(PetscViewer,PetscViewerFormat);
158014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerPushFormat(PetscViewer,PetscViewerFormat);
159014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerPopFormat(PetscViewer);
160014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerGetFormat(PetscViewer,PetscViewerFormat*);
161014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFlush(PetscViewer);
1624b0e389bSBarry Smith 
163eb55bdffSLawrence Mitchell PETSC_EXTERN PetscErrorCode PetscOptionsPushGetViewerOff(PetscBool);
164a30ec4eaSSatish Balay PETSC_EXTERN PetscErrorCode PetscOptionsPopGetViewerOff(void);
165eb55bdffSLawrence Mitchell PETSC_EXTERN PetscErrorCode PetscOptionsGetViewerOff(PetscBool*);
16616413a6aSBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsGetViewer(MPI_Comm,PetscOptions,const char[],const char[],PetscViewer*,PetscViewerFormat*,PetscBool*);
167e55864a3SBarry Smith #define PetscOptionsViewer(a,b,c,d,e,f) PetscOptionsViewer_Private(PetscOptionsObject,a,b,c,d,e,f);
1684416b707SBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsViewer_Private(PetscOptionItems*,const char[],const char[],const char[],PetscViewer*,PetscViewerFormat *,PetscBool *);
1692bf49c77SBarry Smith 
170fe01d993SBarry Smith typedef struct {PetscViewer viewer;PetscViewerFormat format;} PetscViewerAndFormat;
171d7cbc13eSBarry Smith PETSC_EXTERN PetscErrorCode  PetscViewerAndFormatCreate(PetscViewer,PetscViewerFormat,PetscViewerAndFormat**);
172fe01d993SBarry Smith PETSC_EXTERN PetscErrorCode  PetscViewerAndFormatDestroy(PetscViewerAndFormat**);
173fe01d993SBarry Smith 
17477ed5343SBarry Smith /*
17577ed5343SBarry Smith    Operations explicit to a particular class of viewers
17677ed5343SBarry Smith */
177ed5c6e3eSMatthew Knepley 
178014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetPointer(PetscViewer,FILE**);
179014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileGetMode(PetscViewer,PetscFileMode*);
180014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileSetMode(PetscViewer,PetscFileMode);
181060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerRead(PetscViewer,void*,PetscInt,PetscInt*,PetscDataType);
182014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPrintf(PetscViewer,const char[],...);
183014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISynchronizedPrintf(PetscViewer,const char[],...);
1841575c14dSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushSynchronized(PetscViewer);
1851575c14dSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopSynchronized(PetscViewer);
186014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushTab(PetscViewer);
187014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopTab(PetscViewer);
188014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIUseTabs(PetscViewer,PetscBool );
189014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISetTab(PetscViewer,PetscInt);
190014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetTab(PetscViewer,PetscInt*);
191014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIAddTab(PetscViewer,PetscInt);
192014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISubtractTab(PetscViewer,PetscInt);
193060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerASCIIRead(PetscViewer,void *,PetscInt,PetscInt*,PetscDataType);
194014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetDescriptor(PetscViewer,int*);
195014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetInfoPointer(PetscViewer,FILE **);
196060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerBinaryRead(PetscViewer,void*,PetscInt,PetscInt*,PetscDataType);
197014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryWrite(PetscViewer,void*,PetscInt,PetscDataType,PetscBool );
198014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerStringSPrintf(PetscViewer,const char[],...);
199*36a9e3b9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringSetString(PetscViewer,char[],size_t);
200*36a9e3b9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringGetStringRead(PetscViewer,const char*[],size_t*);
201*36a9e3b9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringSetOwnString(PetscViewer);
202014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawClear(PetscViewer);
203014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetHold(PetscViewer,PetscBool);
204014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetHold(PetscViewer,PetscBool*);
205014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetPause(PetscViewer,PetscReal);
206014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetPause(PetscViewer,PetscReal*);
207014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetInfo(PetscViewer,const char[],const char[],int,int,int,int);
208014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawResize(PetscViewer,int,int);
209014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetBounds(PetscViewer,PetscInt,const PetscReal*);
210014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetBounds(PetscViewer,PetscInt*,const PetscReal**);
211014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSocketSetConnection(PetscViewer,const char[],int);
212014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySkipInfo(PetscViewer);
213807ea322SDave May PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipInfo(PetscViewer,PetscBool);
214807ea322SDave May PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipInfo(PetscViewer,PetscBool*);
215014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipOptions(PetscViewer,PetscBool );
216014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipOptions(PetscViewer,PetscBool *);
217014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipHeader(PetscViewer,PetscBool);
218014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipHeader(PetscViewer,PetscBool*);
219014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryReadStringArray(PetscViewer,char***);
22078fbdcc8SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerBinaryWriteStringArray(PetscViewer,const char *const*);
221c655490fSBarry Smith 
222014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileSetName(PetscViewer,const char[]);
223014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileGetName(PetscViewer,const char**);
22477ed5343SBarry Smith 
225014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUGetPointer(PetscViewer, FILE**);
226014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUSetVecSeen(PetscViewer, PetscBool );
227014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUGetVecSeen(PetscViewer, PetscBool  *);
228014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUPrintDeferred(PetscViewer, const char [], ...);
229014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUFlushDeferred(PetscViewer);
23055dcf840SMatthew Knepley 
231607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerMathematicaInitializePackage(void);
232014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaFinalizePackage(void);
233014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaGetName(PetscViewer, const char **);
234014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSetName(PetscViewer, const char []);
235014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaClearName(PetscViewer);
236014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSkipPackets(PetscViewer, int);
2374ebda54eSMatthew Knepley 
238014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloGetName(PetscViewer, char **);
239014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloSetName(PetscViewer, const char []);
240014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloClearName(PetscViewer);
241014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloGetMeshName(PetscViewer, char **);
242014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloSetMeshName(PetscViewer, const char []);
243014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloClearMeshName(PetscViewer);
2444ebda54eSMatthew Knepley 
245893c9c94SMatthew G Knepley typedef enum {PETSC_VTK_POINT_FIELD, PETSC_VTK_POINT_VECTOR_FIELD, PETSC_VTK_CELL_FIELD, PETSC_VTK_CELL_VECTOR_FIELD} PetscViewerVTKFieldType;
246a8f87f1dSPatrick Sanan PETSC_EXTERN PetscErrorCode PetscViewerVTKAddField(PetscViewer,PetscObject,PetscErrorCode (*PetscViewerVTKWriteFunction)(PetscObject,PetscViewer),PetscViewerVTKFieldType,PetscBool,PetscObject);
247a8f87f1dSPatrick Sanan PETSC_EXTERN PetscErrorCode PetscViewerVTKGetDM(PetscViewer,PetscObject*);
248014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVTKOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
2494061b8bfSJed Brown 
25077ed5343SBarry Smith /*
251d70abbfaSBarry Smith      These are all the default viewers that do not have to be explicitly opened
25277ed5343SBarry Smith */
253014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_STDOUT_(MPI_Comm);
254014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStdout(MPI_Comm,PetscViewer*);
255014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_STDERR_(MPI_Comm);
256014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStderr(MPI_Comm,PetscViewer*);
257014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_DRAW_(MPI_Comm);
258014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_SOCKET_(MPI_Comm);
259014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_BINARY_(MPI_Comm);
260014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_MATLAB_(MPI_Comm);
261a75e6a4aSMatthew G. Knepley PETSC_EXTERN PetscViewer    PETSC_VIEWER_HDF5_(MPI_Comm);
2628135c375SStefano Zampini PETSC_EXTERN PetscViewer    PETSC_VIEWER_GLVIS_(MPI_Comm);
263014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE;
2645311e20fSBarry Smith 
265f09f0971SVáclav Hapla /*MC
266f09f0971SVáclav Hapla   PETSC_VIEWER_STDERR_SELF  - same as PETSC_VIEWER_STDERR_(PETSC_COMM_SELF)
267f09f0971SVáclav Hapla 
268f09f0971SVáclav Hapla   Level: beginner
269f09f0971SVáclav Hapla M*/
270b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_SELF  PETSC_VIEWER_STDERR_(PETSC_COMM_SELF)
271f09f0971SVáclav Hapla 
272f09f0971SVáclav Hapla /*MC
273f09f0971SVáclav Hapla   PETSC_VIEWER_STDERR_WORLD  - same as PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD)
274f09f0971SVáclav Hapla 
275f09f0971SVáclav Hapla   Level: beginner
276f09f0971SVáclav Hapla M*/
277b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD)
27830de9b25SBarry Smith 
27930de9b25SBarry Smith /*MC
28030de9b25SBarry Smith   PETSC_VIEWER_STDOUT_WORLD  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
28130de9b25SBarry Smith 
28230de9b25SBarry Smith   Level: beginner
28330de9b25SBarry Smith M*/
28430de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
28530de9b25SBarry Smith 
28630de9b25SBarry Smith /*MC
28730de9b25SBarry Smith   PETSC_VIEWER_STDOUT_SELF  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
28830de9b25SBarry Smith 
28930de9b25SBarry Smith   Level: beginner
29030de9b25SBarry Smith M*/
29130de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_SELF  PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
29230de9b25SBarry Smith 
29330de9b25SBarry Smith /*MC
29430de9b25SBarry Smith   PETSC_VIEWER_DRAW_WORLD  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
29530de9b25SBarry Smith 
29630de9b25SBarry Smith   Level: intermediate
29730de9b25SBarry Smith M*/
298b0a32e0cSBarry Smith #define PETSC_VIEWER_DRAW_WORLD   PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
29930de9b25SBarry Smith 
30030de9b25SBarry Smith /*MC
30130de9b25SBarry Smith   PETSC_VIEWER_DRAW_SELF  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
30230de9b25SBarry Smith 
30330de9b25SBarry Smith   Level: intermediate
30430de9b25SBarry Smith M*/
30530de9b25SBarry Smith #define PETSC_VIEWER_DRAW_SELF    PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
30630de9b25SBarry Smith 
30730de9b25SBarry Smith /*MC
30830de9b25SBarry Smith   PETSC_VIEWER_SOCKET_WORLD  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
30930de9b25SBarry Smith 
31030de9b25SBarry Smith   Level: intermediate
31130de9b25SBarry Smith M*/
312b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
31330de9b25SBarry Smith 
31430de9b25SBarry Smith /*MC
31530de9b25SBarry Smith   PETSC_VIEWER_SOCKET_SELF  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
31630de9b25SBarry Smith 
31730de9b25SBarry Smith   Level: intermediate
31830de9b25SBarry Smith M*/
319b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_SELF  PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
32030de9b25SBarry Smith 
32130de9b25SBarry Smith /*MC
32230de9b25SBarry Smith   PETSC_VIEWER_BINARY_WORLD  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
32330de9b25SBarry Smith 
32430de9b25SBarry Smith   Level: intermediate
32530de9b25SBarry Smith M*/
326b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
32730de9b25SBarry Smith 
32830de9b25SBarry Smith /*MC
32930de9b25SBarry Smith   PETSC_VIEWER_BINARY_SELF  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
33030de9b25SBarry Smith 
33130de9b25SBarry Smith   Level: intermediate
33230de9b25SBarry Smith M*/
333b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_SELF  PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
33430de9b25SBarry Smith 
335cbb32127SBarry Smith /*MC
336cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_WORLD  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
337cbb32127SBarry Smith 
338cbb32127SBarry Smith   Level: intermediate
339cbb32127SBarry Smith M*/
340cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
341cbb32127SBarry Smith 
342cbb32127SBarry Smith /*MC
343cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_SELF  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
344cbb32127SBarry Smith 
345cbb32127SBarry Smith   Level: intermediate
346cbb32127SBarry Smith M*/
347cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_SELF  PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
348cbb32127SBarry Smith 
3497eb62a3eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(),PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE)
35065ef3172SBarry Smith 
3514a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStart(PetscViewer,PetscInt*,PetscInt*);
3524a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepMaster(PetscViewer,PetscInt,PetscInt*,PetscInt);
3534a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndMaster(PetscViewer,PetscInt*);
3544a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepWorker(PetscViewer,PetscMPIInt,PetscInt*);
3554a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndWorker(PetscViewer,PetscInt*);
356e03d165dSBarry Smith 
35777ed5343SBarry Smith /*
358a5057860SBarry Smith    PetscViewer writes to MATLAB .mat file
359cbb32127SBarry Smith */
360014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutArray(PetscViewer,int,int,const PetscScalar*,const char*);
361014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabGetArray(PetscViewer,int,int,PetscScalar*,const char*);
362014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutVariable(PetscViewer,const char*,void*);
363cbb32127SBarry Smith 
364e04113cfSBarry Smith #if defined(PETSC_HAVE_SAWS)
365e04113cfSBarry Smith PETSC_EXTERN PetscErrorCode PetscObjectViewSAWs(PetscObject,PetscViewer);
366bfb97211SBarry Smith #endif
367bfb97211SBarry Smith 
368b9617806SBarry Smith /*S
3691890ba74SBarry Smith      PetscViewers - Abstract collection of PetscViewers. It is just an expandable array of viewers.
370b9617806SBarry Smith 
371b9617806SBarry Smith    Level: intermediate
372b9617806SBarry Smith 
373b9617806SBarry Smith   Concepts: viewing
374b9617806SBarry Smith 
375b9617806SBarry Smith .seealso:  PetscViewerCreate(), PetscViewerSetType(), PetscViewerType, PetscViewer, PetscViewersCreate(),
376b9617806SBarry Smith            PetscViewersGetViewer()
377b9617806SBarry Smith S*/
37895fbd943SSatish Balay typedef struct _n_PetscViewers* PetscViewers;
379014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersCreate(MPI_Comm,PetscViewers*);
380014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersDestroy(PetscViewers*);
381014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersGetViewer(PetscViewers,PetscInt,PetscViewer*);
382d132466eSBarry Smith 
383cb5b572fSBarry Smith #endif
384