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

 10:   Input Parameter:
 11:   path - The dynamic library path, or PETSC_NULL

 13:   Level: developer

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

 26:   if (initialized == PETSC_TRUE) return(0);
 27:   initialized = PETSC_TRUE;
 28:   /* Register Classes */
 29:   PetscLogClassRegister(&TS_COOKIE, "TS");
 30:   /* Register Constructors and Serializers */
 31:   TSRegisterAll(path);
 32:   /* Register Events */
 33:   PetscLogEventRegister(&TS_Step,                  "TSStep",           TS_COOKIE);
 34:   PetscLogEventRegister(&TS_PseudoComputeTimeStep, "TSPseudoCmptTStp", TS_COOKIE);
 35:   PetscLogEventRegister(&TS_FunctionEval,          "TSFunctionEval",   TS_COOKIE);
 36:   PetscLogEventRegister(&TS_JacobianEval,          "TSJacobianEval",   TS_COOKIE);
 37:   /* Process info exclusions */
 38:   PetscOptionsGetString(PETSC_NULL, "-log_info_exclude", logList, 256, &opt);
 39:   if (opt == PETSC_TRUE) {
 40:     PetscStrstr(logList, "ts", &className);
 41:     if (className) {
 42:       PetscLogInfoDeactivateClass(TS_COOKIE);
 43:     }
 44:   }
 45:   /* Process summary exclusions */
 46:   PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
 47:   if (opt == PETSC_TRUE) {
 48:     PetscStrstr(logList, "ts", &className);
 49:     if (className) {
 50:       PetscLogEventDeactivateClass(TS_COOKIE);
 51:     }
 52:   }
 53:   return(0);
 54: }

 56: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
 57: EXTERN_C_BEGIN
 58: /*
 59:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

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

 63:   Input Parameter:
 64:   path - library path
 65:  */
 66: int PetscDLLibraryRegister(char *path)
 67: {

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

 73:   /*
 74:       If we got here then PETSc was properly loaded
 75:   */
 76:   TSInitializePackage(path);
 77:   return(0);
 78: }
 79: EXTERN_C_END

 81: /* --------------------------------------------------------------------------*/
 82: static char *contents = "PETSc timestepping library. n
 83:      Eulern
 84:      Backward Eulern
 85:      PVODE interfacen";
 86: static char *authors  = PETSC_AUTHOR_INFO;

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

 90: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */