xref: /petsc/include/petscviewer.h (revision ae8c01a2a6dfa7a7f169e75fc2e465218ca69b6d)
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
7e9fa29b7SSatish Balay #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus)
8e9fa29b7SSatish Balay extern "C" {
9e9fa29b7SSatish Balay #endif
102eb8c8abSBarry Smith 
118ba1e511SMatthew Knepley extern int PETSC_VIEWER_COOKIE;
128ba1e511SMatthew Knepley 
13b9617806SBarry Smith /*S
14b9617806SBarry Smith      PetscViewer - Abstract PETSc object that helps view (in ASCII, binary, graphically etc)
15b9617806SBarry Smith          other PETSc objects
16b9617806SBarry Smith 
17b9617806SBarry Smith    Level: beginner
18b9617806SBarry Smith 
19b9617806SBarry Smith   Concepts: viewing
20b9617806SBarry Smith 
21b9617806SBarry Smith .seealso:  PetscViewerCreate(), PetscViewerSetType(), PetscViewerType
22b9617806SBarry Smith S*/
23b0a32e0cSBarry Smith typedef struct _p_PetscViewer* PetscViewer;
243c119ea2SBarry Smith 
25e9fa29b7SSatish Balay #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus)
26e9fa29b7SSatish Balay }
27e9fa29b7SSatish Balay #endif
28e9fa29b7SSatish Balay 
29e9fa29b7SSatish Balay 
303c119ea2SBarry Smith /*
31b0a32e0cSBarry Smith     petsc.h must be included AFTER the definition of PetscViewer for ADIC to
323c119ea2SBarry Smith    process correctly.
333c119ea2SBarry Smith */
342eb8c8abSBarry Smith #include "petsc.h"
35e9fa29b7SSatish Balay PETSC_EXTERN_CXX_BEGIN
36b9617806SBarry Smith /*E
37b9617806SBarry Smith     PetscViewerType - String with the name of a PETSc PETScViewer
38b9617806SBarry Smith 
39b9617806SBarry Smith    Level: beginner
40b9617806SBarry Smith 
41b9617806SBarry Smith .seealso: PetscViewerSetType(), PetscViewer
42b9617806SBarry Smith E*/
4349773a63SBarry Smith #define PetscViewerType char*
44b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET       "socket"
45b0a32e0cSBarry Smith #define PETSC_VIEWER_ASCII        "ascii"
46fb9695e5SSatish Balay #define PETSC_VIEWER_BINARY       "binary"
47b0a32e0cSBarry Smith #define PETSC_VIEWER_STRING       "string"
48fb9695e5SSatish Balay #define PETSC_VIEWER_DRAW         "draw"
49b0a32e0cSBarry Smith #define PETSC_VIEWER_AMS          "ams"
5044c73c46SMatthew Knepley #define PETSC_VIEWER_VU           "vu"
514ebda54eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA  "mathematica"
524ebda54eSMatthew Knepley #define PETSC_VIEWER_SILO         "silo"
53e3eb5169SDinesh Kaushik #define PETSC_VIEWER_NETCDF       "netcdf"
5400ccbe27SDinesh Kaushik #define PETSC_VIEWER_HDF4         "hdf4"
55cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB       "matlab"
5677ed5343SBarry Smith 
57b0a32e0cSBarry Smith extern PetscFList PetscViewerList;
580e33f6ddSBarry Smith EXTERN int PetscViewerRegisterAll(const char *);
59b0a32e0cSBarry Smith EXTERN int PetscViewerRegisterDestroy(void);
607b2a1423SBarry Smith 
610e33f6ddSBarry Smith EXTERN int PetscViewerRegister(const char*,const char*,const char*,int(*)(PetscViewer));
6230de9b25SBarry Smith 
6330de9b25SBarry Smith /*MC
6430de9b25SBarry Smith    PetscViewerRegisterDynamic - Adds a method to the Krylov subspace solver package.
6530de9b25SBarry Smith 
6630de9b25SBarry Smith    Synopsis:
6730de9b25SBarry Smith    int PetscViewerRegisterDynamic(char *name_solver,char *path,char *name_create,int (*routine_create)(PetscViewer))
6830de9b25SBarry Smith 
6930de9b25SBarry Smith    Not Collective
7030de9b25SBarry Smith 
7130de9b25SBarry Smith    Input Parameters:
7230de9b25SBarry Smith +  name_solver - name of a new user-defined solver
7330de9b25SBarry Smith .  path - path (either absolute or relative) the library containing this solver
7430de9b25SBarry Smith .  name_create - name of routine to create method context
7530de9b25SBarry Smith -  routine_create - routine to create method context
7630de9b25SBarry Smith 
7730de9b25SBarry Smith    Level: developer
7830de9b25SBarry Smith 
7930de9b25SBarry Smith    Notes:
8030de9b25SBarry Smith    PetscViewerRegisterDynamic() may be called multiple times to add several user-defined solvers.
8130de9b25SBarry Smith 
8230de9b25SBarry Smith    If dynamic libraries are used, then the fourth input argument (routine_create)
8330de9b25SBarry Smith    is ignored.
8430de9b25SBarry Smith 
8530de9b25SBarry Smith    Sample usage:
8630de9b25SBarry Smith .vb
8730de9b25SBarry Smith    PetscViewerRegisterDynamic("my_viewer_type",/home/username/my_lib/lib/libO/solaris/mylib.a,
8830de9b25SBarry Smith                "MyViewerCreate",MyViewerCreate);
8930de9b25SBarry Smith .ve
9030de9b25SBarry Smith 
9130de9b25SBarry Smith    Then, your solver can be chosen with the procedural interface via
9230de9b25SBarry Smith $     PetscViewerSetType(ksp,"my_viewer_type")
9330de9b25SBarry Smith    or at runtime via the option
9430de9b25SBarry Smith $     -viewer_type my_viewer_type
9530de9b25SBarry Smith 
9630de9b25SBarry Smith   Concepts: registering^Viewers
9730de9b25SBarry Smith 
9830de9b25SBarry Smith .seealso: PetscViewerRegisterAll(), PetscViewerRegisterDestroy()
9930de9b25SBarry Smith M*/
100aa482453SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
101b0a32e0cSBarry Smith #define PetscViewerRegisterDynamic(a,b,c,d) PetscViewerRegister(a,b,c,0)
1027b2a1423SBarry Smith #else
103b0a32e0cSBarry Smith #define PetscViewerRegisterDynamic(a,b,c,d) PetscViewerRegister(a,b,c,d)
1047b2a1423SBarry Smith #endif
10530de9b25SBarry Smith 
106b0a32e0cSBarry Smith EXTERN int PetscViewerCreate(MPI_Comm,PetscViewer*);
107b0a32e0cSBarry Smith EXTERN int PetscViewerSetFromOptions(PetscViewer);
1087b2a1423SBarry Smith 
109b0a32e0cSBarry Smith EXTERN int PetscViewerASCIIOpen(MPI_Comm,const char[],PetscViewer*);
110*ae8c01a2SBarry Smith 
111*ae8c01a2SBarry Smith /*E
112*ae8c01a2SBarry Smith   PetscViewerFileType - Indicates how the file should be opened for the viewer
113*ae8c01a2SBarry Smith 
114*ae8c01a2SBarry Smith   Level: beginner
115*ae8c01a2SBarry Smith 
116*ae8c01a2SBarry Smith .seealso: PetscViewerSetFileName(), PetscViewerSetFileType(), PetscViewerBinaryOpen(), PetscViewerASCIIOpen(),
117*ae8c01a2SBarry Smith           PetscViewerMatlabOpen()
118*ae8c01a2SBarry Smith E*/
11945f7d322SBarry Smith typedef enum {PETSC_FILE_RDONLY,PETSC_FILE_WRONLY,PETSC_FILE_CREATE} PetscViewerFileType;
120*ae8c01a2SBarry Smith 
121*ae8c01a2SBarry Smith /*M
122*ae8c01a2SBarry Smith     PETSC_FILE_RDONLY - File is open to be read from only, not written to
123*ae8c01a2SBarry Smith 
124*ae8c01a2SBarry Smith     Level: beginner
125*ae8c01a2SBarry Smith 
126*ae8c01a2SBarry Smith .seealso: PetscViewerFileType, PETSC_FILE_WRONLY, PETSC_FILE_CREATE, PetscViewerSetFileName(), PetscViewerSetFileType(),
127*ae8c01a2SBarry Smith           PetscViewerBinaryOpen(), PetscViewerASCIIOpen(), PetscViewerMatlabOpen()
128*ae8c01a2SBarry Smith 
129*ae8c01a2SBarry Smith M*/
130*ae8c01a2SBarry Smith 
131*ae8c01a2SBarry Smith /*M
132*ae8c01a2SBarry Smith     PETSC_FILE_WRONLY - File is open to be appended to.
133*ae8c01a2SBarry Smith 
134*ae8c01a2SBarry Smith     Level: beginner
135*ae8c01a2SBarry Smith 
136*ae8c01a2SBarry Smith .seealso: PetscViewerFileType, PETSC_FILE_RDONLY, PETSC_FILE_CREATE, PetscViewerSetFileName(), PetscViewerSetFileType(),
137*ae8c01a2SBarry Smith           PetscViewerBinaryOpen(), PetscViewerASCIIOpen(), PetscViewerMatlabOpen()
138*ae8c01a2SBarry Smith 
139*ae8c01a2SBarry Smith M*/
140*ae8c01a2SBarry Smith 
141*ae8c01a2SBarry Smith /*M
142*ae8c01a2SBarry Smith     PETSC_FILE_CREATE - Create the file, or delete it and open an empty file if it already existed
143*ae8c01a2SBarry Smith 
144*ae8c01a2SBarry Smith     Level: beginner
145*ae8c01a2SBarry Smith 
146*ae8c01a2SBarry Smith .seealso: PetscViewerFileType, PETSC_FILE_RDONLY, PETSC_FILE_WRONLY, PetscViewerSetFileName(), PetscViewerSetFileType(),
147*ae8c01a2SBarry Smith           PetscViewerBinaryOpen(), PetscViewerASCIIOpen(), PetscViewerMatlabOpen()
148*ae8c01a2SBarry Smith 
149*ae8c01a2SBarry Smith M*/
150*ae8c01a2SBarry Smith 
15145f7d322SBarry Smith EXTERN int PetscViewerBinaryOpen(MPI_Comm,const char[],PetscViewerFileType,PetscViewer*);
152b0a32e0cSBarry Smith EXTERN int PetscViewerSocketOpen(MPI_Comm,const char[],int,PetscViewer*);
153b0a32e0cSBarry Smith EXTERN int PetscViewerStringOpen(MPI_Comm,char[],int,PetscViewer*);
154b0a32e0cSBarry Smith EXTERN int PetscViewerDrawOpen(MPI_Comm,const char[],const char[],int,int,int,int,PetscViewer*);
155b0a32e0cSBarry Smith EXTERN int PetscViewerAMSSetCommName(PetscViewer,const char[]);
1564ebda54eSMatthew Knepley EXTERN int PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *);
1574ebda54eSMatthew Knepley EXTERN int PetscViewerSiloOpen(MPI_Comm, const char[], PetscViewer *);
15845f7d322SBarry Smith EXTERN int PetscViewerMatlabOpen(MPI_Comm,const char[],PetscViewerFileType,PetscViewer*);
1594b0e389bSBarry Smith 
160b0a32e0cSBarry Smith EXTERN int PetscViewerGetType(PetscViewer,PetscViewerType*);
1610e33f6ddSBarry Smith EXTERN int PetscViewerSetType(PetscViewer,const PetscViewerType);
162b0a32e0cSBarry Smith EXTERN int PetscViewerDestroy(PetscViewer);
163b0a32e0cSBarry Smith EXTERN int PetscViewerGetSingleton(PetscViewer,PetscViewer*);
164b0a32e0cSBarry Smith EXTERN int PetscViewerRestoreSingleton(PetscViewer,PetscViewer*);
165ae39576cSLois Curfman McInnes 
166090de74eSSatish Balay 
167b9617806SBarry Smith /*E
168b9617806SBarry Smith     PetscViewerFormat - Way a viewer presents the object
169b9617806SBarry Smith 
170b9617806SBarry Smith    Level: beginner
171b9617806SBarry Smith 
172b9617806SBarry Smith .seealso: PetscViewerSetFormat(), PetscViewer, PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat()
173b9617806SBarry Smith E*/
174fb9695e5SSatish Balay typedef enum {
175f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_DEFAULT,
176f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_MATLAB,
1774ebda54eSMatthew Knepley   PETSC_VIEWER_ASCII_MATHEMATICA,
178f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_IMPL,
179f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INFO,
180456192e2SBarry Smith   PETSC_VIEWER_ASCII_INFO_DETAIL,
181f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_COMMON,
182f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_SYMMODU,
183f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INDEX,
184f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_DENSE,
185f3ef73ceSBarry Smith   PETSC_VIEWER_BINARY_DEFAULT,
186f3ef73ceSBarry Smith   PETSC_VIEWER_BINARY_NATIVE,
187f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_BASIC,
188f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_LG,
189f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_CONTOUR,
190f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_PORTS,
191f3ef73ceSBarry Smith   PETSC_VIEWER_NATIVE,
1924aedb280SBarry Smith   PETSC_VIEWER_NOFORMAT,
1934aedb280SBarry Smith   PETSC_VIEWER_ASCII_FACTOR_INFO} PetscViewerFormat;
194090de74eSSatish Balay 
195f3ef73ceSBarry Smith EXTERN int PetscViewerSetFormat(PetscViewer,PetscViewerFormat);
196f3ef73ceSBarry Smith EXTERN int PetscViewerPushFormat(PetscViewer,PetscViewerFormat);
197b0a32e0cSBarry Smith EXTERN int PetscViewerPopFormat(PetscViewer);
198f3ef73ceSBarry Smith EXTERN int PetscViewerGetFormat(PetscViewer,PetscViewerFormat*);
199b0a32e0cSBarry Smith EXTERN int PetscViewerFlush(PetscViewer);
2004b0e389bSBarry Smith 
20177ed5343SBarry Smith /*
20277ed5343SBarry Smith    Operations explicit to a particular class of viewers
20377ed5343SBarry Smith */
204ed5c6e3eSMatthew Knepley 
205ed5c6e3eSMatthew Knepley /*E
206ed5c6e3eSMatthew Knepley   PetscViewerFormat - Access mode for a file.
207ed5c6e3eSMatthew Knepley 
208ed5c6e3eSMatthew Knepley   Level: beginner
209ed5c6e3eSMatthew Knepley 
210ed5c6e3eSMatthew Knepley .seealso: PetscViewerASCIISetMode()
211ed5c6e3eSMatthew Knepley E*/
212ed5c6e3eSMatthew Knepley typedef enum {FILE_MODE_READ, FILE_MODE_WRITE, FILE_MODE_APPEND, FILE_MODE_UPDATE, FILE_MODE_APPEND_UPDATE} PetscFileMode;
213ed5c6e3eSMatthew Knepley 
214b0a32e0cSBarry Smith EXTERN int PetscViewerASCIIGetPointer(PetscViewer,FILE**);
215ed5c6e3eSMatthew Knepley EXTERN int PetscViewerASCIISetMode(PetscViewer,PetscFileMode);
216f80b7eb0SBarry Smith EXTERN int PetscViewerASCIIPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3);
217f80b7eb0SBarry Smith EXTERN int PetscViewerASCIISynchronizedPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3);
218b0a32e0cSBarry Smith EXTERN int PetscViewerASCIIPushTab(PetscViewer);
219b0a32e0cSBarry Smith EXTERN int PetscViewerASCIIPopTab(PetscViewer);
220b0a32e0cSBarry Smith EXTERN int PetscViewerASCIIUseTabs(PetscViewer,PetscTruth);
221b0a32e0cSBarry Smith EXTERN int PetscViewerASCIISetTab(PetscViewer,int);
222b0a32e0cSBarry Smith EXTERN int PetscViewerBinaryGetDescriptor(PetscViewer,int*);
223b0a32e0cSBarry Smith EXTERN int PetscViewerBinaryGetInfoPointer(PetscViewer,FILE **);
22445f7d322SBarry Smith EXTERN int PetscViewerSetFileType(PetscViewer,PetscViewerFileType);
2252fc52814SBarry Smith EXTERN int PetscViewerStringSPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3);
226b0a32e0cSBarry Smith EXTERN int PetscViewerStringSetString(PetscViewer,char[],int);
227b0a32e0cSBarry Smith EXTERN int PetscViewerDrawClear(PetscViewer);
228b0a32e0cSBarry Smith EXTERN int PetscViewerDrawSetInfo(PetscViewer,const char[],const char[],int,int,int,int);
229b0a32e0cSBarry Smith EXTERN int PetscViewerSocketSetConnection(PetscViewer,const char[],int);
230bba1ac68SSatish Balay EXTERN int PetscViewerBinarySkipInfo(PetscViewer);
23108641331SSatish Balay EXTERN int PetscViewerBinaryLoadInfo(PetscViewer);
23208641331SSatish Balay 
233c655490fSBarry Smith 
234b0a32e0cSBarry Smith EXTERN int PetscViewerSetFilename(PetscViewer,const char[]);
235b0a32e0cSBarry Smith EXTERN int PetscViewerGetFilename(PetscViewer,char**);
23677ed5343SBarry Smith 
23744c6da4fSMatthew Knepley EXTERN int PetscPLAPACKInitializePackage(char *);
23865804fbbSSatish Balay EXTERN int PetscPLAPACKFinalizePackage(void);
23944c6da4fSMatthew Knepley 
24055dcf840SMatthew Knepley EXTERN int PetscViewerVUGetPointer(PetscViewer, FILE**);
241c4b95c56SMatthew Knepley EXTERN int PetscViewerVUSetMode(PetscViewer, PetscFileMode);
242c4b95c56SMatthew Knepley EXTERN int PetscViewerVUSetVecSeen(PetscViewer, PetscTruth);
243c4b95c56SMatthew Knepley EXTERN int PetscViewerVUGetVecSeen(PetscViewer, PetscTruth *);
244f80b7eb0SBarry Smith EXTERN int PetscViewerVUPrintDeferred(PetscViewer, const char [], ...) PETSC_PRINTF_FORMAT_CHECK(2,3);
245c4b95c56SMatthew Knepley EXTERN int PetscViewerVUFlushDeferred(PetscViewer);
24655dcf840SMatthew Knepley 
24744c6da4fSMatthew Knepley EXTERN int PetscViewerMathematicaInitializePackage(char *);
24886e45947SSatish Balay EXTERN int PetscViewerMathematicaFinalizePackage(void);
249918c3ce8SMatthew Knepley EXTERN int PetscViewerMathematicaGetName(PetscViewer, const char **);
2507eb62a3eSMatthew Knepley EXTERN int PetscViewerMathematicaSetName(PetscViewer, const char []);
2517eb62a3eSMatthew Knepley EXTERN int PetscViewerMathematicaClearName(PetscViewer);
2527eb62a3eSMatthew Knepley EXTERN int PetscViewerMathematicaSkipPackets(PetscViewer, int);
2534ebda54eSMatthew Knepley 
2547eb62a3eSMatthew Knepley EXTERN int PetscViewerSiloGetName(PetscViewer, char **);
2557eb62a3eSMatthew Knepley EXTERN int PetscViewerSiloSetName(PetscViewer, const char []);
2567eb62a3eSMatthew Knepley EXTERN int PetscViewerSiloClearName(PetscViewer);
2577eb62a3eSMatthew Knepley EXTERN int PetscViewerSiloGetMeshName(PetscViewer, char **);
2587eb62a3eSMatthew Knepley EXTERN int PetscViewerSiloSetMeshName(PetscViewer, const char []);
2597eb62a3eSMatthew Knepley EXTERN int PetscViewerSiloClearMeshName(PetscViewer);
2604ebda54eSMatthew Knepley 
26145f7d322SBarry Smith EXTERN int PetscViewerNetcdfOpen(MPI_Comm,const char[],PetscViewerFileType,PetscViewer*);
262e3eb5169SDinesh Kaushik EXTERN int PetscViewerNetcdfGetID(PetscViewer, int *);
263e3eb5169SDinesh Kaushik 
26445f7d322SBarry Smith EXTERN int PetscViewerHDF4Open(MPI_Comm,const char[],PetscViewerFileType,PetscViewer*);
26500ccbe27SDinesh Kaushik EXTERN int PetscViewerHDF4WriteSDS(PetscViewer viewer, float *xf, int d, int *dims, int bs);
26600ccbe27SDinesh Kaushik 
26777ed5343SBarry Smith /*
26877ed5343SBarry Smith      These are all the default viewers that do not have
26977ed5343SBarry Smith    to be explicitly opened
27077ed5343SBarry Smith */
271b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_STDOUT_(MPI_Comm);
272b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_STDERR_(MPI_Comm);
273b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_DRAW_(MPI_Comm);
274b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_SOCKET_(MPI_Comm);
275b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_BINARY_(MPI_Comm);
276cbb32127SBarry Smith EXTERN PetscViewer PETSC_VIEWER_MATLAB_(MPI_Comm);
2777eb62a3eSMatthew Knepley EXTERN PetscViewer PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE;
2785311e20fSBarry Smith 
279b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_SELF  PETSC_VIEWER_STDERR_(PETSC_COMM_SELF)
280b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD)
28130de9b25SBarry Smith 
28230de9b25SBarry Smith /*MC
28330de9b25SBarry Smith   PETSC_VIEWER_STDOUT_WORLD  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
28430de9b25SBarry Smith 
28530de9b25SBarry Smith   Level: beginner
28630de9b25SBarry Smith M*/
28730de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
28830de9b25SBarry Smith 
28930de9b25SBarry Smith /*MC
29030de9b25SBarry Smith   PETSC_VIEWER_STDOUT_SELF  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
29130de9b25SBarry Smith 
29230de9b25SBarry Smith   Level: beginner
29330de9b25SBarry Smith M*/
29430de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_SELF  PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
29530de9b25SBarry Smith 
29630de9b25SBarry Smith /*MC
29730de9b25SBarry Smith   PETSC_VIEWER_DRAW_WORLD  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
29830de9b25SBarry Smith 
29930de9b25SBarry Smith   Level: intermediate
30030de9b25SBarry Smith M*/
301b0a32e0cSBarry Smith #define PETSC_VIEWER_DRAW_WORLD   PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
30230de9b25SBarry Smith 
30330de9b25SBarry Smith /*MC
30430de9b25SBarry Smith   PETSC_VIEWER_DRAW_SELF  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
30530de9b25SBarry Smith 
30630de9b25SBarry Smith   Level: intermediate
30730de9b25SBarry Smith M*/
30830de9b25SBarry Smith #define PETSC_VIEWER_DRAW_SELF    PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
30930de9b25SBarry Smith 
31030de9b25SBarry Smith /*MC
31130de9b25SBarry Smith   PETSC_VIEWER_SOCKET_WORLD  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
31230de9b25SBarry Smith 
31330de9b25SBarry Smith   Level: intermediate
31430de9b25SBarry Smith M*/
315b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
31630de9b25SBarry Smith 
31730de9b25SBarry Smith /*MC
31830de9b25SBarry Smith   PETSC_VIEWER_SOCKET_SELF  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
31930de9b25SBarry Smith 
32030de9b25SBarry Smith   Level: intermediate
32130de9b25SBarry Smith M*/
322b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_SELF  PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
32330de9b25SBarry Smith 
32430de9b25SBarry Smith /*MC
32530de9b25SBarry Smith   PETSC_VIEWER_BINARY_WORLD  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
32630de9b25SBarry Smith 
32730de9b25SBarry Smith   Level: intermediate
32830de9b25SBarry Smith M*/
329b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
33030de9b25SBarry Smith 
33130de9b25SBarry Smith /*MC
33230de9b25SBarry Smith   PETSC_VIEWER_BINARY_SELF  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
33330de9b25SBarry Smith 
33430de9b25SBarry Smith   Level: intermediate
33530de9b25SBarry Smith M*/
336b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_SELF  PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
33730de9b25SBarry Smith 
338cbb32127SBarry Smith /*MC
339cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_WORLD  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
340cbb32127SBarry Smith 
341cbb32127SBarry Smith   Level: intermediate
342cbb32127SBarry Smith M*/
343cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
344cbb32127SBarry Smith 
345cbb32127SBarry Smith /*MC
346cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_SELF  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
347cbb32127SBarry Smith 
348cbb32127SBarry Smith   Level: intermediate
349cbb32127SBarry Smith M*/
350cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_SELF  PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
351cbb32127SBarry Smith 
3527eb62a3eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(),PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE)
35365ef3172SBarry Smith 
35477ed5343SBarry Smith /*
355b0a32e0cSBarry Smith     PetscViewer based on the ALICE Memory Snooper
35677ed5343SBarry Smith */
357aa482453SBarry Smith #if defined(PETSC_HAVE_AMS)
358cb5b572fSBarry Smith #include "ams.h"
359b0a32e0cSBarry Smith EXTERN int         PetscViewerAMSGetAMSComm(PetscViewer,AMS_Comm *);
360b0a32e0cSBarry Smith EXTERN int         PetscViewerAMSOpen(MPI_Comm,const char[],PetscViewer*);
361b1607693SBarry Smith EXTERN int         PetscViewerAMSLock(PetscViewer);
362b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_AMS_(MPI_Comm);
363b0a32e0cSBarry Smith EXTERN int         PETSC_VIEWER_AMS_Destroy(MPI_Comm);
364b0a32e0cSBarry Smith #define PETSC_VIEWER_AMS_WORLD PETSC_VIEWER_AMS_(PETSC_COMM_WORLD)
3652eb8c8abSBarry Smith #endif
366cb5b572fSBarry Smith 
367f2b01315SBarry Smith /*
368cbb32127SBarry Smith    petscViewer writes to Matlab .mat file
369cbb32127SBarry Smith */
370cbb32127SBarry Smith EXTERN int PetscViewerMatlabPutArray(PetscViewer,int,int,PetscScalar*,char*);
371cbb32127SBarry Smith EXTERN int PetscViewerMatlabGetArray(PetscViewer,int,int,PetscScalar*,char*);
372cbb32127SBarry Smith EXTERN int PetscViewerMatlabPutVariable(PetscViewer,const char*,void*);
373cbb32127SBarry Smith 
374cbb32127SBarry Smith /*
375b0a32e0cSBarry Smith     PetscViewer utility routines used by PETSc that are not normally used
376f2b01315SBarry Smith    by users.
377f2b01315SBarry Smith */
37887828ca2SBarry Smith EXTERN int  PetscViewerSocketPutScalar(PetscViewer,int,int,PetscScalar*);
37987828ca2SBarry Smith EXTERN int  PetscViewerSocketPutReal(PetscViewer,int,int,PetscReal*);
380b0a32e0cSBarry Smith EXTERN int  PetscViewerSocketPutInt(PetscViewer,int,int*);
38187828ca2SBarry Smith EXTERN int  PetscViewerSocketPutSparse_Private(PetscViewer,int,int,int,PetscScalar*,int*,int *);
382b0a32e0cSBarry Smith EXTERN int  PetscViewerDestroyAMS_Private(void);
383f2b01315SBarry Smith 
384b9617806SBarry Smith /*S
385b9617806SBarry Smith      PetscViewers - Abstract collection of PetscViewers
386b9617806SBarry Smith 
387b9617806SBarry Smith    Level: intermediate
388b9617806SBarry Smith 
389b9617806SBarry Smith   Concepts: viewing
390b9617806SBarry Smith 
391b9617806SBarry Smith .seealso:  PetscViewerCreate(), PetscViewerSetType(), PetscViewerType, PetscViewer, PetscViewersCreate(),
392b9617806SBarry Smith            PetscViewersGetViewer()
393b9617806SBarry Smith S*/
394b0a32e0cSBarry Smith typedef struct _p_PetscViewers* PetscViewers;
395b0a32e0cSBarry Smith EXTERN int PetscViewersCreate(MPI_Comm,PetscViewers*);
396b0a32e0cSBarry Smith EXTERN int PetscViewersDestroy(PetscViewers);
397b0a32e0cSBarry Smith EXTERN int PetscViewersGetViewer(PetscViewers,int,PetscViewer*);
398d132466eSBarry Smith 
399e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END
400cb5b572fSBarry Smith #endif
401