Actual source code: dlregis.c
2: #include petscts.h
6: /*@C
7: TSInitializePackage - This function initializes everything in the TS package. It is called
8: from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to TSCreate()
9: when using static libraries.
11: Input Parameter:
12: path - The dynamic library path, or PETSC_NULL
14: Level: developer
16: .keywords: TS, initialize, package
17: .seealso: PetscInitialize()
18: @*/
19: PetscErrorCode TSInitializePackage(const char path[]) {
20: static PetscTruth initialized = PETSC_FALSE;
21: char logList[256];
22: char *className;
23: PetscTruth opt;
24: PetscErrorCode ierr;
27: if (initialized == PETSC_TRUE) return(0);
28: initialized = PETSC_TRUE;
29: /* Register Classes */
30: PetscLogClassRegister(&TS_COOKIE, "TS");
31: /* Register Constructors */
32: TSRegisterAll(path);
33: /* Register Events */
34: PetscLogEventRegister(&TS_Step, "TSStep", TS_COOKIE);
35: PetscLogEventRegister(&TS_PseudoComputeTimeStep, "TSPseudoCmptTStp", TS_COOKIE);
36: PetscLogEventRegister(&TS_FunctionEval, "TSFunctionEval", TS_COOKIE);
37: PetscLogEventRegister(&TS_JacobianEval, "TSJacobianEval", TS_COOKIE);
38: /* Process info exclusions */
39: PetscOptionsGetString(PETSC_NULL, "-log_info_exclude", logList, 256, &opt);
40: if (opt == PETSC_TRUE) {
41: PetscStrstr(logList, "ts", &className);
42: if (className) {
43: PetscLogInfoDeactivateClass(TS_COOKIE);
44: }
45: }
46: /* Process summary exclusions */
47: PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);
48: if (opt == PETSC_TRUE) {
49: PetscStrstr(logList, "ts", &className);
50: if (className) {
51: PetscLogEventDeactivateClass(TS_COOKIE);
52: }
53: }
54: return(0);
55: }
57: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
61: /*
62: PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.
64: This one registers all the TS methods that are in the basic PETSc libpetscts library.
66: Input Parameter:
67: path - library path
68: */
69: PetscErrorCode PetscDLLibraryRegister(char *path)
70: {
73: PetscInitializeNoArguments(); if (ierr) return 1;
76: /*
77: If we got here then PETSc was properly loaded
78: */
79: TSInitializePackage(path);
80: return(0);
81: }
84: /* --------------------------------------------------------------------------*/
85: static const char *contents = "PETSc timestepping library. \n\
86: Euler\n\
87: Backward Euler\n\
88: PVODE interface\n";
89: static const char *authors = PETSC_AUTHOR_INFO;
91: #include src/sys/src/utils/dlregis.h
93: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */