Date: 2021-02-01T14:42:15+00:00

Actual source code: dlregisnep.c
slepc-3.14.2 2021-02-01
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/nepimpl.h>

     13: static PetscBool NEPPackageInitialized = PETSC_FALSE;

     15: const char *NEPErrorTypes[] = {"ABSOLUTE","RELATIVE","BACKWARD","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;
     53:   PetscClassId   classids[1];

     57:   if (NEPPackageInitialized) return(0);
     58:   NEPPackageInitialized = PETSC_TRUE;
     59:   /* Register Classes */
     60:   PetscClassIdRegister("NEP Solver",&NEP_CLASSID);
     61:   /* Register Constructors */
     62:   NEPRegisterAll();
     63:   /* Register Events */
     64:   PetscLogEventRegister("NEPSetUp",NEP_CLASSID,&NEP_SetUp);
     65:   PetscLogEventRegister("NEPSolve",NEP_CLASSID,&NEP_Solve);
     66:   PetscLogEventRegister("NEPRefine",NEP_CLASSID,&NEP_Refine);
     67:   PetscLogEventRegister("NEPFunctionEval",NEP_CLASSID,&NEP_FunctionEval);
     68:   PetscLogEventRegister("NEPJacobianEval",NEP_CLASSID,&NEP_JacobianEval);
     69:   PetscLogEventRegister("NEPResolvent",NEP_CLASSID,&NEP_Resolvent);
     70:   /* Process Info */
     71:   classids[0] = NEP_CLASSID;
     72:   PetscInfoProcessClass("nep",1,&classids[0]);
     73:   /* Process summary exclusions */
     74:   PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
     75:   if (opt) {
     76:     PetscStrInList("nep",logList,',',&pkg);
     77:     if (pkg) { PetscLogEventDeactivateClass(NEP_CLASSID); }
     78:   }
     79:   /* Register package finalizer */
     80:   PetscRegisterFinalize(NEPFinalizePackage);
     81:   return(0);
     82: }

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

     89:   This one registers all the NEP methods that are in the basic SLEPc libslepcnep
     90:   library.
     91:  */
     92: SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcnep()
     93: {

     97:   NEPInitializePackage();
     98:   return(0);
     99: }
    100: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */