Actual source code: dlregists.c

petsc-3.8.4 2018-03-24
Report Typos and Errors

  2:  #include <petsc/private/tsimpl.h>

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

  9:   Level: developer

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

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

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

 31:   Level: developer

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

 44:   if (TSPackageInitialized) return(0);
 45:   TSPackageInitialized = PETSC_TRUE;
 46:   /* Inialize subpackages */
 47:   TSGLLEInitializePackage();
 48:   TSRKInitializePackage();
 49:   TSGLEEInitializePackage();
 50:   TSARKIMEXInitializePackage();
 51:   TSRosWInitializePackage();
 52:   TSSSPInitializePackage();
 53:   TSAdaptInitializePackage();
 54:   TSGLLEAdaptInitializePackage();
 55:   /* Register Classes */
 56:   PetscClassIdRegister("TS",&TS_CLASSID);
 57:   PetscClassIdRegister("DMTS",&DMTS_CLASSID);
 58:   PetscClassIdRegister("TSTrajectory",&TSTRAJECTORY_CLASSID);
 59:   /* Register Constructors */
 60:   TSRegisterAll();
 61:   TSTrajectoryRegisterAll();
 62:   /* Register Events */
 63:   PetscLogEventRegister("TSAdjointStep",TS_CLASSID,&TS_AdjointStep);
 64:   PetscLogEventRegister("TSForwardStep",TS_CLASSID,&TS_ForwardStep);
 65:   PetscLogEventRegister("TSTrajSet",TSTRAJECTORY_CLASSID,&TSTrajectory_Set);
 66:   PetscLogEventRegister("TSTrajGet",TSTRAJECTORY_CLASSID,&TSTrajectory_Get);
 67:   PetscLogEventRegister("TSTrajDiskWrite",TS_CLASSID,&TSTrajectory_DiskWrite);
 68:   PetscLogEventRegister("TSTrajDiskRead",TS_CLASSID,&TSTrajectory_DiskRead);
 69:   PetscLogEventRegister("TSStep",TS_CLASSID,&TS_Step);
 70:   PetscLogEventRegister("TSPseudoCmptTStp",TS_CLASSID,&TS_PseudoComputeTimeStep);
 71:   PetscLogEventRegister("TSFunctionEval",TS_CLASSID,&TS_FunctionEval);
 72:   PetscLogEventRegister("TSJacobianEval",TS_CLASSID,&TS_JacobianEval);
 73:   /* Process info exclusions */
 74:   PetscOptionsGetString(NULL,NULL, "-info_exclude", logList, 256, &opt);
 75:   if (opt) {
 76:     PetscStrstr(logList, "ts", &className);
 77:     if (className) {
 78:       PetscInfoDeactivateClass(TS_CLASSID);
 79:     }
 80:   }
 81:   /* Process summary exclusions */
 82:   PetscOptionsGetString(NULL,NULL, "-log_exclude", logList, 256, &opt);
 83:   if (opt) {
 84:     PetscStrstr(logList, "ts", &className);
 85:     if (className) {
 86:       PetscLogEventDeactivateClass(TS_CLASSID);
 87:     }
 88:   }
 89:   PetscRegisterFinalize(TSFinalizePackage);
 90:   return(0);
 91: }

 93: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
 94: /*
 95:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

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

 99:  */
100: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscts(void); /*prototype*/
101: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscts(void)
102: {

106:   TSInitializePackage();
107:   return(0);
108: }


111: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */