Actual source code: dlregislme.c
slepc-3.10.1 2018-10-23
Report Typos and Errors

      1: /*
      2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
      4:    Copyright (c) 2002-2018, Universitat Politecnica de Valencia, Spain

      6:    This file is part of SLEPc.
      7:    SLEPc is distributed under a 2-clause BSD license (see LICENSE).
      8:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      9: */

     11: #include <slepc/private/lmeimpl.h>

     13: static PetscBool LMEPackageInitialized = PETSC_FALSE;

     15: const char *LMEProblemTypes[] = {"LYAPUNOV","SYLVESTER","GEN_LYAPUNOV","GEN_SYLVESTER","DT_LYAPUNOV","STEIN","LMEProblemType","LME_",0};
     16: const char *const LMEConvergedReasons_Shifted[] = {"DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","LMEConvergedReason","LME_",0};
     17: const char *const*LMEConvergedReasons = LMEConvergedReasons_Shifted + 2;

     19: /*@C
     20:   LMEFinalizePackage - This function destroys everything in the SLEPc interface
     21:   to the LME package. It is called from SlepcFinalize().

     23:   Level: developer

     25: .seealso: SlepcFinalize()
     26: @*/
     27: PetscErrorCode LMEFinalizePackage(void)
     28: {

     32:   PetscFunctionListDestroy(&LMEList);
     33:   LMEPackageInitialized = PETSC_FALSE;
     34:   LMERegisterAllCalled  = PETSC_FALSE;
     35:   return(0);
     36: }

     38: /*@C
     39:   LMEInitializePackage - This function initializes everything in the LME package.
     40:   It is called from PetscDLLibraryRegister() when using dynamic libraries, and
     41:   on the first call to LMECreate() when using static libraries.

     43:   Level: developer

     45: .seealso: SlepcInitialize()
     46: @*/
     47: PetscErrorCode LMEInitializePackage(void)
     48: {
     49:   char           logList[256];
     50:   PetscBool      opt,pkg;

     54:   if (LMEPackageInitialized) return(0);
     55:   LMEPackageInitialized = PETSC_TRUE;
     56:   /* Register Classes */
     57:   PetscClassIdRegister("Lin. Matrix Equation",&LME_CLASSID);
     58:   /* Register Constructors */
     59:   LMERegisterAll();
     60:   /* Register Events */
     61:   PetscLogEventRegister("LMESetUp",LME_CLASSID,&LME_SetUp);
     62:   PetscLogEventRegister("LMESolve",LME_CLASSID,&LME_Solve);
     63:   PetscLogEventRegister("LMEComputeError",LME_CLASSID,&LME_ComputeError);
     64:   /* Process info exclusions */
     65:   PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,sizeof(logList),&opt);
     66:   if (opt) {
     67:     PetscStrInList("lme",logList,',',&pkg);
     68:     if (pkg) { PetscInfoDeactivateClass(LME_CLASSID); }
     69:   }
     70:   /* Process summary exclusions */
     71:   PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
     72:   if (opt) {
     73:     PetscStrInList("lme",logList,',',&pkg);
     74:     if (pkg) { PetscLogEventDeactivateClass(LME_CLASSID); }
     75:   }
     76:   /* Register package finalizer */
     77:   PetscRegisterFinalize(LMEFinalizePackage);
     78:   return(0);
     79: }

     81: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
     82: /*
     83:   PetscDLLibraryRegister - This function is called when the dynamic library
     84:   it is in is opened.

     86:   This one registers all the LME methods that are in the basic SLEPc libslepclme
     87:   library.
     88:  */
     89: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepclme()
     90: {

     94:   LMEInitializePackage();
     95:   return(0);
     96: }
     97: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */