Actual source code: dlregispetsc.c

  1: /*$Id: dlregispetsc.c,v 1.14 2001/03/23 23:20:05 balay Exp $*/

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

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

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

 15:   Level: developer

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

 29:   if (initialized == PETSC_TRUE) return(0);
 30:   initialized = PETSC_TRUE;
 31:   /* Register Classes */
 32:   PetscLogClassRegister(&PETSC_VIEWER_COOKIE, "Viewer");
 33:   PetscLogClassRegister(&PETSC_DRAW_COOKIE,   "Draw");
 34:   PetscLogClassRegister(&DRAWAXIS_COOKIE,     "Axis");
 35:   PetscLogClassRegister(&DRAWLG_COOKIE,       "Line Graph");
 36:   PetscLogClassRegister(&DRAWHG_COOKIE,       "Histogram");
 37:   PetscLogClassRegister(&DRAWSP_COOKIE,       "Scatter Plot");
 38:   PetscLogClassRegister(&PETSC_RANDOM_COOKIE, "Random Number Generator");
 39:   PetscLogClassRegister(&DICT_COOKIE,         "Parameter Dictionary");
 40:   /* Register Constructors and Serializers */
 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:   PetscViewerMathematicaInitializePackage(PETSC_NULL);
 63:   PetscPLAPACKInitializePackage(PETSC_NULL);
 64:   return(0);
 65: }

 67: EXTERN_C_BEGIN
 68: /*
 69:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

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

 73:   Input Parameter:
 74:   path - library path
 75:  */
 76: int PetscDLLibraryRegister(char *path)
 77: {

 80:   PetscInitializeNoArguments(); if (ierr) return 1;
 82:   /*
 83:       If we got here then PETSc was properly loaded
 84:   */
 85:   PetscInitializePackage(path);
 86:   return(0);
 87: }
 88: EXTERN_C_END

 90: /* --------------------------------------------------------------------------*/
 91: static char *contents = "PETSc Graphics and PetscViewer libraries. n
 92:      ASCII, Binary, Sockets, X-windows, ...n";
 93: static char *authors  = PETSC_AUTHOR_INFO;

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