Date: 2023-01-26T12:19:26+00:00

Actual source code: dlregisnep.c
slepc-3.18.2 2023-01-26
Report Typos and Errors

      1: /*
      2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
      4:    Copyright (c) 2002-, 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_",NULL};
     16: const char *NEPRefineTypes[] = {"NONE","SIMPLE","MULTIPLE","NEPRefine","NEP_REFINE_",NULL};
     17: const char *NEPRefineSchemes[] = {"","SCHUR","MBE","EXPLICIT","NEPRefineScheme","NEP_REFINE_SCHEME_",NULL};
     18: const char *NEPCISSExtractions[] = {"RITZ","HANKEL","CAA","NEPCISSExtraction","NEP_CISS_EXTRACTION_",NULL};
     19: const char *const NEPConvergedReasons_Shifted[] = {"DIVERGED_SUBSPACE_EXHAUSTED","DIVERGED_LINEAR_SOLVE","","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","NEPConvergedReason","NEP_",NULL};
     20: const char *const*NEPConvergedReasons = NEPConvergedReasons_Shifted + 5;

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

     26:    Level: developer

     28: .seealso: SlepcFinalize()
     29: @*/
     30: PetscErrorCode NEPFinalizePackage(void)
     31: {
     32:   PetscFunctionListDestroy(&NEPList);
     33:   PetscFunctionListDestroy(&NEPMonitorList);
     34:   PetscFunctionListDestroy(&NEPMonitorCreateList);
     35:   PetscFunctionListDestroy(&NEPMonitorDestroyList);
     36:   NEPPackageInitialized       = PETSC_FALSE;
     37:   NEPRegisterAllCalled        = PETSC_FALSE;
     38:   NEPMonitorRegisterAllCalled = PETSC_FALSE;
     39:   return 0;
     40: }

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

     47:    Level: developer

     49: .seealso: SlepcInitialize()
     50: @*/
     51: PetscErrorCode NEPInitializePackage(void)
     52: {
     53:   char           logList[256];
     54:   PetscBool      opt,pkg;
     55:   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 Monitors */
     64:   NEPMonitorRegisterAll();
     65:   /* Register Events */
     66:   PetscLogEventRegister("NEPSetUp",NEP_CLASSID,&NEP_SetUp);
     67:   PetscLogEventRegister("NEPSolve",NEP_CLASSID,&NEP_Solve);
     68:   PetscLogEventRegister("NEPRefine",NEP_CLASSID,&NEP_Refine);
     69:   PetscLogEventRegister("NEPFunctionEval",NEP_CLASSID,&NEP_FunctionEval);
     70:   PetscLogEventRegister("NEPJacobianEval",NEP_CLASSID,&NEP_JacobianEval);
     71:   PetscLogEventRegister("NEPResolvent",NEP_CLASSID,&NEP_Resolvent);
     72:   PetscLogEventRegister("NEPCISS_SVD",NEP_CLASSID,&NEP_CISS_SVD);
     73:   /* Process Info */
     74:   classids[0] = NEP_CLASSID;
     75:   PetscInfoProcessClass("nep",1,&classids[0]);
     76:   /* Process summary exclusions */
     77:   PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
     78:   if (opt) {
     79:     PetscStrInList("nep",logList,',',&pkg);
     80:     if (pkg) PetscLogEventDeactivateClass(NEP_CLASSID);
     81:   }
     82:   /* Register package finalizer */
     83:   PetscRegisterFinalize(NEPFinalizePackage);
     84:   return 0;
     85: }

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

     92:   This one registers all the NEP methods that are in the basic SLEPc libslepcnep
     93:   library.
     94:  */
     95: SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcnep(void)
     96: {
     97:   NEPInitializePackage();
     98:   return 0;
     99: }
    100: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */