Actual source code: dlregislme.c

slepc-3.13.1 2020-04-12
Report Typos and Errors
  1: /*
  2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  4:    Copyright (c) 2002-2020, 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;
 51:   PetscClassId   classids[1];

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

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

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

 92:   LMEInitializePackage();
 93:   return(0);
 94: }
 95: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */