xref: /petsc/include/petscviewer.h (revision 090de74e46273868ff6b9a694dc19bb997d61852)
1*090de74eSSatish Balay /* $Id: viewer.h,v 1.48 1997/10/28 14:26:00 bsmith Exp balay $ */
284cb2905SBarry Smith /*
384cb2905SBarry Smith      Viewers are objects where other objects can be looked at or stored.
484cb2905SBarry Smith */
53c119ea2SBarry Smith 
62eb8c8abSBarry Smith #if !defined(__VIEWER_PACKAGE)
72eb8c8abSBarry Smith #define __VIEWER_PACKAGE
82eb8c8abSBarry Smith 
9f09e8eb9SSatish Balay typedef struct _p_Viewer*            Viewer;
103c119ea2SBarry Smith 
113c119ea2SBarry Smith /*
123c119ea2SBarry Smith     petsc.h must be included AFTER the definition of Viewer for ADIC to
133c119ea2SBarry Smith    process correctly.
143c119ea2SBarry Smith */
152eb8c8abSBarry Smith #include "petsc.h"
162eb8c8abSBarry Smith 
172eb8c8abSBarry Smith #define VIEWER_COOKIE              PETSC_COOKIE+1
18bcd2baecSBarry Smith typedef enum { MATLAB_VIEWER,ASCII_FILE_VIEWER, ASCII_FILES_VIEWER,
19bcd2baecSBarry Smith                BINARY_FILE_VIEWER, STRING_VIEWER, DRAW_VIEWER} ViewerType;
202eb8c8abSBarry Smith 
21dbb450caSBarry Smith extern int ViewerFileOpenASCII(MPI_Comm,char*,Viewer *);
224b0e389bSBarry Smith typedef enum { BINARY_RDONLY, BINARY_WRONLY, BINARY_CREATE} ViewerBinaryType;
2321b0d8fbSLois Curfman McInnes extern int ViewerFileOpenBinary(MPI_Comm,char*,ViewerBinaryType,Viewer *);
24d7e8b826SBarry Smith extern int ViewerMatlabOpen(MPI_Comm,char*,int,Viewer *);
25bcd2baecSBarry Smith extern int ViewerStringOpen(MPI_Comm,char *,int, Viewer *);
26bcd2baecSBarry Smith extern int ViewerDrawOpenX(MPI_Comm,char *,char *,int,int,int,int,Viewer*);
27a2ce50c7SBarry Smith extern int ViewerDrawOpenVRML(MPI_Comm,char *,char *,Viewer*);
28d64ed03dSBarry Smith extern int ViewerDrawClear(Viewer);
294b0e389bSBarry Smith 
30bcd2baecSBarry Smith extern int ViewerGetType(Viewer,ViewerType*);
319651b370SBarry Smith extern int ViewerDestroy(Viewer);
32ae39576cSLois Curfman McInnes 
3390ace30eSBarry Smith extern int ViewerASCIIGetPointer(Viewer,FILE**);
3490ace30eSBarry Smith extern int ViewerBinaryGetDescriptor(Viewer,int*);
35496e697eSBarry Smith extern int ViewerBinaryGetInfoPointer(Viewer,FILE **);
3690ace30eSBarry Smith 
37639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_DEFAULT       0
38639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_MATLAB        1
39639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_IMPL          2
40639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_INFO          3
41639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_INFO_LONG     4
42639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_COMMON        5
4309b0ea9bSLois Curfman McInnes #define VIEWER_FORMAT_ASCII_SYMMODU       6
44*090de74eSSatish Balay 
45639f9d9dSBarry Smith #define VIEWER_FORMAT_BINARY_DEFAULT      0
46639f9d9dSBarry Smith #define VIEWER_FORMAT_BINARY_NATIVE       1
47*090de74eSSatish Balay 
485311e20fSBarry Smith #define VIEWER_FORMAT_DRAW_BASIC          0
495311e20fSBarry Smith #define VIEWER_FORMAT_DRAW_LG             1
500513a670SBarry Smith #define VIEWER_FORMAT_DRAW_CONTOUR        2
515311e20fSBarry Smith 
5290ace30eSBarry Smith extern int    ViewerSetFormat(Viewer,int,char *);
535311e20fSBarry Smith extern int    ViewerPushFormat(Viewer,int,char *);
545311e20fSBarry Smith extern int    ViewerPopFormat(Viewer);
5590ace30eSBarry Smith extern int    ViewerGetFormat(Viewer,int*);
5690ace30eSBarry Smith 
575fe861cdSBarry Smith extern int    ViewerFlush(Viewer);
5877c4ece6SBarry Smith extern int    ViewerStringSPrintf(Viewer,char *,...);
594b0e389bSBarry Smith 
606d4a8577SBarry Smith extern Viewer VIEWER_STDOUT_SELF;
616d4a8577SBarry Smith extern Viewer VIEWER_STDERR_SELF;
6225482d47SBarry Smith extern Viewer VIEWER_STDOUT_WORLD;
630752156aSBarry Smith extern Viewer VIEWER_STDOUT_(MPI_Comm);
640752156aSBarry Smith extern int    VIEWER_STDOUT_Destroy(MPI_Comm);
65c22c1629SBarry Smith extern Viewer VIEWER_STDERR_WORLD;
660752156aSBarry Smith extern Viewer VIEWER_STDERR_(MPI_Comm);
670752156aSBarry Smith extern int    VIEWER_STDERR_Destroy(MPI_Comm);
68639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_0;
69639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_1;
70639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_2;
715311e20fSBarry Smith extern Viewer VIEWER_DRAWX_SELF_PRIVATE;
72c16cb8f2SBarry Smith extern Viewer VIEWER_MATLAB_WORLD_PRIVATE;
73c16cb8f2SBarry Smith extern Viewer VIEWER_MATLAB_SELF_PRIVATE;  /* not yet used */
745311e20fSBarry Smith 
75639f9d9dSBarry Smith extern int    ViewerInitializeDrawXWorld_Private_0();
76639f9d9dSBarry Smith extern int    ViewerInitializeDrawXWorld_Private_1();
77639f9d9dSBarry Smith extern int    ViewerInitializeDrawXWorld_Private_2();
785311e20fSBarry Smith extern int    ViewerInitializeDrawXSelf_Private();
7958562591SBarry Smith extern int    ViewerInitializeMatlabWorld_Private();
8058562591SBarry Smith extern Viewer VIEWER_DRAWX_(MPI_Comm);
8156cd22aeSBarry Smith extern int    VIEWER_DRAWX_Destroy(MPI_Comm);
825311e20fSBarry Smith 
83639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_0 \
84639f9d9dSBarry Smith               (ViewerInitializeDrawXWorld_Private_0(),VIEWER_DRAWX_WORLD_PRIVATE_0)
85639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_1 \
86639f9d9dSBarry Smith               (ViewerInitializeDrawXWorld_Private_1(),VIEWER_DRAWX_WORLD_PRIVATE_1)
87639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_2 \
88639f9d9dSBarry Smith               (ViewerInitializeDrawXWorld_Private_2(),VIEWER_DRAWX_WORLD_PRIVATE_2)
89639f9d9dSBarry Smith 
905311e20fSBarry Smith #define VIEWER_DRAWX_SELF \
915311e20fSBarry Smith               (ViewerInitializeDrawXSelf_Private(),VIEWER_DRAWX_SELF_PRIVATE)
92639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD VIEWER_DRAWX_WORLD_0
93c16cb8f2SBarry Smith #define VIEWER_MATLAB_WORLD \
94c16cb8f2SBarry Smith         (ViewerInitializeMatlabWorld_Private(),VIEWER_MATLAB_WORLD_PRIVATE)
95c16cb8f2SBarry Smith 
962bdab257SBarry Smith extern int ViewersDrawOpenX(MPI_Comm,char *,char **,int,int,int,Viewer**);
972bdab257SBarry Smith extern int ViewersDestroy(int,Viewer *);
982bdab257SBarry Smith 
992eb8c8abSBarry Smith #endif
100