Actual source code: dlregists.c

petsc-3.5.4 2015-05-23
Report Typos and Errors
  2: #include <petsc-private/tsimpl.h>

  4: static PetscBool TSPackageInitialized = PETSC_FALSE;
  7: /*@C
  8:   TSFinalizePackage - This function destroys everything in the Petsc interface to Mathematica. It is
  9:   called from PetscFinalize().

 11:   Level: developer

 13: .keywords: Petsc, destroy, package, mathematica
 14: .seealso: PetscFinalize()
 15: @*/
 16: PetscErrorCode  TSFinalizePackage(void)
 17: {

 21:   PetscFunctionListDestroy(&TSList);
 22:   TSPackageInitialized = PETSC_FALSE;
 23:   TSRegisterAllCalled  = PETSC_FALSE;
 24:   return(0);
 25: }

 29: /*@C
 30:   TSInitializePackage - This function initializes everything in the TS package. It is called
 31:   from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to TSCreate()
 32:   when using static libraries.

 34:   Level: developer

 36: .keywords: TS, initialize, package
 37: .seealso: PetscInitialize()
 38: @*/
 39: PetscErrorCode  TSInitializePackage(void)
 40: {
 41:   char           logList[256];
 42:   char           *className;
 43:   PetscBool      opt;

 47:   if (TSPackageInitialized) return(0);
 48:   TSPackageInitialized = PETSC_TRUE;
 49:   /* Inialize subpackages */
 50:   TSGLInitializePackage();
 51:   TSRKInitializePackage();
 52:   TSARKIMEXInitializePackage();
 53:   TSRosWInitializePackage();
 54:   TSSSPInitializePackage();
 55:   TSAdaptInitializePackage();
 56:   TSGLAdaptInitializePackage();
 57:   /* Register Classes */
 58:   PetscClassIdRegister("TS",&TS_CLASSID);
 59:   PetscClassIdRegister("DMTS",&DMTS_CLASSID);
 60:   /* Register Constructors */
 61:   TSRegisterAll();
 62:   /* Register Events */
 63:   PetscLogEventRegister("TSStep",           TS_CLASSID,&TS_Step);
 64:   PetscLogEventRegister("TSPseudoCmptTStp", TS_CLASSID,&TS_PseudoComputeTimeStep);
 65:   PetscLogEventRegister("TSFunctionEval",   TS_CLASSID,&TS_FunctionEval);
 66:   PetscLogEventRegister("TSJacobianEval",   TS_CLASSID,&TS_JacobianEval);
 67:   /* Process info exclusions */
 68:   PetscOptionsGetString(NULL, "-info_exclude", logList, 256, &opt);
 69:   if (opt) {
 70:     PetscStrstr(logList, "ts", &className);
 71:     if (className) {
 72:       PetscInfoDeactivateClass(TS_CLASSID);
 73:     }
 74:   }
 75:   /* Process summary exclusions */
 76:   PetscOptionsGetString(NULL, "-log_summary_exclude", logList, 256, &opt);
 77:   if (opt) {
 78:     PetscStrstr(logList, "ts", &className);
 79:     if (className) {
 80:       PetscLogEventDeactivateClass(TS_CLASSID);
 81:     }
 82:   }
 83:   PetscRegisterFinalize(TSFinalizePackage);
 84:   return(0);
 85: }

 87: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
 90: /*
 91:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

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

 95:  */
 96: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscts(void)
 97: {

101:   TSInitializePackage();
102:   return(0);
103: }


106: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */