Actual source code: dlregispetsc.c

 2:  #include petsc.h
 3:  #include petscdraw.h
 4:  #include petscsys.h

  8: /*@C
  9:   PetscInitializePackage - This function initializes everything in the main Petsc package. It is called
 10:   from PetscDLLibraryRegister() when using dynamic libraries, and on the call to PetscInitialize()
 11:   when using static libraries.

 13:   Input Parameter:
 14:   path - The dynamic library path, or PETSC_NULL

 16:   Level: developer

 18: .keywords: Petsc, initialize, package
 19: .seealso: PetscInitialize()
 20: @*/
 21: PetscErrorCode PetscInitializePackage(char *path)
 22: {
 23:   static PetscTruth initialized = PETSC_FALSE;
 24:   char              logList[256];
 25:   char             *className;
 26:   PetscTruth        opt;

 30:   if (initialized == PETSC_TRUE) return(0);
 31:   initialized = PETSC_TRUE;
 32:   /* Register Classes */
 33:   PetscLogClassRegister(&PETSC_VIEWER_COOKIE, "Viewer");
 34:   PetscLogClassRegister(&PETSC_DRAW_COOKIE,   "Draw");
 35:   PetscLogClassRegister(&DRAWAXIS_COOKIE,     "Axis");
 36:   PetscLogClassRegister(&DRAWLG_COOKIE,       "Line Graph");
 37:   PetscLogClassRegister(&DRAWHG_COOKIE,       "Histogram");
 38:   PetscLogClassRegister(&DRAWSP_COOKIE,       "Scatter Plot");
 39:   PetscLogClassRegister(&PETSC_RANDOM_COOKIE, "Random Number Generator");
 40:   /* Register Constructors */
 41:   PetscDrawRegisterAll(path);
 42:   PetscViewerRegisterAll(path);
 43:   /* Register Events */
 44:   PetscLogEventRegister(&PETSC_Barrier, "PetscBarrier", PETSC_COOKIE);
 45:   /* Process info exclusions */
 46:   PetscOptionsGetString(PETSC_NULL, "-log_info_exclude", logList, 256, &opt);
 47:   if (opt == PETSC_TRUE) {
 48:     PetscStrstr(logList, "null", &className);
 49:     if (className) {
 50:       PetscLogInfoDeactivateClass(0);
 51:     }
 52:   }
 53:   /* Process summary exclusions */
 54:   PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
 55:   if (opt == PETSC_TRUE) {
 56:     PetscStrstr(logList, "null", &className);
 57:     if (className) {
 58:       PetscLogEventDeactivateClass(0);
 59:     }
 60:   }
 61:   /* Setup auxiliary packages */
 62: #if defined(PETSC_HAVE_MATHEMATICA)
 63:   PetscViewerMathematicaInitializePackage(PETSC_NULL);
 64: #endif
 65:   PetscPLAPACKInitializePackage(PETSC_NULL);
 66:   return(0);
 67: }

 72: /*
 73:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

 75:   This one registers all the draw and PetscViewer objects.

 77:   Input Parameter:
 78:   path - library path
 79:  */
 80: PetscErrorCode PetscDLLibraryRegister(char *path)
 81: {

 84:   PetscInitializeNoArguments(); if (ierr) return 1;
 86:   /*
 87:       If we got here then PETSc was properly loaded
 88:   */
 89:   PetscInitializePackage(path);
 90:   return(0);
 91: }

 94: /* --------------------------------------------------------------------------*/
 95: static const char *contents = "PETSc Graphics and PetscViewer libraries. \n\
 96:      ASCII, Binary, Sockets, X-windows, ...\n";
 97: static const char *authors  = PETSC_AUTHOR_INFO;

 99:  #include src/sys/src/utils/dlregis.h