xref: /petsc/include/petscviewer.h (revision 90e10c2faa44d88df4e858df8c0e2b8fb24ce5e6)
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 
12b9617806SBarry Smith /*S
13b9617806SBarry Smith      PetscViewer - Abstract PETSc object that helps view (in ASCII, binary, graphically etc)
14b9617806SBarry Smith          other PETSc objects
15b9617806SBarry Smith 
16b9617806SBarry Smith    Level: beginner
17b9617806SBarry Smith 
18b9617806SBarry Smith   Concepts: viewing
19b9617806SBarry Smith 
20b9617806SBarry Smith .seealso:  PetscViewerCreate(), PetscViewerSetType(), PetscViewerType
21b9617806SBarry Smith S*/
22b0a32e0cSBarry Smith typedef struct _p_PetscViewer* PetscViewer;
233c119ea2SBarry Smith 
24e9fa29b7SSatish Balay #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus)
25e9fa29b7SSatish Balay }
26e9fa29b7SSatish Balay #endif
27e9fa29b7SSatish Balay 
288fb59f0aSKris Buschelman #include "petsc.h"
298fb59f0aSKris Buschelman 
308fb59f0aSKris Buschelman #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus)
318fb59f0aSKris Buschelman extern "C" {
328fb59f0aSKris Buschelman #endif
338fb59f0aSKris Buschelman 
34ff73aad6SKris Buschelman extern PETSC_DLLEXPORT PetscCookie PETSC_VIEWER_COOKIE;
358fb59f0aSKris Buschelman 
368fb59f0aSKris Buschelman #if defined(PETSC_USE_EXTERN_CXX) && defined(__cplusplus)
378fb59f0aSKris Buschelman }
388fb59f0aSKris Buschelman #endif
398fb59f0aSKris Buschelman 
40e9fa29b7SSatish Balay 
413c119ea2SBarry Smith /*
42b0a32e0cSBarry Smith     petsc.h must be included AFTER the definition of PetscViewer for ADIC to
433c119ea2SBarry Smith    process correctly.
443c119ea2SBarry Smith */
45e9fa29b7SSatish Balay PETSC_EXTERN_CXX_BEGIN
46b9617806SBarry Smith /*E
47b9617806SBarry Smith     PetscViewerType - String with the name of a PETSc PETScViewer
48b9617806SBarry Smith 
49b9617806SBarry Smith    Level: beginner
50b9617806SBarry Smith 
51b9617806SBarry Smith .seealso: PetscViewerSetType(), PetscViewer
52b9617806SBarry Smith E*/
53f69a0ea3SMatthew Knepley #define PetscViewerType const char*
54b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET       "socket"
55b0a32e0cSBarry Smith #define PETSC_VIEWER_ASCII        "ascii"
56fb9695e5SSatish Balay #define PETSC_VIEWER_BINARY       "binary"
57b0a32e0cSBarry Smith #define PETSC_VIEWER_STRING       "string"
58fb9695e5SSatish Balay #define PETSC_VIEWER_DRAW         "draw"
5944c73c46SMatthew Knepley #define PETSC_VIEWER_VU           "vu"
604ebda54eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA  "mathematica"
614ebda54eSMatthew Knepley #define PETSC_VIEWER_SILO         "silo"
62e3eb5169SDinesh Kaushik #define PETSC_VIEWER_NETCDF       "netcdf"
6300ccbe27SDinesh Kaushik #define PETSC_VIEWER_HDF4         "hdf4"
64cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB       "matlab"
6577ed5343SBarry Smith 
66b0a32e0cSBarry Smith extern PetscFList PetscViewerList;
67ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerRegisterAll(const char *);
68ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerRegisterDestroy(void);
69*90e10c2fSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerInitializePackage(const char[]);
707b2a1423SBarry Smith 
71ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerRegister(const char*,const char*,const char*,PetscErrorCode (*)(PetscViewer));
7230de9b25SBarry Smith 
7330de9b25SBarry Smith /*MC
7430de9b25SBarry Smith    PetscViewerRegisterDynamic - Adds a method to the Krylov subspace solver package.
7530de9b25SBarry Smith 
7630de9b25SBarry Smith    Synopsis:
77d360dc6fSBarry Smith    PetscErrorCode PetscViewerRegisterDynamic(char *name_solver,char *path,char *name_create,PetscErrorCode (*routine_create)(PetscViewer))
7830de9b25SBarry Smith 
7930de9b25SBarry Smith    Not Collective
8030de9b25SBarry Smith 
8130de9b25SBarry Smith    Input Parameters:
8230de9b25SBarry Smith +  name_solver - name of a new user-defined solver
8330de9b25SBarry Smith .  path - path (either absolute or relative) the library containing this solver
8430de9b25SBarry Smith .  name_create - name of routine to create method context
8530de9b25SBarry Smith -  routine_create - routine to create method context
8630de9b25SBarry Smith 
8730de9b25SBarry Smith    Level: developer
8830de9b25SBarry Smith 
8930de9b25SBarry Smith    Notes:
9030de9b25SBarry Smith    PetscViewerRegisterDynamic() may be called multiple times to add several user-defined solvers.
9130de9b25SBarry Smith 
9230de9b25SBarry Smith    If dynamic libraries are used, then the fourth input argument (routine_create)
9330de9b25SBarry Smith    is ignored.
9430de9b25SBarry Smith 
9530de9b25SBarry Smith    Sample usage:
9630de9b25SBarry Smith .vb
9730de9b25SBarry Smith    PetscViewerRegisterDynamic("my_viewer_type",/home/username/my_lib/lib/libO/solaris/mylib.a,
9830de9b25SBarry Smith                "MyViewerCreate",MyViewerCreate);
9930de9b25SBarry Smith .ve
10030de9b25SBarry Smith 
10130de9b25SBarry Smith    Then, your solver can be chosen with the procedural interface via
10230de9b25SBarry Smith $     PetscViewerSetType(ksp,"my_viewer_type")
10330de9b25SBarry Smith    or at runtime via the option
10430de9b25SBarry Smith $     -viewer_type my_viewer_type
10530de9b25SBarry Smith 
10630de9b25SBarry Smith   Concepts: registering^Viewers
10730de9b25SBarry Smith 
10830de9b25SBarry Smith .seealso: PetscViewerRegisterAll(), PetscViewerRegisterDestroy()
10930de9b25SBarry Smith M*/
110aa482453SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
111b0a32e0cSBarry Smith #define PetscViewerRegisterDynamic(a,b,c,d) PetscViewerRegister(a,b,c,0)
1127b2a1423SBarry Smith #else
113b0a32e0cSBarry Smith #define PetscViewerRegisterDynamic(a,b,c,d) PetscViewerRegister(a,b,c,d)
1147b2a1423SBarry Smith #endif
11530de9b25SBarry Smith 
116ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerCreate(MPI_Comm,PetscViewer*);
117045ff3e0SBarry Smith PetscPolymorphicSubroutine(PetscViewerCreate,(PetscViewer *v),(PETSC_COMM_SELF,v))
118ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetFromOptions(PetscViewer);
1197b2a1423SBarry Smith 
120ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIOpen(MPI_Comm,const char[],PetscViewer*);
121b1967279SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryCreate(MPI_Comm,PetscViewer*);
1223c67689dSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
123ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSocketOpen(MPI_Comm,const char[],int,PetscViewer*);
124ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerStringOpen(MPI_Comm,char[],PetscInt,PetscViewer*);
125ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerDrawOpen(MPI_Comm,const char[],const char[],int,int,int,int,PetscViewer*);
126ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *);
127ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloOpen(MPI_Comm, const char[], PetscViewer *);
1283c67689dSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMatlabOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
1294b0e389bSBarry Smith 
130ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetType(PetscViewer,PetscViewerType*);
131f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetType(PetscViewer,PetscViewerType);
132ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerDestroy(PetscViewer);
133ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetSingleton(PetscViewer,PetscViewer*);
134ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerRestoreSingleton(PetscViewer,PetscViewer*);
135a98ce0f4SHong Zhang EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetSubcomm(PetscViewer,MPI_Comm,PetscViewer*);
136a98ce0f4SHong Zhang EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerRestoreSubcomm(PetscViewer,MPI_Comm,PetscViewer*);
137ae39576cSLois Curfman McInnes 
138f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetUp(PetscViewer);
139f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerView(PetscViewer,PetscViewer);
140f69a0ea3SMatthew Knepley 
141f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetOptionsPrefix(PetscViewer,const char[]);
142f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerAppendOptionsPrefix(PetscViewer,const char[]);
143f69a0ea3SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetOptionsPrefix(PetscViewer,const char*[]);
144090de74eSSatish Balay 
145b9617806SBarry Smith /*E
146b9617806SBarry Smith     PetscViewerFormat - Way a viewer presents the object
147b9617806SBarry Smith 
148b9617806SBarry Smith    Level: beginner
149b9617806SBarry Smith 
150b9617806SBarry Smith .seealso: PetscViewerSetFormat(), PetscViewer, PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat()
151b9617806SBarry Smith E*/
152fb9695e5SSatish Balay typedef enum {
153f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_DEFAULT,
154f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_MATLAB,
1554ebda54eSMatthew Knepley   PETSC_VIEWER_ASCII_MATHEMATICA,
156f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_IMPL,
157f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INFO,
158456192e2SBarry Smith   PETSC_VIEWER_ASCII_INFO_DETAIL,
159f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_COMMON,
160f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_SYMMODU,
161f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INDEX,
162f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_DENSE,
163a505fa5bSMatthew Knepley   PETSC_VIEWER_ASCII_VTK,
164b85befe5SMatthew Knepley   PETSC_VIEWER_ASCII_VTK_CELL,
165b6d733afSMatthew Knepley   PETSC_VIEWER_ASCII_VTK_COORDS,
166493617b5SMatthew Knepley   PETSC_VIEWER_ASCII_PCICE,
167493617b5SMatthew Knepley   PETSC_VIEWER_ASCII_PYLITH,
16839439a91SMatthew Knepley   PETSC_VIEWER_ASCII_PYLITH_LOCAL,
169f3ef73ceSBarry Smith   PETSC_VIEWER_BINARY_DEFAULT,
170f3ef73ceSBarry Smith   PETSC_VIEWER_BINARY_NATIVE,
171f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_BASIC,
172f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_LG,
173f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_CONTOUR,
174f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_PORTS,
175f3ef73ceSBarry Smith   PETSC_VIEWER_NATIVE,
1764aedb280SBarry Smith   PETSC_VIEWER_NOFORMAT,
1774aedb280SBarry Smith   PETSC_VIEWER_ASCII_FACTOR_INFO} PetscViewerFormat;
178090de74eSSatish Balay 
179ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSetFormat(PetscViewer,PetscViewerFormat);
180ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerPushFormat(PetscViewer,PetscViewerFormat);
181ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerPopFormat(PetscViewer);
182ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerGetFormat(PetscViewer,PetscViewerFormat*);
183ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerFlush(PetscViewer);
1844b0e389bSBarry Smith 
18523d894e5SBarry Smith /*S
18623d894e5SBarry Smith      PetscViewerASCIIMonitor - Context for the default KSP, SNES and TS monitors that print
18723d894e5SBarry Smith                                   ASCII strings of residual norms etc.
18823d894e5SBarry Smith 
18923d894e5SBarry Smith 
19023d894e5SBarry Smith    Level: advanced
19123d894e5SBarry Smith 
19223d894e5SBarry Smith   Concepts: viewing, monitoring
19323d894e5SBarry Smith 
19423d894e5SBarry Smith .seealso:  PetscViewerCreate(), PetscViewerSetType(), PetscViewerType, KSPMonitorSet(), SNESMonitorSet(), TSMonitorSet(),
19523d894e5SBarry Smith            KSPMonitorDefault(), SNESMonitorDefault()
19623d894e5SBarry Smith 
19723d894e5SBarry Smith S*/
19823d894e5SBarry Smith struct _p_PetscViewerASCIIMonitor {
19923d894e5SBarry Smith   PetscViewer viewer;
20023d894e5SBarry Smith   PetscInt    tabs;
20123d894e5SBarry Smith };
20223d894e5SBarry Smith typedef struct _p_PetscViewerASCIIMonitor* PetscViewerASCIIMonitor;
20323d894e5SBarry Smith 
20423d894e5SBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIMonitorCreate(MPI_Comm,const char *,PetscInt,PetscViewerASCIIMonitor*);
20523d894e5SBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIMonitorDestroy(PetscViewerASCIIMonitor);
20623d894e5SBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIMonitorPrintf(PetscViewerASCIIMonitor,const char[],...);
20723d894e5SBarry Smith 
20877ed5343SBarry Smith /*
20977ed5343SBarry Smith    Operations explicit to a particular class of viewers
21077ed5343SBarry Smith */
211ed5c6e3eSMatthew Knepley 
212ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIGetPointer(PetscViewer,FILE**);
2137d0c5eb9SMatthew Knepley EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerFileGetMode(PetscViewer,PetscFileMode*);
2143c67689dSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerFileSetMode(PetscViewer,PetscFileMode);
215ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3);
216ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIISynchronizedPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3);
217ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIPushTab(PetscViewer);
218ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIPopTab(PetscViewer);
219ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIUseTabs(PetscViewer,PetscTruth);
220ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIISetTab(PetscViewer,PetscInt);
221ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryGetDescriptor(PetscViewer,int*);
222ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryGetInfoPointer(PetscViewer,FILE **);
223f588057bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryRead(PetscViewer,void*,PetscInt,PetscDataType);
224f588057bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryWrite(PetscViewer,void*,PetscInt,PetscDataType,PetscTruth);
225ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerStringSPrintf(PetscViewer,const char[],...) PETSC_PRINTF_FORMAT_CHECK(2,3);
226ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerStringSetString(PetscViewer,char[],PetscInt);
227ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerDrawClear(PetscViewer);
228ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerDrawSetInfo(PetscViewer,const char[],const char[],int,int,int,int);
229ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSocketSetConnection(PetscViewer,const char[],PetscInt);
230ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinarySkipInfo(PetscViewer);
231ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryLoadInfo(PetscViewer);
2329dcbbd2bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinarySetSkipOptions(PetscViewer,PetscTruth);
2339dcbbd2bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryGetSkipOptions(PetscViewer,PetscTruth*);
2348a13ba5bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryReadStringArray(PetscViewer,char***);
2358a13ba5bSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerBinaryWriteStringArray(PetscViewer,char**);
236c655490fSBarry Smith 
2373c67689dSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerFileSetName(PetscViewer,const char[]);
2383c67689dSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerFileGetName(PetscViewer,char**);
23977ed5343SBarry Smith 
240e5bd5246SBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscPLAPACKInitializePackage(const char[]);
241ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscPLAPACKFinalizePackage(void);
24244c6da4fSMatthew Knepley 
243ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUGetPointer(PetscViewer, FILE**);
244ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUSetVecSeen(PetscViewer, PetscTruth);
245ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUGetVecSeen(PetscViewer, PetscTruth *);
246ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUPrintDeferred(PetscViewer, const char [], ...) PETSC_PRINTF_FORMAT_CHECK(2,3);
247ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerVUFlushDeferred(PetscViewer);
24855dcf840SMatthew Knepley 
249e5bd5246SBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaInitializePackage(const char[]);
250ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaFinalizePackage(void);
251ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaGetName(PetscViewer, const char **);
252ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaSetName(PetscViewer, const char []);
253ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaClearName(PetscViewer);
254ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMathematicaSkipPackets(PetscViewer, int);
2554ebda54eSMatthew Knepley 
256ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloGetName(PetscViewer, char **);
257ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloSetName(PetscViewer, const char []);
258ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloClearName(PetscViewer);
259ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloGetMeshName(PetscViewer, char **);
260ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloSetMeshName(PetscViewer, const char []);
261ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerSiloClearMeshName(PetscViewer);
2624ebda54eSMatthew Knepley 
2633c67689dSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerNetcdfOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
264ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerNetcdfGetID(PetscViewer, int *);
265e3eb5169SDinesh Kaushik 
2663c67689dSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerHDF4Open(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
267b864a7bfSBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerHDF4WriteSDS(PetscViewer,float *,int,int *,int);
26800ccbe27SDinesh Kaushik 
26977ed5343SBarry Smith /*
27077ed5343SBarry Smith      These are all the default viewers that do not have
27177ed5343SBarry Smith    to be explicitly opened
27277ed5343SBarry Smith */
273ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_STDOUT_(MPI_Comm);
2743050cee2SBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIGetStdout(MPI_Comm,PetscViewer*);
275ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_STDERR_(MPI_Comm);
2763050cee2SBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerASCIIGetStderr(MPI_Comm,PetscViewer*);
277ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_DRAW_(MPI_Comm);
278ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_SOCKET_(MPI_Comm);
279ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_BINARY_(MPI_Comm);
280ff73aad6SKris Buschelman EXTERN PetscViewer PETSC_DLLEXPORT PETSC_VIEWER_MATLAB_(MPI_Comm);
2817eb62a3eSMatthew Knepley EXTERN PetscViewer PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE;
2825311e20fSBarry Smith 
283b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_SELF  PETSC_VIEWER_STDERR_(PETSC_COMM_SELF)
284b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD)
28530de9b25SBarry Smith 
28630de9b25SBarry Smith /*MC
28730de9b25SBarry Smith   PETSC_VIEWER_STDOUT_WORLD  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
28830de9b25SBarry Smith 
28930de9b25SBarry Smith   Level: beginner
29030de9b25SBarry Smith M*/
29130de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
29230de9b25SBarry Smith 
29330de9b25SBarry Smith /*MC
29430de9b25SBarry Smith   PETSC_VIEWER_STDOUT_SELF  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
29530de9b25SBarry Smith 
29630de9b25SBarry Smith   Level: beginner
29730de9b25SBarry Smith M*/
29830de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_SELF  PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
29930de9b25SBarry Smith 
30030de9b25SBarry Smith /*MC
30130de9b25SBarry Smith   PETSC_VIEWER_DRAW_WORLD  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
30230de9b25SBarry Smith 
30330de9b25SBarry Smith   Level: intermediate
30430de9b25SBarry Smith M*/
305b0a32e0cSBarry Smith #define PETSC_VIEWER_DRAW_WORLD   PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
30630de9b25SBarry Smith 
30730de9b25SBarry Smith /*MC
30830de9b25SBarry Smith   PETSC_VIEWER_DRAW_SELF  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
30930de9b25SBarry Smith 
31030de9b25SBarry Smith   Level: intermediate
31130de9b25SBarry Smith M*/
31230de9b25SBarry Smith #define PETSC_VIEWER_DRAW_SELF    PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
31330de9b25SBarry Smith 
31430de9b25SBarry Smith /*MC
31530de9b25SBarry Smith   PETSC_VIEWER_SOCKET_WORLD  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
31630de9b25SBarry Smith 
31730de9b25SBarry Smith   Level: intermediate
31830de9b25SBarry Smith M*/
319b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
32030de9b25SBarry Smith 
32130de9b25SBarry Smith /*MC
32230de9b25SBarry Smith   PETSC_VIEWER_SOCKET_SELF  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
32330de9b25SBarry Smith 
32430de9b25SBarry Smith   Level: intermediate
32530de9b25SBarry Smith M*/
326b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_SELF  PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
32730de9b25SBarry Smith 
32830de9b25SBarry Smith /*MC
32930de9b25SBarry Smith   PETSC_VIEWER_BINARY_WORLD  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
33030de9b25SBarry Smith 
33130de9b25SBarry Smith   Level: intermediate
33230de9b25SBarry Smith M*/
333b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
33430de9b25SBarry Smith 
33530de9b25SBarry Smith /*MC
33630de9b25SBarry Smith   PETSC_VIEWER_BINARY_SELF  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
33730de9b25SBarry Smith 
33830de9b25SBarry Smith   Level: intermediate
33930de9b25SBarry Smith M*/
340b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_SELF  PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
34130de9b25SBarry Smith 
342cbb32127SBarry Smith /*MC
343cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_WORLD  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
344cbb32127SBarry Smith 
345cbb32127SBarry Smith   Level: intermediate
346cbb32127SBarry Smith M*/
347cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
348cbb32127SBarry Smith 
349cbb32127SBarry Smith /*MC
350cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_SELF  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
351cbb32127SBarry Smith 
352cbb32127SBarry Smith   Level: intermediate
353cbb32127SBarry Smith M*/
354cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_SELF  PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
355cbb32127SBarry Smith 
3567eb62a3eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(),PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE)
35765ef3172SBarry Smith 
35877ed5343SBarry Smith /*
359cbb32127SBarry Smith    petscViewer writes to Matlab .mat file
360cbb32127SBarry Smith */
361ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMatlabPutArray(PetscViewer,int,int,PetscScalar*,char*);
362ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMatlabGetArray(PetscViewer,int,int,PetscScalar*,char*);
363ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewerMatlabPutVariable(PetscViewer,const char*,void*);
364cbb32127SBarry Smith 
365b9617806SBarry Smith /*S
366b9617806SBarry Smith      PetscViewers - Abstract collection of PetscViewers
367b9617806SBarry Smith 
368b9617806SBarry Smith    Level: intermediate
369b9617806SBarry Smith 
370b9617806SBarry Smith   Concepts: viewing
371b9617806SBarry Smith 
372b9617806SBarry Smith .seealso:  PetscViewerCreate(), PetscViewerSetType(), PetscViewerType, PetscViewer, PetscViewersCreate(),
373b9617806SBarry Smith            PetscViewersGetViewer()
374b9617806SBarry Smith S*/
37595fbd943SSatish Balay typedef struct _n_PetscViewers* PetscViewers;
376ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewersCreate(MPI_Comm,PetscViewers*);
377ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewersDestroy(PetscViewers);
3789c666560SBarry Smith EXTERN PetscErrorCode PETSC_DLLEXPORT PetscViewersGetViewer(PetscViewers,PetscInt,PetscViewer*);
379d132466eSBarry Smith 
380e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END
381cb5b572fSBarry Smith #endif
382