Actual source code: viewregall.c

      1: #include <petsc/private/viewerimpl.h>

      3: PETSC_EXTERN PetscErrorCode PetscViewerCreate_Socket(PetscViewer);
      4: PETSC_EXTERN PetscErrorCode PetscViewerCreate_ASCII(PetscViewer);
      5: PETSC_EXTERN PetscErrorCode PetscViewerCreate_Binary(PetscViewer);
      6: PETSC_EXTERN PetscErrorCode PetscViewerCreate_String(PetscViewer);
      7: PETSC_EXTERN PetscErrorCode PetscViewerCreate_Draw(PetscViewer);
      8: PETSC_EXTERN PetscErrorCode PetscViewerCreate_VU(PetscViewer);
      9: PETSC_EXTERN PetscErrorCode PetscViewerCreate_Mathematica(PetscViewer);
     10: PETSC_EXTERN PetscErrorCode PetscViewerCreate_HDF5(PetscViewer);
     11: PETSC_EXTERN PetscErrorCode PetscViewerCreate_Matlab(PetscViewer);
     12: PETSC_EXTERN PetscErrorCode PetscViewerCreate_SAWs(PetscViewer);
     13: PETSC_EXTERN PetscErrorCode PetscViewerCreate_VTK(PetscViewer);
     14: PETSC_EXTERN PetscErrorCode PetscViewerCreate_GLVis(PetscViewer);
     15: PETSC_EXTERN PetscErrorCode PetscViewerCreate_ADIOS(PetscViewer);
     16: PETSC_EXTERN PetscErrorCode PetscViewerCreate_ExodusII(PetscViewer);
     17: PETSC_EXTERN PetscErrorCode PetscViewerCreate_CGNS(PetscViewer);
     18: PETSC_EXTERN PetscErrorCode PetscViewerCreate_PyVista(PetscViewer);

     20: PetscBool PetscViewerRegisterAllCalled;

     22: /*@C
     23:   PetscViewerRegisterAll - Registers all of the viewer types (`PetscViewerType`) in the `PetscViewer` package.

     25:   Not Collective

     27:   Level: developer

     29: .seealso: [](sec_viewers), `PetscViewer`
     30: @*/
     31: PetscErrorCode PetscViewerRegisterAll(void)
     32: {
     33:   PetscFunctionBegin;
     34:   if (PetscViewerRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
     35:   PetscViewerRegisterAllCalled = PETSC_TRUE;

     37:   PetscCall(PetscViewerRegister(PETSCVIEWERASCII, PetscViewerCreate_ASCII));
     38:   PetscCall(PetscViewerRegister(PETSCVIEWERBINARY, PetscViewerCreate_Binary));
     39:   PetscCall(PetscViewerRegister(PETSCVIEWERSTRING, PetscViewerCreate_String));
     40:   PetscCall(PetscViewerRegister(PETSCVIEWERDRAW, PetscViewerCreate_Draw));
     41: #if defined(PETSC_USE_SOCKET_VIEWER)
     42:   PetscCall(PetscViewerRegister(PETSCVIEWERSOCKET, PetscViewerCreate_Socket));
     43: #endif
     44: #if defined(PETSC_HAVE_MATHEMATICA)
     45:   PetscCall(PetscViewerRegister(PETSCVIEWERMATHEMATICA, PetscViewerCreate_Mathematica));
     46: #endif
     47:   PetscCall(PetscViewerRegister(PETSCVIEWERVU, PetscViewerCreate_VU));
     48: #if defined(PETSC_HAVE_HDF5)
     49:   PetscCall(PetscViewerRegister(PETSCVIEWERHDF5, PetscViewerCreate_HDF5));
     50: #endif
     51: #if defined(PETSC_HAVE_MATLAB)
     52:   PetscCall(PetscViewerRegister(PETSCVIEWERMATLAB, PetscViewerCreate_Matlab));
     53: #endif
     54: #if defined(PETSC_HAVE_SAWS)
     55:   PetscCall(PetscViewerRegister(PETSCVIEWERSAWS, PetscViewerCreate_SAWs));
     56: #endif
     57:   PetscCall(PetscViewerRegister(PETSCVIEWERVTK, PetscViewerCreate_VTK));
     58:   PetscCall(PetscViewerRegister(PETSCVIEWERGLVIS, PetscViewerCreate_GLVis));
     59: #if defined(PETSC_HAVE_ADIOS)
     60:   PetscCall(PetscViewerRegister(PETSCVIEWERADIOS, PetscViewerCreate_ADIOS));
     61: #endif
     62: #if defined(PETSC_HAVE_EXODUSII)
     63:   PetscCall(PetscViewerRegister(PETSCVIEWEREXODUSII, PetscViewerCreate_ExodusII));
     64: #endif
     65: #if defined(PETSC_HAVE_CGNS)
     66:   PetscCall(PetscViewerRegister(PETSCVIEWERCGNS, PetscViewerCreate_CGNS));
     67: #endif
     68:   PetscCall(PetscViewerRegister(PETSCVIEWERPYVISTA, PetscViewerCreate_PyVista));
     69:   PetscFunctionReturn(PETSC_SUCCESS);
     70: }