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: DMInitializePackage - This function initializes everything in the DM package. It is called
14: from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to AOCreate()
15: or DACreate() when using static libraries.
17: Input Parameter:
18: path - The dynamic library path, or PETSC_NULL
20: Level: developer
22: .keywords: AO, DA, initialize, package
23: .seealso: PetscInitialize()
24: @*/
25: PetscErrorCode DMInitializePackage(const char path[]) {
26: static PetscTruth initialized = PETSC_FALSE;
27: char logList[256];
28: char *className;
29: PetscTruth opt;
33: if (initialized) return(0);
34: initialized = PETSC_TRUE;
35: /* Register Classes */
36: PetscLogClassRegister(&AO_COOKIE, "Application Order");
37: PetscLogClassRegister(&DA_COOKIE, "Distributed array");
38: #ifdef PETSC_HAVE_SIEVE
39: PetscLogClassRegister(&MESH_COOKIE, "Mesh");
40: PetscLogClassRegister(&SECTIONREAL_COOKIE,"SectionReal");
41: PetscLogClassRegister(&SECTIONINT_COOKIE, "SectionInt");
42: #endif
43: /* Register Constructors */
44: #ifdef PETSC_HAVE_SIEVE
45: MeshRegisterAll(path);
46: #endif
47: /* Register Events */
53: #ifdef PETSC_HAVE_SIEVE
63: #endif
64: /* Process info exclusions */
65: PetscOptionsGetString(PETSC_NULL, "-info_exclude", logList, 256, &opt);
66: if (opt) {
67: PetscStrstr(logList, "ao", &className);
68: if (className) {
69: PetscInfoDeactivateClass(AO_COOKIE);
70: }
71: PetscStrstr(logList, "da", &className);
72: if (className) {
73: PetscInfoDeactivateClass(DA_COOKIE);
74: }
75: #ifdef PETSC_HAVE_SIEVE
76: PetscStrstr(logList, "mesh", &className);
77: if (className) {
78: PetscInfoDeactivateClass(MESH_COOKIE);
79: }
80: PetscStrstr(logList, "sectionreal", &className);
81: if (className) {
82: PetscInfoDeactivateClass(SECTIONREAL_COOKIE);
83: }
84: PetscStrstr(logList, "sectionint", &className);
85: if (className) {
86: PetscInfoDeactivateClass(SECTIONINT_COOKIE);
87: }
88: #endif
89: }
90: /* Process summary exclusions */
91: PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
92: if (opt) {
93: PetscStrstr(logList, "ao", &className);
94: if (className) {
96: }
97: PetscStrstr(logList, "da", &className);
98: if (className) {
100: }
101: #ifdef PETSC_HAVE_SIEVE
102: PetscStrstr(logList, "mesh", &className);
103: if (className) {
105: }
106: PetscStrstr(logList, "sectionreal", &className);
107: if (className) {
109: }
110: PetscStrstr(logList, "sectionint", &className);
111: if (className) {
113: }
114: #endif
115: }
116: return(0);
117: }
119: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
123: /*@C
124: DMFinalizePackage - This function finalizes everything in the DM package. It is called
125: from PetscFinalize().
127: Level: developer
129: .keywords: AO, DA, initialize, package
130: .seealso: PetscInitialize()
131: @*/
132: PetscErrorCode DMFinalizePackage() {
133: #ifdef PETSC_HAVE_SIEVE
135: #endif
138: #ifdef PETSC_HAVE_SIEVE
139: MeshFinalize();
140: #endif
141: return(0);
142: }
146: /*
147: PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.
149: This one registers all the mesh generators and partitioners that are in
150: the basic DM library.
152: Input Parameter:
153: path - library path
154: */
155: PetscErrorCode PetscDLLibraryRegister_petscdm(const char path[])
156: {
159: PetscInitializeNoArguments();
160: if (ierr) return(1);
162: /*
163: If we got here then PETSc was properly loaded
164: */
165: DMInitializePackage(path);
166: return(0);
167: }
170: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */