Actual source code: viewerimpl.h

      2: #ifndef _VIEWERIMPL
      3: #define _VIEWERIMPL

      5: #include <petsc/private/petscimpl.h>
      6: #include <petscviewer.h>

      8: PETSC_EXTERN PetscBool      PetscViewerRegisterAllCalled;
      9: PETSC_EXTERN PetscErrorCode PetscViewerRegisterAll(void);

     11: struct _PetscViewerOps {
     12:    PetscErrorCode (*destroy)(PetscViewer);
     13:    PetscErrorCode (*view)(PetscViewer,PetscViewer);
     14:    PetscErrorCode (*flush)(PetscViewer);
     15:    PetscErrorCode (*getsubviewer)(PetscViewer,MPI_Comm,PetscViewer*);
     16:    PetscErrorCode (*restoresubviewer)(PetscViewer,MPI_Comm,PetscViewer*);
     17:    PetscErrorCode (*read)(PetscViewer,void*,PetscInt,PetscInt*,PetscDataType);
     18:    PetscErrorCode (*setfromoptions)(PetscOptionItems*,PetscViewer);
     19:    PetscErrorCode (*setup)(PetscViewer);
     20: };

     22: #define PETSCVIEWERGETVIEWEROFFPUSHESMAX 25

     24: #define PETSCVIEWERFORMATPUSHESMAX 25
     25: /*
     26:    Defines the viewer data structure.
     27: */
     28: struct _p_PetscViewer {
     29:   PETSCHEADER(struct _PetscViewerOps);
     30:   PetscViewerFormat format,formats[PETSCVIEWERFORMATPUSHESMAX];
     31:   int               iformat;   /* number of formats that have been pushed on formats[] stack */
     32:   void              *data;
     33:   PetscBool         setupcalled;
     34: };

     36: PETSC_EXTERN PetscMPIInt Petsc_Viewer_keyval;
     37: PETSC_EXTERN PetscMPIInt Petsc_Viewer_Stdout_keyval;
     38: PETSC_EXTERN PetscMPIInt Petsc_Viewer_Stderr_keyval;
     39: PETSC_EXTERN PetscMPIInt Petsc_Viewer_Binary_keyval;
     40: PETSC_EXTERN PetscMPIInt Petsc_Viewer_Draw_keyval;
     41: #if defined(PETSC_HAVE_HDF5)
     42: PETSC_EXTERN PetscMPIInt Petsc_Viewer_HDF5_keyval;
     43: #endif
     44: #if defined(PETSC_USE_SOCKETVIEWER)
     45: PETSC_EXTERN PetscMPIInt Petsc_Viewer_Socket_keyval;
     46: #endif

     48: #endif