xref: /petsc/include/petscviewer.h (revision 6849ba73f22fecb8f92ef896a42e4e8bd4cd6965)
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
7dfbe8321SBarry Smith 
8e9fa29b7SSatish Balay #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus)
9e9fa29b7SSatish Balay extern "C" {
10e9fa29b7SSatish Balay #endif
112eb8c8abSBarry Smith 
12*6849ba73SBarry Smith extern PetscCookie PETSC_VIEWER_COOKIE;
138ba1e511SMatthew Knepley 
14b9617806SBarry Smith /*S
15b9617806SBarry Smith      PetscViewer - Abstract PETSc object that helps view (in ASCII, binary, graphically etc)
16b9617806SBarry Smith          other PETSc objects
17b9617806SBarry Smith 
18b9617806SBarry Smith    Level: beginner
19b9617806SBarry Smith 
20b9617806SBarry Smith   Concepts: viewing
21b9617806SBarry Smith 
22b9617806SBarry Smith .seealso:  PetscViewerCreate(), PetscViewerSetType(), PetscViewerType
23b9617806SBarry Smith S*/
24b0a32e0cSBarry Smith typedef struct _p_PetscViewer* PetscViewer;
253c119ea2SBarry Smith 
26e9fa29b7SSatish Balay #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus)
27e9fa29b7SSatish Balay }
28e9fa29b7SSatish Balay #endif
29e9fa29b7SSatish Balay 
30e9fa29b7SSatish Balay 
313c119ea2SBarry Smith /*
32b0a32e0cSBarry Smith     petsc.h must be included AFTER the definition of PetscViewer for ADIC to
333c119ea2SBarry Smith    process correctly.
343c119ea2SBarry Smith */
352eb8c8abSBarry Smith #include "petsc.h"
36e9fa29b7SSatish Balay PETSC_EXTERN_CXX_BEGIN
37b9617806SBarry Smith /*E
38b9617806SBarry Smith     PetscViewerType - String with the name of a PETSc PETScViewer
39b9617806SBarry Smith 
40b9617806SBarry Smith    Level: beginner
41b9617806SBarry Smith 
42b9617806SBarry Smith .seealso: PetscViewerSetType(), PetscViewer
43b9617806SBarry Smith E*/
4449773a63SBarry Smith #define PetscViewerType char*
45b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET       "socket"
46b0a32e0cSBarry Smith #define PETSC_VIEWER_ASCII        "ascii"
47fb9695e5SSatish Balay #define PETSC_VIEWER_BINARY       "binary"
48b0a32e0cSBarry Smith #define PETSC_VIEWER_STRING       "string"
49fb9695e5SSatish Balay #define PETSC_VIEWER_DRAW         "draw"
50b0a32e0cSBarry Smith #define PETSC_VIEWER_AMS          "ams"
5144c73c46SMatthew Knepley #define PETSC_VIEWER_VU           "vu"
524ebda54eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA  "mathematica"
534ebda54eSMatthew Knepley #define PETSC_VIEWER_SILO         "silo"
54e3eb5169SDinesh Kaushik #define PETSC_VIEWER_NETCDF       "netcdf"
5500ccbe27SDinesh Kaushik #define PETSC_VIEWER_HDF4         "hdf4"
56cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB       "matlab"
5777ed5343SBarry Smith 
58b0a32e0cSBarry Smith extern PetscFList PetscViewerList;
59dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerRegisterAll(const char *);
60dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerRegisterDestroy(void);
617b2a1423SBarry Smith 
62*6849ba73SBarry Smith EXTERN PetscErrorCode PetscViewerRegister(const char*,const char*,const char*,PetscErrorCode (*)(PetscViewer));
6330de9b25SBarry Smith 
6430de9b25SBarry Smith /*MC
6530de9b25SBarry Smith    PetscViewerRegisterDynamic - Adds a method to the Krylov subspace solver package.
6630de9b25SBarry Smith 
6730de9b25SBarry Smith    Synopsis:
68*6849ba73SBarry Smith    int PetscViewerRegisterDynamic(char *name_solver,char *path,char *name_create,PetscErrorCode (*routine_create)(PetscViewer))
6930de9b25SBarry Smith 
7030de9b25SBarry Smith    Not Collective
7130de9b25SBarry Smith 
7230de9b25SBarry Smith    Input Parameters:
7330de9b25SBarry Smith +  name_solver - name of a new user-defined solver
7430de9b25SBarry Smith .  path - path (either absolute or relative) the library containing this solver
7530de9b25SBarry Smith .  name_create - name of routine to create method context
7630de9b25SBarry Smith -  routine_create - routine to create method context
7730de9b25SBarry Smith 
7830de9b25SBarry Smith    Level: developer
7930de9b25SBarry Smith 
8030de9b25SBarry Smith    Notes:
8130de9b25SBarry Smith    PetscViewerRegisterDynamic() may be called multiple times to add several user-defined solvers.
8230de9b25SBarry Smith 
8330de9b25SBarry Smith    If dynamic libraries are used, then the fourth input argument (routine_create)
8430de9b25SBarry Smith    is ignored.
8530de9b25SBarry Smith 
8630de9b25SBarry Smith    Sample usage:
8730de9b25SBarry Smith .vb
8830de9b25SBarry Smith    PetscViewerRegisterDynamic("my_viewer_type",/home/username/my_lib/lib/libO/solaris/mylib.a,
8930de9b25SBarry Smith                "MyViewerCreate",MyViewerCreate);
9030de9b25SBarry Smith .ve
9130de9b25SBarry Smith 
9230de9b25SBarry Smith    Then, your solver can be chosen with the procedural interface via
9330de9b25SBarry Smith $     PetscViewerSetType(ksp,"my_viewer_type")
9430de9b25SBarry Smith    or at runtime via the option
9530de9b25SBarry Smith $     -viewer_type my_viewer_type
9630de9b25SBarry Smith 
9730de9b25SBarry Smith   Concepts: registering^Viewers
9830de9b25SBarry Smith 
9930de9b25SBarry Smith .seealso: PetscViewerRegisterAll(), PetscViewerRegisterDestroy()
10030de9b25SBarry Smith M*/
101aa482453SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
102b0a32e0cSBarry Smith #define PetscViewerRegisterDynamic(a,b,c,d) PetscViewerRegister(a,b,c,0)
1037b2a1423SBarry Smith #else
104b0a32e0cSBarry Smith #define PetscViewerRegisterDynamic(a,b,c,d) PetscViewerRegister(a,b,c,d)
1057b2a1423SBarry Smith #endif
10630de9b25SBarry Smith 
107dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerCreate(MPI_Comm,PetscViewer*);
108dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerSetFromOptions(PetscViewer);
1097b2a1423SBarry Smith 
110dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerASCIIOpen(MPI_Comm,const char[],PetscViewer*);
111ae8c01a2SBarry Smith 
112ae8c01a2SBarry Smith /*E
113ae8c01a2SBarry Smith   PetscViewerFileType - Indicates how the file should be opened for the viewer
114ae8c01a2SBarry Smith 
115ae8c01a2SBarry Smith   Level: beginner
116ae8c01a2SBarry Smith 
117ae8c01a2SBarry Smith .seealso: PetscViewerSetFileName(), PetscViewerSetFileType(), PetscViewerBinaryOpen(), PetscViewerASCIIOpen(),
118ae8c01a2SBarry Smith           PetscViewerMatlabOpen()
119ae8c01a2SBarry Smith E*/
12045f7d322SBarry Smith typedef enum {PETSC_FILE_RDONLY,PETSC_FILE_WRONLY,PETSC_FILE_CREATE} PetscViewerFileType;
121ae8c01a2SBarry Smith 
122ae8c01a2SBarry Smith /*M
123ae8c01a2SBarry Smith     PETSC_FILE_RDONLY - File is open to be read from only, not written to
124ae8c01a2SBarry Smith 
125ae8c01a2SBarry Smith     Level: beginner
126ae8c01a2SBarry Smith 
127ae8c01a2SBarry Smith .seealso: PetscViewerFileType, PETSC_FILE_WRONLY, PETSC_FILE_CREATE, PetscViewerSetFileName(), PetscViewerSetFileType(),
128ae8c01a2SBarry Smith           PetscViewerBinaryOpen(), PetscViewerASCIIOpen(), PetscViewerMatlabOpen()
129ae8c01a2SBarry Smith 
130ae8c01a2SBarry Smith M*/
131ae8c01a2SBarry Smith 
132ae8c01a2SBarry Smith /*M
133ae8c01a2SBarry Smith     PETSC_FILE_WRONLY - File is open to be appended to.
134ae8c01a2SBarry Smith 
135ae8c01a2SBarry Smith     Level: beginner
136ae8c01a2SBarry Smith 
137ae8c01a2SBarry Smith .seealso: PetscViewerFileType, PETSC_FILE_RDONLY, PETSC_FILE_CREATE, PetscViewerSetFileName(), PetscViewerSetFileType(),
138ae8c01a2SBarry Smith           PetscViewerBinaryOpen(), PetscViewerASCIIOpen(), PetscViewerMatlabOpen()
139ae8c01a2SBarry Smith 
140ae8c01a2SBarry Smith M*/
141ae8c01a2SBarry Smith 
142ae8c01a2SBarry Smith /*M
143ae8c01a2SBarry Smith     PETSC_FILE_CREATE - Create the file, or delete it and open an empty file if it already existed
144ae8c01a2SBarry Smith 
145ae8c01a2SBarry Smith     Level: beginner
146ae8c01a2SBarry Smith 
147ae8c01a2SBarry Smith .seealso: PetscViewerFileType, PETSC_FILE_RDONLY, PETSC_FILE_WRONLY, PetscViewerSetFileName(), PetscViewerSetFileType(),
148ae8c01a2SBarry Smith           PetscViewerBinaryOpen(), PetscViewerASCIIOpen(), PetscViewerMatlabOpen()
149ae8c01a2SBarry Smith 
150ae8c01a2SBarry Smith M*/
151ae8c01a2SBarry Smith 
152dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerBinaryOpen(MPI_Comm,const char[],PetscViewerFileType,PetscViewer*);
153dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerSocketOpen(MPI_Comm,const char[],int,PetscViewer*);
154dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerStringOpen(MPI_Comm,char[],int,PetscViewer*);
155dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerDrawOpen(MPI_Comm,const char[],const char[],int,int,int,int,PetscViewer*);
156dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerAMSSetCommName(PetscViewer,const char[]);
157dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *);
158dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerSiloOpen(MPI_Comm, const char[], PetscViewer *);
159dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerMatlabOpen(MPI_Comm,const char[],PetscViewerFileType,PetscViewer*);
1604b0e389bSBarry Smith 
161dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerGetType(PetscViewer,PetscViewerType*);
162dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerSetType(PetscViewer,const PetscViewerType);
163dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerDestroy(PetscViewer);
164dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerGetSingleton(PetscViewer,PetscViewer*);
165dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerRestoreSingleton(PetscViewer,PetscViewer*);
166ae39576cSLois Curfman McInnes 
167090de74eSSatish Balay 
168b9617806SBarry Smith /*E
169b9617806SBarry Smith     PetscViewerFormat - Way a viewer presents the object
170b9617806SBarry Smith 
171b9617806SBarry Smith    Level: beginner
172b9617806SBarry Smith 
173b9617806SBarry Smith .seealso: PetscViewerSetFormat(), PetscViewer, PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat()
174b9617806SBarry Smith E*/
175fb9695e5SSatish Balay typedef enum {
176f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_DEFAULT,
177f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_MATLAB,
1784ebda54eSMatthew Knepley   PETSC_VIEWER_ASCII_MATHEMATICA,
179f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_IMPL,
180f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INFO,
181456192e2SBarry Smith   PETSC_VIEWER_ASCII_INFO_DETAIL,
182f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_COMMON,
183f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_SYMMODU,
184f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INDEX,
185f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_DENSE,
186f3ef73ceSBarry Smith   PETSC_VIEWER_BINARY_DEFAULT,
187f3ef73ceSBarry Smith   PETSC_VIEWER_BINARY_NATIVE,
188f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_BASIC,
189f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_LG,
190f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_CONTOUR,
191f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_PORTS,
192f3ef73ceSBarry Smith   PETSC_VIEWER_NATIVE,
1934aedb280SBarry Smith   PETSC_VIEWER_NOFORMAT,
1944aedb280SBarry Smith   PETSC_VIEWER_ASCII_FACTOR_INFO} PetscViewerFormat;
195090de74eSSatish Balay 
196dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerSetFormat(PetscViewer,PetscViewerFormat);
197dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerPushFormat(PetscViewer,PetscViewerFormat);
198dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerPopFormat(PetscViewer);
199dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerGetFormat(PetscViewer,PetscViewerFormat*);
200dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerFlush(PetscViewer);
2014b0e389bSBarry Smith 
20277ed5343SBarry Smith /*
20377ed5343SBarry Smith    Operations explicit to a particular class of viewers
20477ed5343SBarry Smith */
205ed5c6e3eSMatthew Knepley 
206ed5c6e3eSMatthew Knepley /*E
207ed5c6e3eSMatthew Knepley   PetscViewerFormat - Access mode for a file.
208ed5c6e3eSMatthew Knepley 
209ed5c6e3eSMatthew Knepley   Level: beginner
210ed5c6e3eSMatthew Knepley 
211ed5c6e3eSMatthew Knepley .seealso: PetscViewerASCIISetMode()
212ed5c6e3eSMatthew Knepley E*/
213ed5c6e3eSMatthew Knepley typedef enum {FILE_MODE_READ, FILE_MODE_WRITE, FILE_MODE_APPEND, FILE_MODE_UPDATE, FILE_MODE_APPEND_UPDATE} PetscFileMode;
214ed5c6e3eSMatthew Knepley 
215dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerASCIIGetPointer(PetscViewer,FILE**);
216dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerASCIISetMode(PetscViewer,PetscFileMode);
217dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerASCIIPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3);
218dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerASCIISynchronizedPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3);
219dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerASCIIPushTab(PetscViewer);
220dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerASCIIPopTab(PetscViewer);
221dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerASCIIUseTabs(PetscViewer,PetscTruth);
222dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerASCIISetTab(PetscViewer,int);
223dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerBinaryGetDescriptor(PetscViewer,int*);
224dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerBinaryGetInfoPointer(PetscViewer,FILE **);
225dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerSetFileType(PetscViewer,PetscViewerFileType);
226dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerStringSPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3);
227dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerStringSetString(PetscViewer,char[],int);
228dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerDrawClear(PetscViewer);
229dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerDrawSetInfo(PetscViewer,const char[],const char[],int,int,int,int);
230dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerSocketSetConnection(PetscViewer,const char[],int);
231dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerBinarySkipInfo(PetscViewer);
232dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerBinaryLoadInfo(PetscViewer);
23308641331SSatish Balay 
234c655490fSBarry Smith 
235dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerSetFilename(PetscViewer,const char[]);
236dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerGetFilename(PetscViewer,char**);
23777ed5343SBarry Smith 
238dfbe8321SBarry Smith EXTERN PetscErrorCode PetscPLAPACKInitializePackage(char *);
239dfbe8321SBarry Smith EXTERN PetscErrorCode PetscPLAPACKFinalizePackage(void);
24044c6da4fSMatthew Knepley 
241dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerVUGetPointer(PetscViewer, FILE**);
242dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerVUSetMode(PetscViewer, PetscFileMode);
243dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerVUSetVecSeen(PetscViewer, PetscTruth);
244dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerVUGetVecSeen(PetscViewer, PetscTruth *);
245dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerVUPrintDeferred(PetscViewer, const char [], ...) PETSC_PRINTF_FORMAT_CHECK(2,3);
246dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerVUFlushDeferred(PetscViewer);
24755dcf840SMatthew Knepley 
248dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerMathematicaInitializePackage(char *);
249dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerMathematicaFinalizePackage(void);
250dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerMathematicaGetName(PetscViewer, const char **);
251dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerMathematicaSetName(PetscViewer, const char []);
252dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerMathematicaClearName(PetscViewer);
253dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerMathematicaSkipPackets(PetscViewer, int);
2544ebda54eSMatthew Knepley 
255dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerSiloGetName(PetscViewer, char **);
256dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerSiloSetName(PetscViewer, const char []);
257dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerSiloClearName(PetscViewer);
258dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerSiloGetMeshName(PetscViewer, char **);
259dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerSiloSetMeshName(PetscViewer, const char []);
260dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerSiloClearMeshName(PetscViewer);
2614ebda54eSMatthew Knepley 
262dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerNetcdfOpen(MPI_Comm,const char[],PetscViewerFileType,PetscViewer*);
263dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerNetcdfGetID(PetscViewer, int *);
264e3eb5169SDinesh Kaushik 
265dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerHDF4Open(MPI_Comm,const char[],PetscViewerFileType,PetscViewer*);
266dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerHDF4WriteSDS(PetscViewer viewer, float *xf, int d, int *dims, int bs);
26700ccbe27SDinesh Kaushik 
26877ed5343SBarry Smith /*
26977ed5343SBarry Smith      These are all the default viewers that do not have
27077ed5343SBarry Smith    to be explicitly opened
27177ed5343SBarry Smith */
272b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_STDOUT_(MPI_Comm);
273b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_STDERR_(MPI_Comm);
274b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_DRAW_(MPI_Comm);
275b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_SOCKET_(MPI_Comm);
276b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_BINARY_(MPI_Comm);
277cbb32127SBarry Smith EXTERN PetscViewer PETSC_VIEWER_MATLAB_(MPI_Comm);
2787eb62a3eSMatthew Knepley EXTERN PetscViewer PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE;
2795311e20fSBarry Smith 
280b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_SELF  PETSC_VIEWER_STDERR_(PETSC_COMM_SELF)
281b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD)
28230de9b25SBarry Smith 
28330de9b25SBarry Smith /*MC
28430de9b25SBarry Smith   PETSC_VIEWER_STDOUT_WORLD  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
28530de9b25SBarry Smith 
28630de9b25SBarry Smith   Level: beginner
28730de9b25SBarry Smith M*/
28830de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
28930de9b25SBarry Smith 
29030de9b25SBarry Smith /*MC
29130de9b25SBarry Smith   PETSC_VIEWER_STDOUT_SELF  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
29230de9b25SBarry Smith 
29330de9b25SBarry Smith   Level: beginner
29430de9b25SBarry Smith M*/
29530de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_SELF  PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
29630de9b25SBarry Smith 
29730de9b25SBarry Smith /*MC
29830de9b25SBarry Smith   PETSC_VIEWER_DRAW_WORLD  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
29930de9b25SBarry Smith 
30030de9b25SBarry Smith   Level: intermediate
30130de9b25SBarry Smith M*/
302b0a32e0cSBarry Smith #define PETSC_VIEWER_DRAW_WORLD   PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
30330de9b25SBarry Smith 
30430de9b25SBarry Smith /*MC
30530de9b25SBarry Smith   PETSC_VIEWER_DRAW_SELF  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
30630de9b25SBarry Smith 
30730de9b25SBarry Smith   Level: intermediate
30830de9b25SBarry Smith M*/
30930de9b25SBarry Smith #define PETSC_VIEWER_DRAW_SELF    PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
31030de9b25SBarry Smith 
31130de9b25SBarry Smith /*MC
31230de9b25SBarry Smith   PETSC_VIEWER_SOCKET_WORLD  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
31330de9b25SBarry Smith 
31430de9b25SBarry Smith   Level: intermediate
31530de9b25SBarry Smith M*/
316b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
31730de9b25SBarry Smith 
31830de9b25SBarry Smith /*MC
31930de9b25SBarry Smith   PETSC_VIEWER_SOCKET_SELF  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
32030de9b25SBarry Smith 
32130de9b25SBarry Smith   Level: intermediate
32230de9b25SBarry Smith M*/
323b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_SELF  PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
32430de9b25SBarry Smith 
32530de9b25SBarry Smith /*MC
32630de9b25SBarry Smith   PETSC_VIEWER_BINARY_WORLD  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
32730de9b25SBarry Smith 
32830de9b25SBarry Smith   Level: intermediate
32930de9b25SBarry Smith M*/
330b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
33130de9b25SBarry Smith 
33230de9b25SBarry Smith /*MC
33330de9b25SBarry Smith   PETSC_VIEWER_BINARY_SELF  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
33430de9b25SBarry Smith 
33530de9b25SBarry Smith   Level: intermediate
33630de9b25SBarry Smith M*/
337b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_SELF  PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
33830de9b25SBarry Smith 
339cbb32127SBarry Smith /*MC
340cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_WORLD  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
341cbb32127SBarry Smith 
342cbb32127SBarry Smith   Level: intermediate
343cbb32127SBarry Smith M*/
344cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
345cbb32127SBarry Smith 
346cbb32127SBarry Smith /*MC
347cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_SELF  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
348cbb32127SBarry Smith 
349cbb32127SBarry Smith   Level: intermediate
350cbb32127SBarry Smith M*/
351cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_SELF  PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
352cbb32127SBarry Smith 
3537eb62a3eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(),PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE)
35465ef3172SBarry Smith 
35577ed5343SBarry Smith /*
356b0a32e0cSBarry Smith     PetscViewer based on the ALICE Memory Snooper
35777ed5343SBarry Smith */
358aa482453SBarry Smith #if defined(PETSC_HAVE_AMS)
359cb5b572fSBarry Smith #include "ams.h"
360dfbe8321SBarry Smith EXTERN PetscErrorCode         PetscViewerAMSGetAMSComm(PetscViewer,AMS_Comm *);
361dfbe8321SBarry Smith EXTERN PetscErrorCode         PetscViewerAMSOpen(MPI_Comm,const char[],PetscViewer*);
362dfbe8321SBarry Smith EXTERN PetscErrorCode         PetscViewerAMSLock(PetscViewer);
363b0a32e0cSBarry Smith EXTERN PetscViewer PETSC_VIEWER_AMS_(MPI_Comm);
364dfbe8321SBarry Smith EXTERN PetscErrorCode         PETSC_VIEWER_AMS_Destroy(MPI_Comm);
365b0a32e0cSBarry Smith #define PETSC_VIEWER_AMS_WORLD PETSC_VIEWER_AMS_(PETSC_COMM_WORLD)
3662eb8c8abSBarry Smith #endif
367cb5b572fSBarry Smith 
368f2b01315SBarry Smith /*
369cbb32127SBarry Smith    petscViewer writes to Matlab .mat file
370cbb32127SBarry Smith */
371dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerMatlabPutArray(PetscViewer,int,int,PetscScalar*,char*);
372dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerMatlabGetArray(PetscViewer,int,int,PetscScalar*,char*);
373dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewerMatlabPutVariable(PetscViewer,const char*,void*);
374cbb32127SBarry Smith 
375cbb32127SBarry Smith /*
376b0a32e0cSBarry Smith     PetscViewer utility routines used by PETSc that are not normally used
377f2b01315SBarry Smith    by users.
378f2b01315SBarry Smith */
379dfbe8321SBarry Smith EXTERN PetscErrorCode  PetscViewerSocketPutScalar(PetscViewer,int,int,PetscScalar*);
380dfbe8321SBarry Smith EXTERN PetscErrorCode  PetscViewerSocketPutReal(PetscViewer,int,int,PetscReal*);
381dfbe8321SBarry Smith EXTERN PetscErrorCode  PetscViewerSocketPutInt(PetscViewer,int,int*);
382dfbe8321SBarry Smith EXTERN PetscErrorCode  PetscViewerSocketPutSparse_Private(PetscViewer,int,int,int,PetscScalar*,int*,int *);
383dfbe8321SBarry Smith EXTERN PetscErrorCode  PetscViewerDestroyAMS_Private(void);
384f2b01315SBarry Smith 
385b9617806SBarry Smith /*S
386b9617806SBarry Smith      PetscViewers - Abstract collection of PetscViewers
387b9617806SBarry Smith 
388b9617806SBarry Smith    Level: intermediate
389b9617806SBarry Smith 
390b9617806SBarry Smith   Concepts: viewing
391b9617806SBarry Smith 
392b9617806SBarry Smith .seealso:  PetscViewerCreate(), PetscViewerSetType(), PetscViewerType, PetscViewer, PetscViewersCreate(),
393b9617806SBarry Smith            PetscViewersGetViewer()
394b9617806SBarry Smith S*/
395b0a32e0cSBarry Smith typedef struct _p_PetscViewers* PetscViewers;
396dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewersCreate(MPI_Comm,PetscViewers*);
397dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewersDestroy(PetscViewers);
398dfbe8321SBarry Smith EXTERN PetscErrorCode PetscViewersGetViewer(PetscViewers,int,PetscViewer*);
399d132466eSBarry Smith 
400e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END
401cb5b572fSBarry Smith #endif
402