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 mesh.h
7: #undef __FUNCT__
9: /*@C
10: MeshInitializePackage - This function initializes everything in the Mesh package. It is called
11: from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to MeshCreate()
12: when using static libraries.
14: Input Parameter:
15: path - The dynamic library path, or PETSC_NULL
17: Level: developer
19: .keywords: Mesh, initialize, package
20: .seealso: PetscInitialize()
21: @*/
22: int MeshInitializePackage(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(&MESH_COOKIE, "Mesh");
34: PetscLogClassRegister(&PARTITION_COOKIE, "Partition");
35: /* Register Constructors and Serializers */
36: MeshRegisterAll(path);
37: MeshSerializeRegisterAll(path);
38: MeshOrderingRegisterAll(path);
39: PartitionRegisterAll(path);
40: PartitionSerializeRegisterAll(path);
41: /* Register Events */
42: PetscLogEventRegister(&MESH_Reform, "MeshReform", MESH_COOKIE);
43: PetscLogEventRegister(&MESH_IsDistorted, "MeshIsDistorted", MESH_COOKIE);
44: PetscLogEventRegister(&MESH_Partition, "MeshPartition", MESH_COOKIE);
45: PetscLogEventRegister(&MESH_SetupBoundary, "MeshSetupBd", MESH_COOKIE);
46: PetscLogEventRegister(&MESH_MoveMesh, "MeshMoveMesh", MESH_COOKIE);
47: PetscLogEventRegister(&MESH_CalcNodeVelocities, "MeshCalcNodeVel", MESH_COOKIE);
48: PetscLogEventRegister(&MESH_CalcNodeAccelerations, "MeshCalcNodeAccl", MESH_COOKIE);
49: PetscLogEventRegister(&MESH_CreateLocalCSR, "MeshCreateLocCSR", MESH_COOKIE);
50: PetscLogEventRegister(&MESH_CreateFullCSR, "MeshCreateFulCSR", MESH_COOKIE);
51: PetscLogEventRegister(&MESH_CreateDualCSR, "MeshCreateDulCSR", MESH_COOKIE);
52: PetscLogEventRegister(&MESH_LocatePoint, "MeshLocatePoint", MESH_COOKIE);
53: /* Process info exclusions */
54: PetscOptionsGetString(PETSC_NULL, "-log_info_exclude", logList, 256, &opt);
55: if (opt == PETSC_TRUE) {
56: PetscStrstr(logList, "mesh", &className);
57: if (className) {
58: PetscLogInfoDeactivateClass(MESH_COOKIE);
59: }
60: PetscStrstr(logList, "partition", &className);
61: if (className) {
62: PetscLogInfoDeactivateClass(PARTITION_COOKIE);
63: }
64: }
65: /* Process summary exclusions */
66: PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
67: if (opt == PETSC_TRUE) {
68: PetscStrstr(logList, "mesh", &className);
69: if (className) {
70: PetscLogEventDeactivateClass(MESH_COOKIE);
71: }
72: PetscStrstr(logList, "partition", &className);
73: if (className) {
74: PetscLogEventDeactivateClass(PARTITION_COOKIE);
75: }
76: }
77: return(0);
78: }
80: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
81: EXTERN_C_BEGIN
82: #undef __FUNCT__
84: /*
85: DLLibraryRegister - This function is called when the dynamic library it is in is opened.
87: This one registers all the mesh generators and partitioners that are in
88: the basic Mesh library.
90: Input Parameter:
91: path - library path
92: */
93: int PetscDLLibraryRegister(char *path) {
96: PetscInitializeNoArguments();
97: if (ierr) return(1);
98: /*
99: If we got here then PETSc was properly loaded
100: */
101: MeshInitializePackage(path);
102: return(0);
103: }
104: EXTERN_C_END
106: /* --------------------------------------------------------------------------*/
107: static char *contents = "PETSc Mesh libraryn";
108: static char *authors = "Matt Knepley knepley@cs.purdue.edun
109: http://www.cs.purdue.edu/homes/knepley/comp_fluidn";
111: #include src/sys/src/utils/dlregis.h
113: /* --------------------------------------------------------------------------*/
115: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */