Actual source code: dlregisdm.c

  1: #define PETSCDM_DLL


 4:  #include src/dm/ao/aoimpl.h
 5:  #include src/dm/da/daimpl.h
  6: #ifdef PETSC_HAVE_SIEVE
 7:  #include private/meshimpl.h
  8: #endif

 12: /*@C
 13:   DMFinalizePackage - This function finalizes everything in the DM package. It is called
 14:   from PetscFinalize().

 16:   Level: developer

 18: .keywords: AO, DA, initialize, package
 19: .seealso: PetscInitialize()
 20: @*/
 21: PetscErrorCode  DMFinalizePackage() {
 22: #ifdef PETSC_HAVE_SIEVE
 24: #endif

 27: #ifdef PETSC_HAVE_SIEVE
 28:   MeshFinalize();
 29: #endif
 30:   return(0);
 31: }

 35: /*@C
 36:   DMInitializePackage - This function initializes everything in the DM package. It is called
 37:   from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to AOCreate()
 38:   or DACreate() when using static libraries.

 40:   Input Parameter:
 41:   path - The dynamic library path, or PETSC_NULL

 43:   Level: developer

 45: .keywords: AO, DA, initialize, package
 46: .seealso: PetscInitialize()
 47: @*/
 48: PetscErrorCode  DMInitializePackage(const char path[])
 49: {
 50:   static PetscTruth initialized = PETSC_FALSE;
 51:   char              logList[256];
 52:   char             *className;
 53:   PetscTruth        opt;

 57:   if (initialized) return(0);
 58:   initialized = PETSC_TRUE;
 59:   /* Register Classes */
 60:   PetscLogClassRegister(&AO_COOKIE,     "Application Order");
 61:   PetscLogClassRegister(&DA_COOKIE,     "Distributed array");
 62:   PetscLogClassRegister(&ADDA_COOKIE,   "Arbitrary Dimension Distributed array");
 63: #ifdef PETSC_HAVE_SIEVE
 64:   PetscLogClassRegister(&MESH_COOKIE,       "Mesh");
 65:   PetscLogClassRegister(&SECTIONREAL_COOKIE,"SectionReal");
 66:   PetscLogClassRegister(&SECTIONINT_COOKIE, "SectionInt");
 67: #endif
 68:   /* Register Constructors */
 69: #ifdef PETSC_HAVE_SIEVE
 70:   MeshRegisterAll(path);
 71: #endif
 72:   /* Register Events */
 78: #ifdef PETSC_HAVE_SIEVE
 88: #endif
 89:   /* Process info exclusions */
 90:   PetscOptionsGetString(PETSC_NULL, "-info_exclude", logList, 256, &opt);
 91:   if (opt) {
 92:     PetscStrstr(logList, "ao", &className);
 93:     if (className) {
 94:       PetscInfoDeactivateClass(AO_COOKIE);
 95:     }
 96:     PetscStrstr(logList, "da", &className);
 97:     if (className) {
 98:       PetscInfoDeactivateClass(DA_COOKIE);
 99:     }
100: #ifdef PETSC_HAVE_SIEVE
101:     PetscStrstr(logList, "mesh", &className);
102:     if (className) {
103:       PetscInfoDeactivateClass(MESH_COOKIE);
104:     }
105:     PetscStrstr(logList, "sectionreal", &className);
106:     if (className) {
107:       PetscInfoDeactivateClass(SECTIONREAL_COOKIE);
108:     }
109:     PetscStrstr(logList, "sectionint", &className);
110:     if (className) {
111:       PetscInfoDeactivateClass(SECTIONINT_COOKIE);
112:     }
113: #endif
114:   }
115:   /* Process summary exclusions */
116:   PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
117:   if (opt) {
118:     PetscStrstr(logList, "ao", &className);
119:     if (className) {
121:     }
122:     PetscStrstr(logList, "da", &className);
123:     if (className) {
125:     }
126: #ifdef PETSC_HAVE_SIEVE
127:     PetscStrstr(logList, "mesh", &className);
128:     if (className) {
130:     }
131:     PetscStrstr(logList, "sectionreal", &className);
132:     if (className) {
134:     }
135:     PetscStrstr(logList, "sectionint", &className);
136:     if (className) {
138:     }
139: #endif
140:   }
141:   PetscRegisterFinalize(DMFinalizePackage);
142:   return(0);
143: }



147: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
151: /*
152:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

154:   This one registers all the mesh generators and partitioners that are in
155:   the basic DM library.

157:   Input Parameter:
158:   path - library path
159: */
160: PetscErrorCode  PetscDLLibraryRegister_petscdm(const char path[])
161: {

164:   PetscInitializeNoArguments();
165:   if (ierr) return(1);

167:   /*
168:       If we got here then PETSc was properly loaded
169:   */
170:   DMInitializePackage(path);
171:   return(0);
172: }

175: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */