xref: /petsc/include/petscviewer.h (revision 78fbdcc8da47d2da69f91a746197bf2bceb22ad2)
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 
86420c192SJed Brown #include <petscsys.h>
9c619b03eSJed Brown #include <petscviewertypes.h>
10e9fa29b7SSatish Balay 
11014dd563SJed Brown PETSC_EXTERN PetscClassId PETSC_VIEWER_CLASSID;
12e9fa29b7SSatish Balay 
1376bdecfbSBarry Smith /*J
14b9617806SBarry Smith     PetscViewerType - String with the name of a PETSc PETScViewer
15b9617806SBarry Smith 
16b9617806SBarry Smith    Level: beginner
17b9617806SBarry Smith 
188f6c3df8SBarry Smith .seealso: PetscViewerSetType(), PetscViewer, PetscViewerRegister(), PetscViewerCreate()
1976bdecfbSBarry Smith J*/
2019fd82e9SBarry Smith typedef const char* PetscViewerType;
212692d6eeSBarry Smith #define PETSCVIEWERSOCKET       "socket"
222692d6eeSBarry Smith #define PETSCVIEWERASCII        "ascii"
232692d6eeSBarry Smith #define PETSCVIEWERBINARY       "binary"
242692d6eeSBarry Smith #define PETSCVIEWERSTRING       "string"
252692d6eeSBarry Smith #define PETSCVIEWERDRAW         "draw"
262692d6eeSBarry Smith #define PETSCVIEWERVU           "vu"
272692d6eeSBarry Smith #define PETSCVIEWERMATHEMATICA  "mathematica"
282692d6eeSBarry Smith #define PETSCVIEWERHDF5         "hdf5"
294061b8bfSJed Brown #define PETSCVIEWERVTK          "vtk"
302692d6eeSBarry Smith #define PETSCVIEWERMATLAB       "matlab"
31e04113cfSBarry Smith #define PETSCVIEWERSAWS          "saws"
3277ed5343SBarry Smith 
33140e18c1SBarry Smith PETSC_EXTERN PetscFunctionList PetscViewerList;
34607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerInitializePackage(void);
357b2a1423SBarry Smith 
36bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerRegister(const char[],PetscErrorCode (*)(PetscViewer));
3730de9b25SBarry Smith 
38014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerCreate(MPI_Comm,PetscViewer*);
39014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetFromOptions(PetscViewer);
40014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpenWithFILE(MPI_Comm,FILE*,PetscViewer*);
417b2a1423SBarry Smith 
42014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIOpen(MPI_Comm,const char[],PetscViewer*);
43014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISetFILE(PetscViewer,FILE*);
44014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
45014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetFlowControl(PetscViewer,PetscInt*);
46014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetFlowControl(PetscViewer,PetscInt);
47bc196f7cSDave May PETSC_EXTERN PetscErrorCode PetscViewerBinarySetUseMPIIO(PetscViewer,PetscBool);
48bc196f7cSDave May PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetUseMPIIO(PetscViewer,PetscBool *);
490fc9d207SBarry Smith #if defined(PETSC_HAVE_MPIIO)
50014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIODescriptor(PetscViewer,MPI_File*);
51014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetMPIIOOffset(PetscViewer,MPI_Offset*);
52014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryAddMPIIOOffset(PetscViewer,MPI_Offset);
53951e3c8eSBarry Smith #endif
5439802e9eSBarry Smith 
55014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSocketOpen(MPI_Comm,const char[],int,PetscViewer*);
5689d949e2SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerStringOpen(MPI_Comm,char[],size_t,PetscViewer*);
57014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawOpen(MPI_Comm,const char[],const char[],int,int,int,int,PetscViewer*);
58d1da0b69SBarry Smith #include <petscdrawtypes.h>
59d1da0b69SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerDrawSetDrawType(PetscViewer,PetscDrawType);
60014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaOpen(MPI_Comm, int, const char[], const char[], PetscViewer *);
61014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloOpen(MPI_Comm, const char[], PetscViewer *);
62014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
634b0e389bSBarry Smith 
6419fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerGetType(PetscViewer,PetscViewerType*);
6519fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerSetType(PetscViewer,PetscViewerType);
66014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDestroy(PetscViewer*);
673f08860eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerGetSubViewer(PetscViewer,MPI_Comm,PetscViewer*);
683f08860eSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerRestoreSubViewer(PetscViewer,MPI_Comm,PetscViewer*);
69ae39576cSLois Curfman McInnes 
70014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetUp(PetscViewer);
71014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerView(PetscViewer,PetscViewer);
72685405a1SBarry Smith PETSC_STATIC_INLINE PetscErrorCode PetscViewerViewFromOptions(PetscViewer A,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,obj,name);}
73f69a0ea3SMatthew Knepley 
74014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSetOptionsPrefix(PetscViewer,const char[]);
75014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerAppendOptionsPrefix(PetscViewer,const char[]);
76014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerGetOptionsPrefix(PetscViewer,const char*[]);
77090de74eSSatish Balay 
78b9617806SBarry Smith /*E
79b9617806SBarry Smith     PetscViewerFormat - Way a viewer presents the object
80b9617806SBarry Smith 
81b9617806SBarry Smith    Level: beginner
82b9617806SBarry Smith 
83af0996ceSBarry Smith    The values below are also listed in petsc/finclude/petscviewer.h. If another values is added below it
84cfaaf4edSHong Zhang    must also be added there.
85cfaaf4edSHong Zhang 
866a9046bcSBarry Smith .seealso: PetscViewer, PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat()
87b9617806SBarry Smith E*/
88fb9695e5SSatish Balay typedef enum {
89117016b1SBarry Smith   PETSC_VIEWER_DEFAULT,
90f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_MATLAB,
914ebda54eSMatthew Knepley   PETSC_VIEWER_ASCII_MATHEMATICA,
92f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_IMPL,
93f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INFO,
94456192e2SBarry Smith   PETSC_VIEWER_ASCII_INFO_DETAIL,
95f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_COMMON,
96f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_SYMMODU,
97f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_INDEX,
98f3ef73ceSBarry Smith   PETSC_VIEWER_ASCII_DENSE,
993c215bfdSMatthew Knepley   PETSC_VIEWER_ASCII_MATRIXMARKET,
100a505fa5bSMatthew Knepley   PETSC_VIEWER_ASCII_VTK,
101b85befe5SMatthew Knepley   PETSC_VIEWER_ASCII_VTK_CELL,
102b6d733afSMatthew Knepley   PETSC_VIEWER_ASCII_VTK_COORDS,
103493617b5SMatthew Knepley   PETSC_VIEWER_ASCII_PCICE,
104cfaaf4edSHong Zhang   PETSC_VIEWER_ASCII_PYTHON,
105cfaaf4edSHong Zhang   PETSC_VIEWER_ASCII_FACTOR_INFO,
10667ad5babSMatthew G Knepley   PETSC_VIEWER_ASCII_LATEX,
107bb1d7374SBarry Smith   PETSC_VIEWER_ASCII_XML,
108f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_BASIC,
109f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_LG,
110f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_CONTOUR,
111f3ef73ceSBarry Smith   PETSC_VIEWER_DRAW_PORTS,
1124061b8bfSJed Brown   PETSC_VIEWER_VTK_VTS,
113a13bc4e3SShao-Ching Huang   PETSC_VIEWER_VTK_VTR,
114b263465dSJed Brown   PETSC_VIEWER_VTK_VTU,
115a261c58fSBarry Smith   PETSC_VIEWER_BINARY_MATLAB,
116f3ef73ceSBarry Smith   PETSC_VIEWER_NATIVE,
117ffe0aed0SMatthew G. Knepley   PETSC_VIEWER_HDF5_VIZ,
118cfaaf4edSHong Zhang   PETSC_VIEWER_NOFORMAT
119cfaaf4edSHong Zhang   } PetscViewerFormat;
120014dd563SJed Brown PETSC_EXTERN const char *const PetscViewerFormats[];
121090de74eSSatish Balay 
1226a9046bcSBarry Smith PETSC_EXTERN PETSC_DEPRECATED("Use PetscViewerPushFormat()/PetscViewerPopFormat()") PetscErrorCode PetscViewerSetFormat(PetscViewer,PetscViewerFormat);
123014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerPushFormat(PetscViewer,PetscViewerFormat);
124014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerPopFormat(PetscViewer);
125014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerGetFormat(PetscViewer,PetscViewerFormat*);
126014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFlush(PetscViewer);
1274b0e389bSBarry Smith 
128eb55bdffSLawrence Mitchell PETSC_EXTERN PetscErrorCode PetscOptionsPushGetViewerOff(PetscBool);
129eb55bdffSLawrence Mitchell PETSC_EXTERN PetscErrorCode PetscOptionsPopGetViewerOff();
130eb55bdffSLawrence Mitchell PETSC_EXTERN PetscErrorCode PetscOptionsGetViewerOff(PetscBool*);
131cffb1e40SBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsGetViewer(MPI_Comm,const char[],const char[],PetscViewer*,PetscViewerFormat*,PetscBool*);
132e55864a3SBarry Smith #define PetscOptionsViewer(a,b,c,d,e,f) PetscOptionsViewer_Private(PetscOptionsObject,a,b,c,d,e,f);
1334416b707SBarry Smith PETSC_EXTERN PetscErrorCode PetscOptionsViewer_Private(PetscOptionItems*,const char[],const char[],const char[],PetscViewer*,PetscViewerFormat *,PetscBool *);
1342bf49c77SBarry Smith 
135fe01d993SBarry Smith typedef struct {PetscViewer viewer;PetscViewerFormat format;} PetscViewerAndFormat;
136d7cbc13eSBarry Smith PETSC_EXTERN PetscErrorCode  PetscViewerAndFormatCreate(PetscViewer,PetscViewerFormat,PetscViewerAndFormat**);
137fe01d993SBarry Smith PETSC_EXTERN PetscErrorCode  PetscViewerAndFormatDestroy(PetscViewerAndFormat**);
138fe01d993SBarry Smith 
13977ed5343SBarry Smith /*
14077ed5343SBarry Smith    Operations explicit to a particular class of viewers
14177ed5343SBarry Smith */
142ed5c6e3eSMatthew Knepley 
143014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetPointer(PetscViewer,FILE**);
144014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileGetMode(PetscViewer,PetscFileMode*);
145014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileSetMode(PetscViewer,PetscFileMode);
146060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerRead(PetscViewer,void*,PetscInt,PetscInt*,PetscDataType);
147014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPrintf(PetscViewer,const char[],...);
148014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISynchronizedPrintf(PetscViewer,const char[],...);
1491575c14dSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushSynchronized(PetscViewer);
1501575c14dSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopSynchronized(PetscViewer);
151014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPushTab(PetscViewer);
152014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIPopTab(PetscViewer);
153014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIUseTabs(PetscViewer,PetscBool );
154014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISetTab(PetscViewer,PetscInt);
155014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetTab(PetscViewer,PetscInt*);
156014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIAddTab(PetscViewer,PetscInt);
157014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIISubtractTab(PetscViewer,PetscInt);
158060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerASCIIRead(PetscViewer,void *,PetscInt,PetscInt*,PetscDataType);
159014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetDescriptor(PetscViewer,int*);
160014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetInfoPointer(PetscViewer,FILE **);
161060da220SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscViewerBinaryRead(PetscViewer,void*,PetscInt,PetscInt*,PetscDataType);
162014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryWrite(PetscViewer,void*,PetscInt,PetscDataType,PetscBool );
163014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerStringSPrintf(PetscViewer,const char[],...);
164014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerStringSetString(PetscViewer,char[],PetscInt);
165014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawClear(PetscViewer);
166014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetHold(PetscViewer,PetscBool);
167014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetHold(PetscViewer,PetscBool*);
168014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetPause(PetscViewer,PetscReal);
169014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetPause(PetscViewer,PetscReal*);
170014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetInfo(PetscViewer,const char[],const char[],int,int,int,int);
171014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawResize(PetscViewer,int,int);
172014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawSetBounds(PetscViewer,PetscInt,const PetscReal*);
173014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerDrawGetBounds(PetscViewer,PetscInt*,const PetscReal**);
174014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSocketSetConnection(PetscViewer,const char[],int);
175014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySkipInfo(PetscViewer);
176807ea322SDave May PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipInfo(PetscViewer,PetscBool);
177807ea322SDave May PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipInfo(PetscViewer,PetscBool*);
178014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipOptions(PetscViewer,PetscBool );
179014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipOptions(PetscViewer,PetscBool *);
180014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinarySetSkipHeader(PetscViewer,PetscBool);
181014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryGetSkipHeader(PetscViewer,PetscBool*);
182014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerBinaryReadStringArray(PetscViewer,char***);
183*78fbdcc8SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerBinaryWriteStringArray(PetscViewer,const char *const*);
184c655490fSBarry Smith 
185014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileSetName(PetscViewer,const char[]);
186014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerFileGetName(PetscViewer,const char**);
18777ed5343SBarry Smith 
188014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUGetPointer(PetscViewer, FILE**);
189014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUSetVecSeen(PetscViewer, PetscBool );
190014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUGetVecSeen(PetscViewer, PetscBool  *);
191014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUPrintDeferred(PetscViewer, const char [], ...);
192014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVUFlushDeferred(PetscViewer);
19355dcf840SMatthew Knepley 
194607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerMathematicaInitializePackage(void);
195014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaFinalizePackage(void);
196014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaGetName(PetscViewer, const char **);
197014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSetName(PetscViewer, const char []);
198014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaClearName(PetscViewer);
199014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMathematicaSkipPackets(PetscViewer, int);
2004ebda54eSMatthew Knepley 
201014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloGetName(PetscViewer, char **);
202014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloSetName(PetscViewer, const char []);
203014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloClearName(PetscViewer);
204014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloGetMeshName(PetscViewer, char **);
205014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloSetMeshName(PetscViewer, const char []);
206014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerSiloClearMeshName(PetscViewer);
2074ebda54eSMatthew Knepley 
208893c9c94SMatthew G Knepley typedef enum {PETSC_VTK_POINT_FIELD, PETSC_VTK_POINT_VECTOR_FIELD, PETSC_VTK_CELL_FIELD, PETSC_VTK_CELL_VECTOR_FIELD} PetscViewerVTKFieldType;
20918e2ec27SBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerVTKAddField(PetscViewer,PetscObject,PetscErrorCode (*PetscViewerVTKWriteFunction)(PetscObject,PetscViewer),PetscViewerVTKFieldType,PetscObject);
210014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerVTKOpen(MPI_Comm,const char[],PetscFileMode,PetscViewer*);
2114061b8bfSJed Brown 
21277ed5343SBarry Smith /*
213d70abbfaSBarry Smith      These are all the default viewers that do not have to be explicitly opened
21477ed5343SBarry Smith */
215014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_STDOUT_(MPI_Comm);
216014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStdout(MPI_Comm,PetscViewer*);
217014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_STDERR_(MPI_Comm);
218014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerASCIIGetStderr(MPI_Comm,PetscViewer*);
219014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_DRAW_(MPI_Comm);
220014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_SOCKET_(MPI_Comm);
221014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_BINARY_(MPI_Comm);
222014dd563SJed Brown PETSC_EXTERN PetscViewer    PETSC_VIEWER_MATLAB_(MPI_Comm);
223a75e6a4aSMatthew G. Knepley PETSC_EXTERN PetscViewer    PETSC_VIEWER_HDF5_(MPI_Comm);
224014dd563SJed Brown PETSC_EXTERN PetscViewer   PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE;
2255311e20fSBarry Smith 
226b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_SELF  PETSC_VIEWER_STDERR_(PETSC_COMM_SELF)
227b0a32e0cSBarry Smith #define PETSC_VIEWER_STDERR_WORLD PETSC_VIEWER_STDERR_(PETSC_COMM_WORLD)
22830de9b25SBarry Smith 
22930de9b25SBarry Smith /*MC
23030de9b25SBarry Smith   PETSC_VIEWER_STDOUT_WORLD  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
23130de9b25SBarry Smith 
23230de9b25SBarry Smith   Level: beginner
23330de9b25SBarry Smith M*/
23430de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_WORLD PETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD)
23530de9b25SBarry Smith 
23630de9b25SBarry Smith /*MC
23730de9b25SBarry Smith   PETSC_VIEWER_STDOUT_SELF  - same as PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
23830de9b25SBarry Smith 
23930de9b25SBarry Smith   Level: beginner
24030de9b25SBarry Smith M*/
24130de9b25SBarry Smith #define PETSC_VIEWER_STDOUT_SELF  PETSC_VIEWER_STDOUT_(PETSC_COMM_SELF)
24230de9b25SBarry Smith 
24330de9b25SBarry Smith /*MC
24430de9b25SBarry Smith   PETSC_VIEWER_DRAW_WORLD  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
24530de9b25SBarry Smith 
24630de9b25SBarry Smith   Level: intermediate
24730de9b25SBarry Smith M*/
248b0a32e0cSBarry Smith #define PETSC_VIEWER_DRAW_WORLD   PETSC_VIEWER_DRAW_(PETSC_COMM_WORLD)
24930de9b25SBarry Smith 
25030de9b25SBarry Smith /*MC
25130de9b25SBarry Smith   PETSC_VIEWER_DRAW_SELF  - same as PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
25230de9b25SBarry Smith 
25330de9b25SBarry Smith   Level: intermediate
25430de9b25SBarry Smith M*/
25530de9b25SBarry Smith #define PETSC_VIEWER_DRAW_SELF    PETSC_VIEWER_DRAW_(PETSC_COMM_SELF)
25630de9b25SBarry Smith 
25730de9b25SBarry Smith /*MC
25830de9b25SBarry Smith   PETSC_VIEWER_SOCKET_WORLD  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
25930de9b25SBarry Smith 
26030de9b25SBarry Smith   Level: intermediate
26130de9b25SBarry Smith M*/
262b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_WORLD PETSC_VIEWER_SOCKET_(PETSC_COMM_WORLD)
26330de9b25SBarry Smith 
26430de9b25SBarry Smith /*MC
26530de9b25SBarry Smith   PETSC_VIEWER_SOCKET_SELF  - same as PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
26630de9b25SBarry Smith 
26730de9b25SBarry Smith   Level: intermediate
26830de9b25SBarry Smith M*/
269b0a32e0cSBarry Smith #define PETSC_VIEWER_SOCKET_SELF  PETSC_VIEWER_SOCKET_(PETSC_COMM_SELF)
27030de9b25SBarry Smith 
27130de9b25SBarry Smith /*MC
27230de9b25SBarry Smith   PETSC_VIEWER_BINARY_WORLD  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
27330de9b25SBarry Smith 
27430de9b25SBarry Smith   Level: intermediate
27530de9b25SBarry Smith M*/
276b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_WORLD PETSC_VIEWER_BINARY_(PETSC_COMM_WORLD)
27730de9b25SBarry Smith 
27830de9b25SBarry Smith /*MC
27930de9b25SBarry Smith   PETSC_VIEWER_BINARY_SELF  - same as PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
28030de9b25SBarry Smith 
28130de9b25SBarry Smith   Level: intermediate
28230de9b25SBarry Smith M*/
283b0a32e0cSBarry Smith #define PETSC_VIEWER_BINARY_SELF  PETSC_VIEWER_BINARY_(PETSC_COMM_SELF)
28430de9b25SBarry Smith 
285cbb32127SBarry Smith /*MC
286cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_WORLD  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
287cbb32127SBarry Smith 
288cbb32127SBarry Smith   Level: intermediate
289cbb32127SBarry Smith M*/
290cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_WORLD PETSC_VIEWER_MATLAB_(PETSC_COMM_WORLD)
291cbb32127SBarry Smith 
292cbb32127SBarry Smith /*MC
293cbb32127SBarry Smith   PETSC_VIEWER_MATLAB_SELF  - same as PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
294cbb32127SBarry Smith 
295cbb32127SBarry Smith   Level: intermediate
296cbb32127SBarry Smith M*/
297cbb32127SBarry Smith #define PETSC_VIEWER_MATLAB_SELF  PETSC_VIEWER_MATLAB_(PETSC_COMM_SELF)
298cbb32127SBarry Smith 
2997eb62a3eSMatthew Knepley #define PETSC_VIEWER_MATHEMATICA_WORLD (PetscViewerInitializeMathematicaWorld_Private(),PETSC_VIEWER_MATHEMATICA_WORLD_PRIVATE)
30065ef3172SBarry Smith 
3014a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStart(PetscViewer,PetscInt*,PetscInt*);
3024a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepMaster(PetscViewer,PetscInt,PetscInt*,PetscInt);
3034a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndMaster(PetscViewer,PetscInt*);
3044a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlStepWorker(PetscViewer,PetscMPIInt,PetscInt*);
3054a5f5e6cSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerFlowControlEndWorker(PetscViewer,PetscInt*);
306e03d165dSBarry Smith 
30777ed5343SBarry Smith /*
308a5057860SBarry Smith    PetscViewer writes to MATLAB .mat file
309cbb32127SBarry Smith */
310014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutArray(PetscViewer,int,int,const PetscScalar*,const char*);
311014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabGetArray(PetscViewer,int,int,PetscScalar*,const char*);
312014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewerMatlabPutVariable(PetscViewer,const char*,void*);
313cbb32127SBarry Smith 
314e04113cfSBarry Smith #if defined(PETSC_HAVE_SAWS)
315e04113cfSBarry Smith PETSC_EXTERN PetscErrorCode PetscObjectViewSAWs(PetscObject,PetscViewer);
316bfb97211SBarry Smith #endif
317bfb97211SBarry Smith 
318b9617806SBarry Smith /*S
3191890ba74SBarry Smith      PetscViewers - Abstract collection of PetscViewers. It is just an expandable array of viewers.
320b9617806SBarry Smith 
321b9617806SBarry Smith    Level: intermediate
322b9617806SBarry Smith 
323b9617806SBarry Smith   Concepts: viewing
324b9617806SBarry Smith 
325b9617806SBarry Smith .seealso:  PetscViewerCreate(), PetscViewerSetType(), PetscViewerType, PetscViewer, PetscViewersCreate(),
326b9617806SBarry Smith            PetscViewersGetViewer()
327b9617806SBarry Smith S*/
32895fbd943SSatish Balay typedef struct _n_PetscViewers* PetscViewers;
329014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersCreate(MPI_Comm,PetscViewers*);
330014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersDestroy(PetscViewers*);
331014dd563SJed Brown PETSC_EXTERN PetscErrorCode PetscViewersGetViewer(PetscViewers,PetscInt,PetscViewer*);
332d132466eSBarry Smith 
333cb5b572fSBarry Smith #endif
334