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: struct _p_PetscViewer {
     27:   PETSCHEADER(struct _PetscViewerOps);
     28:   PetscViewerFormat format, formats[PETSCVIEWERFORMATPUSHESMAX];
     29:   int               iformat; /* number of formats that have been pushed on formats[] stack */
     30:   void             *data;
     31:   PetscBool         setupcalled;
     32: };

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