Actual source code: viewerimpl.h
1: #pragma once
3: #include <petsc/private/petscimpl.h>
4: #include <petscviewer.h>
6: PETSC_INTERN PetscBool PetscViewerRegisterAllCalled;
7: PETSC_EXTERN PetscErrorCode PetscViewerRegisterAll(void);
9: struct _PetscViewerOps {
10: PetscErrorCode (*destroy)(PetscViewer);
11: PetscErrorCode (*view)(PetscViewer, PetscViewer);
12: PetscErrorCode (*flush)(PetscViewer);
13: PetscErrorCode (*getsubviewer)(PetscViewer, MPI_Comm, PetscViewer *);
14: PetscErrorCode (*restoresubviewer)(PetscViewer, MPI_Comm, PetscViewer *);
15: PetscErrorCode (*read)(PetscViewer, void *, PetscInt, PetscInt *, PetscDataType);
16: PetscErrorCode (*setfromoptions)(PetscViewer, PetscOptionItems *);
17: PetscErrorCode (*setup)(PetscViewer);
18: };
20: #define PETSCVIEWERCREATEVIEWEROFFPUSHESMAX 25
22: #define PETSCVIEWERFORMATPUSHESMAX 25
23: /*
24: Defines the viewer data structure.
25: */
26: typedef struct _PetscViewerOps *PetscViewerOps;
27: struct _p_PetscViewer {
28: PETSCHEADER(struct _PetscViewerOps);
29: PetscViewerFormat format, formats[PETSCVIEWERFORMATPUSHESMAX];
30: int iformat; /* number of formats that have been pushed on formats[] stack */
31: void *data;
32: PetscBool setupcalled;
33: };
35: PETSC_INTERN PetscMPIInt Petsc_Viewer_keyval;
36: PETSC_INTERN PetscMPIInt Petsc_Viewer_Stdout_keyval;
37: PETSC_INTERN PetscMPIInt Petsc_Viewer_Stderr_keyval;
38: PETSC_INTERN PetscMPIInt Petsc_Viewer_Binary_keyval;
39: PETSC_INTERN PetscMPIInt Petsc_Viewer_Draw_keyval;
40: #if defined(PETSC_HAVE_HDF5)
41: PETSC_INTERN PetscMPIInt Petsc_Viewer_HDF5_keyval;
42: #endif
43: #if defined(PETSC_USE_SOCKETVIEWER)
44: PETSC_INTERN PetscMPIInt Petsc_Viewer_Socket_keyval;
45: #endif