Actual source code: dlregispetsc.c
1: #define PETSC_DLL
3: #include petsc.h
4: #include petscdraw.h
5: #include petscsys.h
11: /*@C
12: PetscInitializePackage - This function initializes everything in the main Petsc package. It is called
13: from PetscDLLibraryRegister() when using dynamic libraries, and on the call to PetscInitialize()
14: when using static libraries.
16: Input Parameter:
17: path - The dynamic library path, or PETSC_NULL
19: Level: developer
21: .keywords: Petsc, initialize, package
22: .seealso: PetscInitialize()
23: @*/
24: PetscErrorCode PetscInitializePackage(const char path[])
25: {
26: static PetscTruth initialized = PETSC_FALSE;
27: char logList[256];
28: char *className;
29: PetscTruth opt;
30: PetscErrorCode ierr;
33: if (initialized) return(0);
34: initialized = PETSC_TRUE;
35: /* Register Classes */
36: PetscLogClassRegister(&PETSC_OBJECT_COOKIE, "Object");
38: /* Register Events */
40: /* Process info exclusions */
41: PetscOptionsGetString(PETSC_NULL, "-info_exclude", logList, 256, &opt);
42: if (opt) {
43: PetscStrstr(logList, "null", &className);
44: if (className) {
45: PetscInfoDeactivateClass(0);
46: }
47: }
48: /* Process summary exclusions */
49: PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
50: if (opt) {
51: PetscStrstr(logList, "null", &className);
52: if (className) {
54: }
55: }
56: /* Setup auxiliary packages */
57: #if defined(PETSC_HAVE_MATHEMATICA)
58: PetscViewerMathematicaInitializePackage(PETSC_NULL);
59: #endif
60: return(0);
61: }
66: /*
67: PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.
69: This one registers all the draw and PetscViewer objects.
71: Input Parameter:
72: path - library path
73: */
74: PetscErrorCode PetscDLLibraryRegister_petsc(const char path[])
75: {
78: PetscInitializeNoArguments(); if (ierr) return 1;
80: /*
81: If we got here then PETSc was properly loaded
82: */
83: PetscInitializePackage(path);
84: PetscDrawInitializePackage(path);
85: PetscViewerInitializePackage(path);
86: PetscRandomInitializePackage(path);
87: return(0);
88: }