2: #include <../src/sys/classes/random/randomimpl.h> 4: static PetscBool PetscRandomPackageInitialized = PETSC_FALSE; 7: /*@C 8: PetscRandomFinalizePackage - This function destroys everything in the Petsc interface to the Random package. It is 9: called from PetscFinalize(). 11: Level: developer 13: .keywords: Petsc, destroy, package, mathematica 14: .seealso: PetscFinalize() 15: @*/ 16: PetscErrorCode PetscRandomFinalizePackage(void) 17: { 21: PetscFunctionListDestroy(&PetscRandomList); 22: PetscRandomPackageInitialized = PETSC_FALSE; 23: PetscRandomRegisterAllCalled = PETSC_FALSE; 24: return(0); 25: } 29: /*@C 30: PetscRandomInitializePackage - This function initializes everything in the PetscRandom package. It is called 31: from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to PetscRandomCreate() 32: when using static libraries. 34: Level: developer 36: .keywords: PetscRandom, initialize, package 37: .seealso: PetscInitialize() 38: @*/ 39: PetscErrorCode PetscRandomInitializePackage(void) 40: { 44: if (PetscRandomPackageInitialized) return(0); 45: PetscRandomPackageInitialized = PETSC_TRUE; 46: /* Register Class */ 47: PetscClassIdRegister("PetscRandom",&PETSC_RANDOM_CLASSID); 48: PetscRandomRegisterAll(); 49: PetscRegisterFinalize(PetscRandomFinalizePackage); 50: return(0); 51: }