Actual source code: dlregis.c

  1: #ifdef PETSC_RCS_HEADER
  2: static char vcid[] = "$Id: dlregis.c,v 1.1 2000/01/10 03:54:20 knepley Exp $";
  3: #endif

 5:  #include gvec.h

  7: #undef __FUNCT__  
  9: /*@C
 10:   GridInitializePackage - This function initializes everything in the Grid package. It is called
 11:   from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to GridCreate()
 12:   when using static libraries.

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

 17:   Level: developer

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

 30:   if (initialized == PETSC_TRUE) return(0);
 31:   initialized = PETSC_TRUE;
 32:   /* Register Classes */
 33:   PetscLogClassRegister(&DISCRETIZATION_COOKIE, "Discretization");
 34:   PetscLogClassRegister(&GRID_COOKIE,           "Grid");
 35:   PetscLogClassRegister(&ELEMENT_VEC_COOKIE,    "Element Vector");
 36:   PetscLogClassRegister(&ELEMENT_MAT_COOKIE,    "Element Matrix");
 37:   PetscLogClassRegister(&VAR_ORDER_COOKIE,      "VariableOrdering");
 38:   PetscLogClassRegister(&CLASS_MAP_COOKIE,      "Field Class Map");
 39:   /* Register Constructors and Serializers */
 40:   GridRegisterAll(path);
 41:   GridSerializeRegisterAll(path);
 42:   FieldClassMapRegisterAll(path);
 43:   FieldClassMapSerializeRegisterAll(path);
 44:   DiscretizationRegisterAll(path);
 45:   DiscretizationSerializeRegisterAll(path);
 46:   /* Register Events */
 47:   PetscLogEventRegister(&GRID_Reform,                        "GridReform",       GRID_COOKIE);
 48:   PetscLogEventRegister(&GRID_SetUp,                         "GridSetUp",        GRID_COOKIE);
 49:   PetscLogEventRegister(&GVEC_EvaluateFunction,              "GVecEvalFunc",     VEC_COOKIE);
 50:   PetscLogEventRegister(&GVEC_EvaluateFunctionCollective,    "GVecEvalFuncColl", VEC_COOKIE);
 51:   PetscLogEventRegister(&GVEC_EvaluateRhs,                   "GVecEvaluateRhs",  VEC_COOKIE);
 52:   PetscLogEventRegister(&GVEC_EvaluateJacobian,              "GVecEvaluateJac",  VEC_COOKIE);
 53:   PetscLogEventRegister(&GVEC_SetBoundary,                   "GVecSetBoundary",  VEC_COOKIE);
 54:   PetscLogEventRegister(&GVEC_InterpolateField,              "GVecInterpolate",  VEC_COOKIE);
 55:   PetscLogEventRegister(&GVEC_InterpolateFieldBatch,         "GVecInterpBatch",  VEC_COOKIE);
 56:   PetscLogEventRegister(&GVEC_InterpolateFieldBatchParallel, "GVecInterpBatchP", VEC_COOKIE);
 57:   PetscLogEventRegister(&GVEC_InterpolateFieldBatchCalc,     "GVecInterpBatchC", VEC_COOKIE);
 58:   PetscLogEventRegister(&GMAT_CreateRectangular,             "GMatCreateRect",   MAT_COOKIE);
 59:   PetscLogEventRegister(&GMAT_EvaluateOperatorGalerkin,      "GMatEvalOpGaler",  MAT_COOKIE);
 60:   PetscLogEventRegister(&GMAT_EvaluateSystemMatrix,          "GMatEvalSysMat",   MAT_COOKIE);
 61:   PetscLogEventRegister(&GMAT_SetBoundary,                   "GMatSetBoundary",  MAT_COOKIE);
 62:   PetscLogEventRegister(&GMAT_MatMultConstrained,            "GMatMultConstr",   MAT_COOKIE);
 63:   PetscLogEventRegister(&GMAT_MatMultTransposeConstrained,   "GMatMultTRConstr", MAT_COOKIE);
 64:   /* Process info exclusions */
 65:   PetscOptionsGetString(PETSC_NULL, "-log_info_exclude", logList, 256, &opt);
 66:   if (opt == PETSC_TRUE) {
 67:     PetscStrstr(logList, "grid", &className);
 68:     if (className) {
 69:       PetscLogInfoDeactivateClass(GRID_COOKIE);
 70:     }
 71:   }
 72:   /* Process summary exclusions */
 73:   PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
 74:   if (opt == PETSC_TRUE) {
 75:     PetscStrstr(logList, "grid", &className);
 76:     if (className) {
 77:       PetscLogEventDeactivateClass(GRID_COOKIE);
 78:     }
 79:   }
 80:   return(0);
 81: }

 83: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
 84: EXTERN_C_BEGIN
 85: #undef __FUNCT__  
 87: /*
 88:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

 90:   This one registers all the grid vectors and matrices that are in the basic Grid library.

 92:   Input Parameter:
 93:   path - library path
 94: */
 95: int PetscDLLibraryRegister(char *path) {

 98:   PetscInitializeNoArguments();
 99:   if (ierr) return(1);
100:   /*
101:       If we got here then PETSc was properly loaded
102:   */
103:   GridInitializePackage(path);
104:   return(0);
105: }
106: EXTERN_C_END

108: /* --------------------------------------------------------------------------*/
109: static char *contents = "PETSc Grid libraryn";

111: static char *authors = "Matt Knepley    knepley@cs.purdue.edun
112:   http://www.cs.purdue.edu/homes/knepley/comp_fluidn";

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

116: /* --------------------------------------------------------------------------*/

118: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */