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: static PetscTruth initialized = PETSC_FALSE;
50: char logList[256];
51: char *className;
52: PetscTruth opt;
56: if (initialized) return(0);
57: initialized = PETSC_TRUE;
58: /* Register Classes */
59: PetscLogClassRegister(&AO_COOKIE, "Application Order");
60: PetscLogClassRegister(&DA_COOKIE, "Distributed array");
61: PetscLogClassRegister(&ADDA_COOKIE, "Arbitrary Dimension Distributed array");
62: #ifdef PETSC_HAVE_SIEVE
63: PetscLogClassRegister(&MESH_COOKIE, "Mesh");
64: PetscLogClassRegister(&SECTIONREAL_COOKIE,"SectionReal");
65: PetscLogClassRegister(&SECTIONINT_COOKIE, "SectionInt");
66: #endif
67: /* Register Constructors */
68: #ifdef PETSC_HAVE_SIEVE
69: MeshRegisterAll(path);
70: #endif
71: /* Register Events */
77: #ifdef PETSC_HAVE_SIEVE
87: #endif
88: /* Process info exclusions */
89: PetscOptionsGetString(PETSC_NULL, "-info_exclude", logList, 256, &opt);
90: if (opt) {
91: PetscStrstr(logList, "ao", &className);
92: if (className) {
93: PetscInfoDeactivateClass(AO_COOKIE);
94: }
95: PetscStrstr(logList, "da", &className);
96: if (className) {
97: PetscInfoDeactivateClass(DA_COOKIE);
98: }
99: #ifdef PETSC_HAVE_SIEVE
100: PetscStrstr(logList, "mesh", &className);
101: if (className) {
102: PetscInfoDeactivateClass(MESH_COOKIE);
103: }
104: PetscStrstr(logList, "sectionreal", &className);
105: if (className) {
106: PetscInfoDeactivateClass(SECTIONREAL_COOKIE);
107: }
108: PetscStrstr(logList, "sectionint", &className);
109: if (className) {
110: PetscInfoDeactivateClass(SECTIONINT_COOKIE);
111: }
112: #endif
113: }
114: /* Process summary exclusions */
115: PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
116: if (opt) {
117: PetscStrstr(logList, "ao", &className);
118: if (className) {
120: }
121: PetscStrstr(logList, "da", &className);
122: if (className) {
124: }
125: #ifdef PETSC_HAVE_SIEVE
126: PetscStrstr(logList, "mesh", &className);
127: if (className) {
129: }
130: PetscStrstr(logList, "sectionreal", &className);
131: if (className) {
133: }
134: PetscStrstr(logList, "sectionint", &className);
135: if (className) {
137: }
138: #endif
139: }
140: PetscRegisterFinalize(DMFinalizePackage);
141: return(0);
142: }
146: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
150: /*
151: PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.
153: This one registers all the mesh generators and partitioners that are in
154: the basic DM library.
156: Input Parameter:
157: path - library path
158: */
159: PetscErrorCode PetscDLLibraryRegister_petscdm(const char path[])
160: {
163: PetscInitializeNoArguments();
164: if (ierr) return(1);
166: /*
167: If we got here then PETSc was properly loaded
168: */
169: DMInitializePackage(path);
170: return(0);
171: }
174: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */