Actual source code: dlregismat.c

  1: #define PETSCMAT_DLL

 3:  #include include/private/matimpl.h

  5: const char *MatOptions[] = {"ROW_ORIENTED","COLUMN_ORIENTED","ROWS_SORTED",
  6:               "COLUMNS_SORTED","NO_NEW_NONZERO_LOCATIONS",
  7:               "YES_NEW_NONZERO_LOCATIONS","SYMMETRIC",
  8:               "STRUCTURALLY_SYMMETRIC","NO_NEW_DIAGONALS",
  9:               "YES_NEW_DIAGONALS","INODE_LIMIT_1","INODE_LIMIT_2",
 10:               "INODE_LIMIT_3","INODE_LIMIT_4","INODE_LIMIT_5",
 11:               "IGNORE_OFF_PROC_ENTRIES,ROWS_UNSORTED",
 12:               "COLUMNS_UNSORTED","NEW_NONZERO_LOCATION_ERR",
 13:               "NEW_NONZERO_ALLOCATION_ERR","USE_HASH_TABLE",
 14:               "KEEP_ZEROED_ROWS","IGNORE_ZERO_ENTRIES","USE_INODES",
 15:               "DO_NOT_USE_INODES","NOT_SYMMETRIC,HERMITIAN",
 16:               "NOT_STRUCTURALLY_SYMMETRIC","NOT_HERMITIAN",
 17:               "SYMMETRY_ETERNAL","NOT_SYMMETRY_ETERNAL",
 18:               "USE_COMPRESSEDROW","DO_NOT_USE_COMPRESSEDROW",
 19:               "IGNORE_LOWER_TRIANGULAR","ERROR_LOWER_TRIANGULAR","GETROW_UPPERTRIANGULAR","MatOption","MAT_",0};

 21: EXTERN PetscErrorCode  MatMFFDInitializePackage(const char[]);

 25: /*@C
 26:   MatInitializePackage - This function initializes everything in the Mat package. It is called
 27:   from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to MatCreate()
 28:   when using static libraries.

 30:   Input Parameter:
 31:   path - The dynamic library path, or PETSC_NULL

 33:   Level: developer

 35: .keywords: Mat, initialize, package
 36: .seealso: PetscInitialize()
 37: @*/
 38: PetscErrorCode  MatInitializePackage(const char path[])
 39: {
 40:   static PetscTruth initialized = PETSC_FALSE;
 41:   char              logList[256];
 42:   char              *className;
 43:   PetscTruth        opt;
 44:   PetscErrorCode    ierr;

 47:   /* Inialize subpackage */
 48:   MatMFFDInitializePackage(PETSC_NULL);
 49:   if (initialized) return(0);
 50:   initialized = PETSC_TRUE;
 51:   /* Register Classes */
 52:   PetscLogClassRegister(&MAT_COOKIE,              "Matrix");
 53:   PetscLogClassRegister(&MAT_FDCOLORING_COOKIE,   "Matrix FD Coloring");
 54:   PetscLogClassRegister(&MAT_PARTITIONING_COOKIE, "Matrix Partitioning");
 55:   PetscLogClassRegister(&MAT_NULLSPACE_COOKIE,    "Matrix Null Space");
 56:   /* Register Constructors */
 57:   MatRegisterAll(path);
 58:   /* Register Events */
115:   /* Turn off high traffic events by default */
117:   /* Process info exclusions */
118:   PetscOptionsGetString(PETSC_NULL, "-info_exclude", logList, 256, &opt);
119:   if (opt) {
120:     PetscStrstr(logList, "mat", &className);
121:     if (className) {
122:       PetscInfoDeactivateClass(MAT_COOKIE);
123:     }
124:   }
125:   /* Process summary exclusions */
126:   PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
127:   if (opt) {
128:     PetscStrstr(logList, "mat", &className);
129:     if (className) {
131:     }
132:   }
133:   return(0);
134: }

136: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
140: /*
141:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

143:   This one registers all the matrix methods that are in the basic PETSc Matrix library.

145:   Input Parameter:
146:   path - library path
147:  */
148: PetscErrorCode  PetscDLLibraryRegister_petscmat(const char path[])
149: {

152:   PetscInitializeNoArguments(); if (ierr) return 1;

155:   /*
156:       If we got here then PETSc was properly loaded
157:   */
158:   MatInitializePackage(path);
159:   return(0);
160: }


164: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */