Actual source code: dlregis.c

  1: #ifdef PETSC_RCS_HEADER
  2: static char vcid[] = "$Id: dlregis.c,v 1.1 2000/01/10 03:54:20 knepley Exp $";
  3: #endif

 5:  #include petscts.h
 6:  #include gsolver.h

  8: EXTERN_C_BEGIN
  9: extern int GTSCreate_BEuler(TS);
 10: extern int PCCreate_Jacobi_Constrained(PC);
 11: extern int PCCreate_Schur(PC);
 12: extern int GTSSerialize_BEuler(MPI_Comm, TS *, PetscViewer, PetscTruth);
 13: extern int GVecKSPOptionsChecker_Private(KSP);
 14: extern int GSNESOptionsChecker_Private(GSNES);
 15: extern int GTSOptionsChecker_Private(GTS);

 17: #if !defined (PETSC_USE_COMPLEX)
 18: extern int PCCreate_Multilevel(PC);
 19: #endif

 21: EXTERN_C_END

 23: #undef __FUNCT__  
 25: /*@C
 26:   GSolverInitializePackage - This function initializes everything in the GSolver package. It is called
 27:   from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to GSNESCreate()
 28:   or GTSCreate() when using static libraries.

 30:   Input Parameter:
 31:   path - The dynamic library path, or PETSC_NULL

 33:   Level: developer

 35: .keywords: Mesh, initialize, package
 36: .seealso: PetscInitialize()
 37: @*/
 38: int GSolverInitializePackage(char *path) {
 39:   static PetscTruth initialized = PETSC_FALSE;
 40:   int               ierr;

 43:   if (initialized == PETSC_TRUE) return(0);
 44:   initialized = PETSC_TRUE;
 45:   /* Register Classes */
 46:   /* Register Constructors and Serializers */
 47:   TSRegisterDynamic("gbeuler", path, "GTSCreate_BEuler", GTSCreate_BEuler);
 48:   TSSerializeRegisterDynamic(GTS_SER_BEULER_BINARY, path, "GTSSerialize_BEuler", GTSSerialize_BEuler);
 49:   PCRegisterDynamic("jacobic",    path, "PCCreate_Jacobi_Constrained", PCCreate_Jacobi_Constrained);
 50: #if !defined (PETSC_USE_COMPLEX)
 51:   PCRegisterDynamic(PCMULTILEVEL, path, "PCCreate_Multilevel", PCCreate_Multilevel);
 52: #endif
 53:   PCRegisterDynamic(PCSCHUR     , path, "PCCreate_Schur",      PCCreate_Schur);
 54:   /* Register Events */
 55:   PetscLogEventRegister(&GTS_Reform,     "GTSReform",     TS_COOKIE);
 56:   PetscLogEventRegister(&GTS_Reallocate, "GTSReallocate", TS_COOKIE);
 57:   /* Process info exclusions */
 58:   /* Process summary exclusions */
 59:   /* Add options checkers */
 60:   KSPAddOptionsChecker(GVecKSPOptionsChecker_Private);
 61:   SNESAddOptionsChecker(GSNESOptionsChecker_Private);
 62:   /*TSAddOptionsChecker(GTSOptionsChecker_Private);                                                  */
 63:   return(0);
 64: }

 66: #ifdef PETSC_USE_DYNAMIC_LIBRARIES
 67: EXTERN_C_BEGIN
 68: #undef __FUNCT__  
 70: /*
 71:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

 73:   This one registers all the solvers in the GSolver library.

 75:   Input Parameter:
 76:   path - library path
 77: */
 78: int PetscDLLibraryRegister(char *path) {

 81:   PetscInitializeNoArguments();
 82:   if (ierr) return(1);
 83:   /*
 84:       If we got here then PETSc was properly loaded
 85:   */
 86:   GSolverInitializePackage(path);
 87:   return(0);
 88: }
 89: EXTERN_C_END

 91: /* --------------------------------------------------------------------------*/
 92: static char *contents = "PETSc Finite Element Solver library";

 94: static char *authors = "Matt Knepley    knepley@cs.purdue.edun
 95:   http://www.cs.purdue.edu/homes/knepley/comp_fluidn";

 97:  #include src/sys/src/utils/dlregis.h

 99: /* --------------------------------------------------------------------------*/

101: #endif /* PETSC_USE_DYNAMIC_LIBRARIES */