Actual source code: dlregisrand.c

petsc-3.8.3 2017-12-09
Report Typos and Errors

  2:  #include <../src/sys/classes/random/randomimpl.h>

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

  9:   Level: developer

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

 19:   PetscFunctionListDestroy(&PetscRandomList);
 20:   PetscRandomPackageInitialized = PETSC_FALSE;
 21:   PetscRandomRegisterAllCalled  = PETSC_FALSE;
 22:   return(0);
 23: }

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

 30:   Level: developer

 32: .keywords: PetscRandom, initialize, package
 33: .seealso: PetscInitialize()
 34: @*/
 35: PetscErrorCode  PetscRandomInitializePackage(void)
 36: {

 40:   if (PetscRandomPackageInitialized) return(0);
 41:   PetscRandomPackageInitialized = PETSC_TRUE;
 42:   /* Register Class */
 43:   PetscClassIdRegister("PetscRandom",&PETSC_RANDOM_CLASSID);
 44:   PetscRandomRegisterAll();
 45:   PetscRegisterFinalize(PetscRandomFinalizePackage);
 46:   return(0);
 47: }