Actual source code: dlregis.c

  1: /*$Id: dlregis.c,v 1.19 2001/03/23 23:24:34 balay Exp $*/

 3:  #include petscts.h

  5: #undef __FUNCT__  
  7: /*@C
  8:   TSInitializePackage - This function initializes everything in the TS package. It is called
  9:   from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to TSCreate()
 10:   when using static libraries.

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

 15:   Level: developer

 17: .keywords: TS, initialize, package
 18: .seealso: PetscInitialize()
 19: @*/
 20: int TSInitializePackage(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(&TS_COOKIE, "TS");
 32:   /* Register Constructors and Serializers */
 33:   TSRegisterAll(path);
 34:   /* Register Events */
 35:   PetscLogEventRegister(&TS_Step,                  "TSStep",           TS_COOKIE);
 36:   PetscLogEventRegister(&TS_PseudoComputeTimeStep, "TSPseudoCmptTStp", TS_COOKIE);
 37:   PetscLogEventRegister(&TS_FunctionEval,          "TSFunctionEval",   TS_COOKIE);
 38:   PetscLogEventRegister(&TS_JacobianEval,          "TSJacobianEval",   TS_COOKIE);
 39:   /* Process info exclusions */
 40:   PetscOptionsGetString(PETSC_NULL, "-log_info_exclude", logList, 256, &opt);
 41:   if (opt == PETSC_TRUE) {
 42:     PetscStrstr(logList, "ts", &className);
 43:     if (className) {
 44:       PetscLogInfoDeactivateClass(TS_COOKIE);
 45:     }
 46:   }
 47:   /* Process summary exclusions */
 48:   PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
 49:   if (opt == PETSC_TRUE) {
 50:     PetscStrstr(logList, "ts", &className);
 51:     if (className) {
 52:       PetscLogEventDeactivateClass(TS_COOKIE);
 53:     }
 54:   }
 55:   return(0);
 56: }

 58: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
 59: EXTERN_C_BEGIN
 60: #undef __FUNCT__  
 62: /*
 63:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

 65:   This one registers all the TS methods that are in the basic PETSc libpetscts library.

 67:   Input Parameter:
 68:   path - library path
 69:  */
 70: int PetscDLLibraryRegister(char *path)
 71: {

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

 77:   /*
 78:       If we got here then PETSc was properly loaded
 79:   */
 80:   TSInitializePackage(path);
 81:   return(0);
 82: }
 83: EXTERN_C_END

 85: /* --------------------------------------------------------------------------*/
 86: static char *contents = "PETSc timestepping library. n
 87:      Eulern
 88:      Backward Eulern
 89:      PVODE interfacen";
 90: static char *authors  = PETSC_AUTHOR_INFO;

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

 94: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */