xref: /petsc/include/petscviewer.h (revision 3c119ea2fd8be34bc131657659a7d65d1eccc3b6)
1*3c119ea2SBarry Smith /* $Id: viewer.h,v 1.40 1997/02/03 06:03:27 bsmith Exp bsmith $ */
284cb2905SBarry Smith /*
384cb2905SBarry Smith      Viewers are objects where other objects can be looked at or stored.
484cb2905SBarry Smith */
5*3c119ea2SBarry Smith 
62eb8c8abSBarry Smith #if !defined(__VIEWER_PACKAGE)
72eb8c8abSBarry Smith #define __VIEWER_PACKAGE
82eb8c8abSBarry Smith 
9*3c119ea2SBarry Smith typedef struct _Viewer*            Viewer;
10*3c119ea2SBarry Smith 
11*3c119ea2SBarry Smith /*
12*3c119ea2SBarry Smith     petsc.h must be included AFTER the definition of Viewer for ADIC to
13*3c119ea2SBarry Smith    process correctly.
14*3c119ea2SBarry 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*);
284b0e389bSBarry Smith 
29bcd2baecSBarry Smith extern int ViewerGetType(Viewer,ViewerType*);
309651b370SBarry Smith extern int ViewerDestroy(Viewer);
31ae39576cSLois Curfman McInnes 
3290ace30eSBarry Smith extern int ViewerASCIIGetPointer(Viewer,FILE**);
3390ace30eSBarry Smith extern int ViewerBinaryGetDescriptor(Viewer,int*);
34496e697eSBarry Smith extern int ViewerBinaryGetInfoPointer(Viewer,FILE **);
3590ace30eSBarry Smith 
36639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_DEFAULT       0
37639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_MATLAB        1
38639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_IMPL          2
39639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_INFO          3
40639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_INFO_LONG     4
41639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_COMMON        5
42639f9d9dSBarry Smith #define VIEWER_FORMAT_BINARY_DEFAULT      0
43639f9d9dSBarry Smith #define VIEWER_FORMAT_BINARY_NATIVE       1
445311e20fSBarry Smith #define VIEWER_FORMAT_DRAW_BASIC          0
455311e20fSBarry Smith #define VIEWER_FORMAT_DRAW_LG             1
460513a670SBarry Smith #define VIEWER_FORMAT_DRAW_CONTOUR        2
475311e20fSBarry Smith 
4890ace30eSBarry Smith extern int    ViewerSetFormat(Viewer,int,char *);
495311e20fSBarry Smith extern int    ViewerPushFormat(Viewer,int,char *);
505311e20fSBarry Smith extern int    ViewerPopFormat(Viewer);
5190ace30eSBarry Smith extern int    ViewerGetFormat(Viewer,int*);
5290ace30eSBarry Smith 
535fe861cdSBarry Smith extern int    ViewerFlush(Viewer);
5477c4ece6SBarry Smith extern int    ViewerStringSPrintf(Viewer,char *,...);
554b0e389bSBarry Smith 
566d4a8577SBarry Smith extern Viewer VIEWER_STDOUT_SELF;
576d4a8577SBarry Smith extern Viewer VIEWER_STDERR_SELF;
5825482d47SBarry Smith extern Viewer VIEWER_STDOUT_WORLD;
59639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_0;
60639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_1;
61639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_2;
625311e20fSBarry Smith extern Viewer VIEWER_DRAWX_SELF_PRIVATE;
63c16cb8f2SBarry Smith extern Viewer VIEWER_MATLAB_WORLD_PRIVATE;
64c16cb8f2SBarry Smith extern Viewer VIEWER_MATLAB_SELF_PRIVATE;  /* not yet used */
655311e20fSBarry Smith 
66639f9d9dSBarry Smith extern int    ViewerInitializeDrawXWorld_Private_0();
67639f9d9dSBarry Smith extern int    ViewerInitializeDrawXWorld_Private_1();
68639f9d9dSBarry Smith extern int    ViewerInitializeDrawXWorld_Private_2();
695311e20fSBarry Smith extern int    ViewerInitializeDrawXSelf_Private();
7058562591SBarry Smith extern int    ViewerInitializeMatlabWorld_Private();
7158562591SBarry Smith extern Viewer VIEWER_DRAWX_(MPI_Comm);
725311e20fSBarry Smith 
73639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_0 \
74639f9d9dSBarry Smith               (ViewerInitializeDrawXWorld_Private_0(),VIEWER_DRAWX_WORLD_PRIVATE_0)
75639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_1 \
76639f9d9dSBarry Smith               (ViewerInitializeDrawXWorld_Private_1(),VIEWER_DRAWX_WORLD_PRIVATE_1)
77639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_2 \
78639f9d9dSBarry Smith               (ViewerInitializeDrawXWorld_Private_2(),VIEWER_DRAWX_WORLD_PRIVATE_2)
79639f9d9dSBarry Smith 
805311e20fSBarry Smith #define VIEWER_DRAWX_SELF \
815311e20fSBarry Smith               (ViewerInitializeDrawXSelf_Private(),VIEWER_DRAWX_SELF_PRIVATE)
82639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD VIEWER_DRAWX_WORLD_0
83c16cb8f2SBarry Smith #define VIEWER_MATLAB_WORLD \
84c16cb8f2SBarry Smith         (ViewerInitializeMatlabWorld_Private(),VIEWER_MATLAB_WORLD_PRIVATE)
85c16cb8f2SBarry Smith 
862eb8c8abSBarry Smith #endif
87