xref: /petsc/include/petscviewer.h (revision 84cb2905a512499b542fd30cf471a05f503d96d2)
1*84cb2905SBarry Smith /* $Id: viewer.h,v 1.39 1997/01/22 18:46:23 bsmith Exp bsmith $ */
2*84cb2905SBarry Smith /*
3*84cb2905SBarry Smith      Viewers are objects where other objects can be looked at or stored.
4*84cb2905SBarry Smith */
52eb8c8abSBarry Smith #if !defined(__VIEWER_PACKAGE)
62eb8c8abSBarry Smith #define __VIEWER_PACKAGE
72eb8c8abSBarry Smith 
82eb8c8abSBarry Smith #include "petsc.h"
92eb8c8abSBarry Smith 
102eb8c8abSBarry Smith typedef struct _Viewer*            Viewer;
112eb8c8abSBarry Smith #define VIEWER_COOKIE              PETSC_COOKIE+1
12bcd2baecSBarry Smith typedef enum { MATLAB_VIEWER,ASCII_FILE_VIEWER, ASCII_FILES_VIEWER,
13bcd2baecSBarry Smith                BINARY_FILE_VIEWER, STRING_VIEWER, DRAW_VIEWER} ViewerType;
142eb8c8abSBarry Smith 
15dbb450caSBarry Smith extern int ViewerFileOpenASCII(MPI_Comm,char*,Viewer *);
164b0e389bSBarry Smith typedef enum { BINARY_RDONLY, BINARY_WRONLY, BINARY_CREATE} ViewerBinaryType;
1721b0d8fbSLois Curfman McInnes extern int ViewerFileOpenBinary(MPI_Comm,char*,ViewerBinaryType,Viewer *);
18d7e8b826SBarry Smith extern int ViewerMatlabOpen(MPI_Comm,char*,int,Viewer *);
19bcd2baecSBarry Smith extern int ViewerStringOpen(MPI_Comm,char *,int, Viewer *);
20bcd2baecSBarry Smith extern int ViewerDrawOpenX(MPI_Comm,char *,char *,int,int,int,int,Viewer*);
21a2ce50c7SBarry Smith extern int ViewerDrawOpenVRML(MPI_Comm,char *,char *,Viewer*);
224b0e389bSBarry Smith 
23bcd2baecSBarry Smith extern int ViewerGetType(Viewer,ViewerType*);
249651b370SBarry Smith extern int ViewerDestroy(Viewer);
25ae39576cSLois Curfman McInnes 
2690ace30eSBarry Smith extern int ViewerASCIIGetPointer(Viewer,FILE**);
2790ace30eSBarry Smith extern int ViewerBinaryGetDescriptor(Viewer,int*);
28496e697eSBarry Smith extern int ViewerBinaryGetInfoPointer(Viewer,FILE **);
2990ace30eSBarry Smith 
30639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_DEFAULT       0
31639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_MATLAB        1
32639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_IMPL          2
33639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_INFO          3
34639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_INFO_LONG     4
35639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_COMMON        5
36639f9d9dSBarry Smith #define VIEWER_FORMAT_BINARY_DEFAULT      0
37639f9d9dSBarry Smith #define VIEWER_FORMAT_BINARY_NATIVE       1
385311e20fSBarry Smith #define VIEWER_FORMAT_DRAW_BASIC          0
395311e20fSBarry Smith #define VIEWER_FORMAT_DRAW_LG             1
400513a670SBarry Smith #define VIEWER_FORMAT_DRAW_CONTOUR        2
415311e20fSBarry Smith 
4290ace30eSBarry Smith extern int    ViewerSetFormat(Viewer,int,char *);
435311e20fSBarry Smith extern int    ViewerPushFormat(Viewer,int,char *);
445311e20fSBarry Smith extern int    ViewerPopFormat(Viewer);
4590ace30eSBarry Smith extern int    ViewerGetFormat(Viewer,int*);
4690ace30eSBarry Smith 
475fe861cdSBarry Smith extern int    ViewerFlush(Viewer);
4877c4ece6SBarry Smith extern int    ViewerStringSPrintf(Viewer,char *,...);
494b0e389bSBarry Smith 
506d4a8577SBarry Smith extern Viewer VIEWER_STDOUT_SELF;
516d4a8577SBarry Smith extern Viewer VIEWER_STDERR_SELF;
5225482d47SBarry Smith extern Viewer VIEWER_STDOUT_WORLD;
53639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_0;
54639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_1;
55639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_2;
565311e20fSBarry Smith extern Viewer VIEWER_DRAWX_SELF_PRIVATE;
57c16cb8f2SBarry Smith extern Viewer VIEWER_MATLAB_WORLD_PRIVATE;
58c16cb8f2SBarry Smith extern Viewer VIEWER_MATLAB_SELF_PRIVATE;  /* not yet used */
595311e20fSBarry Smith 
60639f9d9dSBarry Smith extern int    ViewerInitializeDrawXWorld_Private_0();
61639f9d9dSBarry Smith extern int    ViewerInitializeDrawXWorld_Private_1();
62639f9d9dSBarry Smith extern int    ViewerInitializeDrawXWorld_Private_2();
635311e20fSBarry Smith extern int    ViewerInitializeDrawXSelf_Private();
6458562591SBarry Smith extern int    ViewerInitializeMatlabWorld_Private();
6558562591SBarry Smith extern Viewer VIEWER_DRAWX_(MPI_Comm);
665311e20fSBarry Smith 
67639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_0 \
68639f9d9dSBarry Smith               (ViewerInitializeDrawXWorld_Private_0(),VIEWER_DRAWX_WORLD_PRIVATE_0)
69639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_1 \
70639f9d9dSBarry Smith               (ViewerInitializeDrawXWorld_Private_1(),VIEWER_DRAWX_WORLD_PRIVATE_1)
71639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_2 \
72639f9d9dSBarry Smith               (ViewerInitializeDrawXWorld_Private_2(),VIEWER_DRAWX_WORLD_PRIVATE_2)
73639f9d9dSBarry Smith 
745311e20fSBarry Smith #define VIEWER_DRAWX_SELF \
755311e20fSBarry Smith               (ViewerInitializeDrawXSelf_Private(),VIEWER_DRAWX_SELF_PRIVATE)
76639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD VIEWER_DRAWX_WORLD_0
77c16cb8f2SBarry Smith #define VIEWER_MATLAB_WORLD \
78c16cb8f2SBarry Smith         (ViewerInitializeMatlabWorld_Private(),VIEWER_MATLAB_WORLD_PRIVATE)
79c16cb8f2SBarry Smith 
802eb8c8abSBarry Smith #endif
81