Actual source code: dlregispep.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/pepimpl.h>

     13: static PetscBool PEPPackageInitialized = PETSC_FALSE;

     15: const char *PEPBasisTypes[] = {"MONOMIAL","CHEBYSHEV1","CHEBYSHEV2","LEGENDRE","LAGUERRE","HERMITE","PEPBasis","PEP_BASIS_",0};
     16: const char *PEPScaleTypes[] = {"NONE","SCALAR","DIAGONAL","BOTH","PEPScale","PEP_SCALE_",0};
     17: const char *PEPRefineTypes[] = {"NONE","SIMPLE","MULTIPLE","PEPRefine","PEP_REFINE_",0};
     18: const char *PEPRefineSchemes[] = {"","SCHUR","MBE","EXPLICIT","PEPRefineScheme","PEP_REFINE_SCHEME_",0};
     19: const char *PEPExtractTypes[] = {"","NONE","NORM","RESIDUAL","STRUCTURED","PEPExtract","PEP_EXTRACT_",0};
     20: const char *PEPErrorTypes[] = {"ABSOLUTE","RELATIVE","BACKWARD","PEPErrorType","PEP_ERROR_",0};
     21: const char *const PEPConvergedReasons_Shifted[] = {"","DIVERGED_SYMMETRY_LOST","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","PEPConvergedReason","PEP_",0};
     22: const char *const*PEPConvergedReasons = PEPConvergedReasons_Shifted + 4;

     24: /*@C
     25:    PEPFinalizePackage - This function destroys everything in the Slepc interface
     26:    to the PEP package. It is called from SlepcFinalize().

     28:    Level: developer

     30: .seealso: SlepcFinalize()
     31: @*/
     32: PetscErrorCode PEPFinalizePackage(void)
     33: {

     37:   PetscFunctionListDestroy(&PEPList);
     38:   PEPPackageInitialized = PETSC_FALSE;
     39:   PEPRegisterAllCalled  = PETSC_FALSE;
     40:   return(0);
     41: }

     43: /*@C
     44:    PEPInitializePackage - This function initializes everything in the PEP package.
     45:    It is called from PetscDLLibraryRegister() when using dynamic libraries, and
     46:    on the first call to PEPCreate() when using static libraries.

     48:    Level: developer

     50: .seealso: SlepcInitialize()
     51: @*/
     52: PetscErrorCode PEPInitializePackage(void)
     53: {
     54:   char           logList[256];
     55:   PetscBool      opt,pkg;

     59:   if (PEPPackageInitialized) return(0);
     60:   PEPPackageInitialized = PETSC_TRUE;
     61:   /* Register Classes */
     62:   PetscClassIdRegister("PEP Solver",&PEP_CLASSID);
     63:   /* Register Constructors */
     64:   PEPRegisterAll();
     65:   /* Register Events */
     66:   PetscLogEventRegister("PEPSetUp",PEP_CLASSID,&PEP_SetUp);
     67:   PetscLogEventRegister("PEPSolve",PEP_CLASSID,&PEP_Solve);
     68:   PetscLogEventRegister("PEPRefine",PEP_CLASSID,&PEP_Refine);
     69:   /* Process info exclusions */
     70:   PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,sizeof(logList),&opt);
     71:   if (opt) {
     72:     PetscStrInList("pep",logList,',',&pkg);
     73:     if (pkg) { PetscInfoDeactivateClass(PEP_CLASSID); }
     74:   }
     75:   /* Process summary exclusions */
     76:   PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
     77:   if (opt) {
     78:     PetscStrInList("pep",logList,',',&pkg);
     79:     if (pkg) { PetscLogEventDeactivateClass(PEP_CLASSID); }
     80:   }
     81:   /* Register package finalizer */
     82:   PetscRegisterFinalize(PEPFinalizePackage);
     83:   return(0);
     84: }

     86: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
     87: /*
     88:   PetscDLLibraryRegister - This function is called when the dynamic library
     89:   it is in is opened.

     91:   This one registers all the PEP methods that are in the basic SLEPc libslepcpep
     92:   library.
     93:  */
     94: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcpep()
     95: {

     99:   PEPInitializePackage();
    100:   return(0);
    101: }
    102: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */