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: /*@C
  8:   MeshInitializePackage - This function initializes everything in the Mesh package. It is called
  9:   from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to MeshCreate()
 10:   when using static libraries.

 12:   Input Parameter:
 13:   path - The dynamic library path, or PETSC_NULL

 15:   Level: developer

 17: .keywords: Mesh, initialize, package
 18: .seealso: PetscInitialize()
 19: @*/
 20: int MeshInitializePackage(char *path) {
 21:   static PetscTruth initialized = PETSC_FALSE;
 22:   char              logList[256];
 23:   char             *className;
 24:   PetscTruth        opt;
 25:   int               ierr;

 28:   if (initialized == PETSC_TRUE) return(0);
 29:   initialized = PETSC_TRUE;
 30:   /* Register Classes */
 31:   PetscLogClassRegister(&MESH_COOKIE,      "Mesh");
 32:   PetscLogClassRegister(&PARTITION_COOKIE, "Partition");
 33:   /* Register Constructors and Serializers */
 34:   MeshRegisterAll(path);
 35:   MeshSerializeRegisterAll(path);
 36:   MeshOrderingRegisterAll(path);
 37:   PartitionRegisterAll(path);
 38:   PartitionSerializeRegisterAll(path);
 39:   /* Register Events */
 40:   PetscLogEventRegister(&MESH_Reform,                "MeshReform",       MESH_COOKIE);
 41:   PetscLogEventRegister(&MESH_IsDistorted,           "MeshIsDistorted",  MESH_COOKIE);
 42:   PetscLogEventRegister(&MESH_Partition,             "MeshPartition",    MESH_COOKIE);
 43:   PetscLogEventRegister(&MESH_SetupBoundary,         "MeshSetupBd",      MESH_COOKIE);
 44:   PetscLogEventRegister(&MESH_MoveMesh,              "MeshMoveMesh",     MESH_COOKIE);
 45:   PetscLogEventRegister(&MESH_CalcNodeVelocities,    "MeshCalcNodeVel",  MESH_COOKIE);
 46:   PetscLogEventRegister(&MESH_CalcNodeAccelerations, "MeshCalcNodeAccl", MESH_COOKIE);
 47:   PetscLogEventRegister(&MESH_CreateLocalCSR,        "MeshCreateLocCSR", MESH_COOKIE);
 48:   PetscLogEventRegister(&MESH_CreateFullCSR,         "MeshCreateFulCSR", MESH_COOKIE);
 49:   PetscLogEventRegister(&MESH_CreateDualCSR,         "MeshCreateDulCSR", MESH_COOKIE);
 50:   PetscLogEventRegister(&MESH_LocatePoint,           "MeshLocatePoint",  MESH_COOKIE);
 51:   /* Process info exclusions */
 52:   PetscOptionsGetString(PETSC_NULL, "-log_info_exclude", logList, 256, &opt);
 53:   if (opt == PETSC_TRUE) {
 54:     PetscStrstr(logList, "mesh", &className);
 55:     if (className) {
 56:       PetscLogInfoDeactivateClass(MESH_COOKIE);
 57:     }
 58:     PetscStrstr(logList, "partition", &className);
 59:     if (className) {
 60:       PetscLogInfoDeactivateClass(PARTITION_COOKIE);
 61:     }
 62:   }
 63:   /* Process summary exclusions */
 64:   PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
 65:   if (opt == PETSC_TRUE) {
 66:     PetscStrstr(logList, "mesh", &className);
 67:     if (className) {
 68:       PetscLogEventDeactivateClass(MESH_COOKIE);
 69:     }
 70:     PetscStrstr(logList, "partition", &className);
 71:     if (className) {
 72:       PetscLogEventDeactivateClass(PARTITION_COOKIE);
 73:     }
 74:   }
 75:   return(0);
 76: }

 78: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
 79: EXTERN_C_BEGIN
 80: /*
 81:   DLLibraryRegister - This function is called when the dynamic library it is in is opened.

 83:   This one registers all the mesh generators and partitioners that are in
 84:   the basic Mesh library.

 86:   Input Parameter:
 87:   path - library path
 88: */
 89: int PetscDLLibraryRegister(char *path) {

 92:   PetscInitializeNoArguments();
 93:   if (ierr) return(1);
 94:   /*
 95:       If we got here then PETSc was properly loaded
 96:   */
 97:   MeshInitializePackage(path);
 98:   return(0);
 99: }
100: EXTERN_C_END

102: /* --------------------------------------------------------------------------*/
103: static char *contents = "PETSc Mesh libraryn";
104: static char *authors  = "Matt Knepley    knepley@cs.purdue.edun
105:   http://www.cs.purdue.edu/homes/knepley/comp_fluidn";

107:  #include src/sys/src/utils/dlregis.h

109: /* --------------------------------------------------------------------------*/

111: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */