Actual source code: dlregisnep.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/nepimpl.h>

     13: static PetscBool NEPPackageInitialized = PETSC_FALSE;

     15: const char *NEPErrorTypes[] = {"ABSOLUTE","RELATIVE","NEPErrorType","NEP_ERROR_",0};
     16: const char *NEPRefineTypes[] = {"NONE","SIMPLE","MULTIPLE","NEPRefine","NEP_REFINE_",0};
     17: const char *NEPRefineSchemes[] = {"","SCHUR","MBE","EXPLICIT","NEPRefineScheme","NEP_REFINE_SCHEME_",0};
     18: const char *const NEPConvergedReasons_Shifted[] = {"DIVERGED_SUBSPACE_EXHAUSTED","DIVERGED_LINEAR_SOLVE","","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","NEPConvergedReason","NEP_",0};
     19: const char *const*NEPConvergedReasons = NEPConvergedReasons_Shifted + 5;

     21: /*@C
     22:    NEPFinalizePackage - This function destroys everything in the Slepc interface
     23:    to the NEP package. It is called from SlepcFinalize().

     25:    Level: developer

     27: .seealso: SlepcFinalize()
     28: @*/
     29: PetscErrorCode NEPFinalizePackage(void)
     30: {

     34:   PetscFunctionListDestroy(&NEPList);
     35:   NEPPackageInitialized = PETSC_FALSE;
     36:   NEPRegisterAllCalled  = PETSC_FALSE;
     37:   return(0);
     38: }

     40: /*@C
     41:    NEPInitializePackage - This function initializes everything in the NEP package.
     42:    It is called from PetscDLLibraryRegister() when using dynamic libraries, and
     43:    on the first call to NEPCreate() when using static libraries.

     45:    Level: developer

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

     56:   if (NEPPackageInitialized) return(0);
     57:   NEPPackageInitialized = PETSC_TRUE;
     58:   /* Register Classes */
     59:   PetscClassIdRegister("NEP Solver",&NEP_CLASSID);
     60:   /* Register Constructors */
     61:   NEPRegisterAll();
     62:   /* Register Events */
     63:   PetscLogEventRegister("NEPSetUp",NEP_CLASSID,&NEP_SetUp);
     64:   PetscLogEventRegister("NEPSolve",NEP_CLASSID,&NEP_Solve);
     65:   PetscLogEventRegister("NEPRefine",NEP_CLASSID,&NEP_Refine);
     66:   PetscLogEventRegister("NEPFunctionEval",NEP_CLASSID,&NEP_FunctionEval);
     67:   PetscLogEventRegister("NEPJacobianEval",NEP_CLASSID,&NEP_JacobianEval);
     68:   PetscLogEventRegister("NEPDerivativesEval",NEP_CLASSID,&NEP_DerivativesEval);
     69:   /* Process info exclusions */
     70:   PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,sizeof(logList),&opt);
     71:   if (opt) {
     72:     PetscStrInList("nep",logList,',',&pkg);
     73:     if (pkg) { PetscInfoDeactivateClass(NEP_CLASSID); }
     74:   }
     75:   /* Process summary exclusions */
     76:   PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
     77:   if (opt) {
     78:     PetscStrInList("nep",logList,',',&pkg);
     79:     if (pkg) { PetscLogEventDeactivateClass(NEP_CLASSID); }
     80:   }
     81:   /* Register package finalizer */
     82:   PetscRegisterFinalize(NEPFinalizePackage);
     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 NEP methods that are in the basic SLEPc libslepcnep
     92:   library.
     93:  */
     94: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcnep()
     95: {

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