xref: /petsc/include/petscviewer.h (revision 77ed534321f0a860738694ee6d0aa216f0623125)
1*77ed5343SBarry Smith /* $Id: viewer.h,v 1.57 1998/11/20 15:31:26 bsmith Exp bsmith $ */
284cb2905SBarry Smith /*
384cb2905SBarry Smith      Viewers are objects where other objects can be looked at or stored.
484cb2905SBarry Smith */
53c119ea2SBarry Smith 
688d459dfSBarry Smith #if !defined(__VIEWER_H)
788d459dfSBarry Smith #define __VIEWER_H
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
18*77ed5343SBarry Smith typedef char* ViewerType;
192eb8c8abSBarry Smith 
20*77ed5343SBarry Smith #define MATLAB_VIEWER       "matlab"
21*77ed5343SBarry Smith #define ASCII_VIEWER        "ascii"
22*77ed5343SBarry Smith #define BINARY_VIEWER       "binary"
23*77ed5343SBarry Smith #define STRING_VIEWER       "string"
24*77ed5343SBarry Smith #define DRAW_VIEWER         "draw"
25*77ed5343SBarry Smith #define AMS_VIEWER          "ams"
26*77ed5343SBarry Smith 
27*77ed5343SBarry Smith extern int ViewerASCIIOpen(MPI_Comm,const char[],Viewer*);
284b0e389bSBarry Smith typedef enum {BINARY_RDONLY, BINARY_WRONLY, BINARY_CREATE} ViewerBinaryType;
29*77ed5343SBarry Smith extern int ViewerBinaryOpen(MPI_Comm,const char[],ViewerBinaryType,Viewer*);
30e26ad7d8SSatish Balay extern int ViewerMatlabOpen(MPI_Comm,const char[],int,Viewer*);
31e26ad7d8SSatish Balay extern int ViewerStringOpen(MPI_Comm,char[],int, Viewer*);
32*77ed5343SBarry Smith extern int ViewerDrawOpen(MPI_Comm,const char[],const char[],int,int,int,int,Viewer*);
33e26ad7d8SSatish Balay extern int ViewerDrawOpenVRML(MPI_Comm,const char[],const char[],Viewer*);
344b0e389bSBarry Smith 
35*77ed5343SBarry Smith extern int ViewerGetOutputname(Viewer,char**);
36bcd2baecSBarry Smith extern int ViewerGetType(Viewer,ViewerType*);
379651b370SBarry Smith extern int ViewerDestroy(Viewer);
38ae39576cSLois Curfman McInnes 
39639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_DEFAULT       0
40639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_MATLAB        1
41639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_IMPL          2
42639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_INFO          3
43639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_INFO_LONG     4
44639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_COMMON        5
4509b0ea9bSLois Curfman McInnes #define VIEWER_FORMAT_ASCII_SYMMODU       6
4647e7184fSBarry Smith #define VIEWER_FORMAT_ASCII_INDEX         7
47e24b481bSBarry Smith #define VIEWER_FORMAT_ASCII_DENSE         8
48090de74eSSatish Balay 
49639f9d9dSBarry Smith #define VIEWER_FORMAT_BINARY_DEFAULT      0
50639f9d9dSBarry Smith #define VIEWER_FORMAT_BINARY_NATIVE       1
51090de74eSSatish Balay 
525311e20fSBarry Smith #define VIEWER_FORMAT_DRAW_BASIC          0
535311e20fSBarry Smith #define VIEWER_FORMAT_DRAW_LG             1
540513a670SBarry Smith #define VIEWER_FORMAT_DRAW_CONTOUR        2
555311e20fSBarry Smith 
56e26ad7d8SSatish Balay extern int    ViewerSetFormat(Viewer,int,char[]);
57e26ad7d8SSatish Balay extern int    ViewerPushFormat(Viewer,int,char[]);
585311e20fSBarry Smith extern int    ViewerPopFormat(Viewer);
5990ace30eSBarry Smith extern int    ViewerGetFormat(Viewer,int*);
605fe861cdSBarry Smith extern int    ViewerFlush(Viewer);
614b0e389bSBarry Smith 
62*77ed5343SBarry Smith /*
63*77ed5343SBarry Smith    Operations explicit to a particular class of viewers
64*77ed5343SBarry Smith */
65*77ed5343SBarry Smith extern int ViewerASCIIGetPointer(Viewer,FILE**);
66*77ed5343SBarry Smith extern int ViewerBinaryGetDescriptor(Viewer,int*);
67*77ed5343SBarry Smith extern int ViewerBinaryGetInfoPointer(Viewer,FILE **);
68*77ed5343SBarry Smith extern int ViewerStringSPrintf(Viewer,char *,...);
69*77ed5343SBarry Smith extern int ViewerDrawClear(Viewer);
70*77ed5343SBarry Smith 
71*77ed5343SBarry Smith /*
72*77ed5343SBarry Smith      These are all the default viewers that do not have
73*77ed5343SBarry Smith    to be explicitly opened
74*77ed5343SBarry Smith */
756d4a8577SBarry Smith extern Viewer VIEWER_STDOUT_SELF;
766d4a8577SBarry Smith extern Viewer VIEWER_STDERR_SELF;
7725482d47SBarry Smith extern Viewer VIEWER_STDOUT_WORLD;
780752156aSBarry Smith extern Viewer VIEWER_STDOUT_(MPI_Comm);
790752156aSBarry Smith extern int    VIEWER_STDOUT_Destroy(MPI_Comm);
80c22c1629SBarry Smith extern Viewer VIEWER_STDERR_WORLD;
810752156aSBarry Smith extern Viewer VIEWER_STDERR_(MPI_Comm);
820752156aSBarry Smith extern int    VIEWER_STDERR_Destroy(MPI_Comm);
83639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_0;
84639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_1;
85639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_2;
865311e20fSBarry Smith extern Viewer VIEWER_DRAWX_SELF_PRIVATE;
87c16cb8f2SBarry Smith extern Viewer VIEWER_MATLAB_WORLD_PRIVATE;
88c16cb8f2SBarry Smith extern Viewer VIEWER_MATLAB_SELF_PRIVATE;  /* not yet used */
895311e20fSBarry Smith 
90cf256101SBarry Smith extern int    ViewerInitializeDrawXWorld_Private_0(void);
91cf256101SBarry Smith extern int    ViewerInitializeDrawXWorld_Private_1(void);
92cf256101SBarry Smith extern int    ViewerInitializeDrawXWorld_Private_2(void);
93cf256101SBarry Smith extern int    ViewerInitializeDrawXSelf_Private(void);
94cf256101SBarry Smith extern int    ViewerInitializeMatlabWorld_Private(void);
9558562591SBarry Smith extern Viewer VIEWER_DRAWX_(MPI_Comm);
9656cd22aeSBarry Smith extern int    VIEWER_DRAWX_Destroy(MPI_Comm);
975311e20fSBarry Smith 
98639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_0 \
99639f9d9dSBarry Smith               (ViewerInitializeDrawXWorld_Private_0(),VIEWER_DRAWX_WORLD_PRIVATE_0)
100639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_1 \
101639f9d9dSBarry Smith               (ViewerInitializeDrawXWorld_Private_1(),VIEWER_DRAWX_WORLD_PRIVATE_1)
102639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_2 \
103639f9d9dSBarry Smith               (ViewerInitializeDrawXWorld_Private_2(),VIEWER_DRAWX_WORLD_PRIVATE_2)
104639f9d9dSBarry Smith 
1055311e20fSBarry Smith #define VIEWER_DRAWX_SELF \
1065311e20fSBarry Smith               (ViewerInitializeDrawXSelf_Private(),VIEWER_DRAWX_SELF_PRIVATE)
107639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD VIEWER_DRAWX_WORLD_0
108e1311b90SBarry Smith 
109c16cb8f2SBarry Smith #define VIEWER_MATLAB_WORLD \
110c16cb8f2SBarry Smith         (ViewerInitializeMatlabWorld_Private(),VIEWER_MATLAB_WORLD_PRIVATE)
111c16cb8f2SBarry Smith 
112*77ed5343SBarry Smith /*
113*77ed5343SBarry Smith     Viewer based on the ALICE Memory Snooper
114*77ed5343SBarry Smith */
115cb5b572fSBarry Smith #if defined(HAVE_AMS)
116cb5b572fSBarry Smith #include "ams.h"
117cb5b572fSBarry Smith extern int    ViewerAMSGetAMSComm(Viewer,AMS_Comm *);
118cb5b572fSBarry Smith extern int    ViewerAMSOpen(MPI_Comm,const char[],Viewer*);
119cb5b572fSBarry Smith extern Viewer VIEWER_AMS_(MPI_Comm);
120cb5b572fSBarry Smith extern int    VIEWER_AMS_Destroy(MPI_Comm);
121cb5b572fSBarry Smith extern Viewer VIEWER_AMS_WORLD_PRIVATE;
122cb5b572fSBarry Smith extern int    ViewerInitializeAMSWorld_Private(void);
123cb5b572fSBarry Smith #define VIEWER_AMS_WORLD (ViewerInitializeAMSWorld_Private(),VIEWER_AMS_WORLD_PRIVATE)
1242eb8c8abSBarry Smith #endif
125cb5b572fSBarry Smith 
126cb5b572fSBarry Smith #endif
127cb5b572fSBarry Smith 
128