Date: 2023-11-27T17:18:28+00:00

Actual source code: dlregiseps.c
slepc-3.20.1 2023-11-27
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/epsimpl.h>

     13: static PetscBool EPSPackageInitialized = PETSC_FALSE;

     15: const char *EPSBalanceTypes[] = {"NONE","ONESIDE","TWOSIDE","USER","EPSBalance","EPS_BALANCE_",NULL};
     16: const char *EPSErrorTypes[] = {"ABSOLUTE","RELATIVE","BACKWARD","EPSErrorType","EPS_ERROR_",NULL};
     17: const char *EPSPowerShiftTypes[] = {"CONSTANT","RAYLEIGH","WILKINSON","EPSPowerShiftType","EPS_POWER_SHIFT_",NULL};
     18: const char *EPSLanczosReorthogTypes[] = {"LOCAL","FULL","SELECTIVE","PERIODIC","PARTIAL","DELAYED","EPSLanczosReorthogType","EPS_LANCZOS_REORTHOG_",NULL};
     19: const char *EPSPRIMMEMethods[] = {"","DYNAMIC","DEFAULT_MIN_TIME","DEFAULT_MIN_MATVECS","ARNOLDI","GD","GD_PLUSK","GD_OLSEN_PLUSK","JD_OLSEN_PLUSK","RQI","JDQR","JDQMR","JDQMR_ETOL","SUBSPACE_ITERATION","LOBPCG_ORTHOBASIS","LOBPCG_ORTHOBASISW","EPSPRIMMEMethod","EPS_PRIMME_",NULL};
     20: const char *EPSCISSQuadRules[] = {"(not set yet)","TRAPEZOIDAL","CHEBYSHEV","EPSCISSQuadRule","EPS_CISS_QUADRULE_",NULL};
     21: const char *EPSCISSExtractions[] = {"RITZ","HANKEL","EPSCISSExtraction","EPS_CISS_EXTRACTION_",NULL};
     22: const char *EPSEVSLDOSMethods[] = {"KPM","LANCZOS","EPSEVSLDOSMethod","EPS_EVSL_DOS_",NULL};
     23: const char *EPSEVSLDampings[] = {"NONE","JACKSON","SIGMA","EPSEVSLDamping","EPS_EVSL_DAMPING_",NULL};
     24: const char *const EPSConvergedReasons_Shifted[] = {"","DIVERGED_SYMMETRY_LOST","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","EPSConvergedReason","EPS_",NULL};
     25: const char *const*EPSConvergedReasons = EPSConvergedReasons_Shifted + 4;

     27: /*@C
     28:   EPSFinalizePackage - This function destroys everything in the SLEPc interface
     29:   to the EPS package. It is called from SlepcFinalize().

     31:   Level: developer

     33: .seealso: SlepcFinalize()
     34: @*/
     35: PetscErrorCode EPSFinalizePackage(void)
     36: {
     37:   PetscFunctionBegin;
     38:   PetscCall(PetscFunctionListDestroy(&EPSList));
     39:   PetscCall(PetscFunctionListDestroy(&EPSMonitorList));
     40:   PetscCall(PetscFunctionListDestroy(&EPSMonitorCreateList));
     41:   PetscCall(PetscFunctionListDestroy(&EPSMonitorDestroyList));
     42:   EPSPackageInitialized       = PETSC_FALSE;
     43:   EPSRegisterAllCalled        = PETSC_FALSE;
     44:   EPSMonitorRegisterAllCalled = PETSC_FALSE;
     45:   PetscFunctionReturn(PETSC_SUCCESS);
     46: }

     48: /*@C
     49:   EPSInitializePackage - This function initializes everything in the EPS package.
     50:   It is called from PetscDLLibraryRegister() when using dynamic libraries, and
     51:   on the first call to EPSCreate() when using static libraries.

     53:   Level: developer

     55: .seealso: SlepcInitialize()
     56: @*/
     57: PetscErrorCode EPSInitializePackage(void)
     58: {
     59:   char           logList[256];
     60:   PetscBool      opt,pkg;
     61:   PetscClassId   classids[1];

     63:   PetscFunctionBegin;
     64:   if (EPSPackageInitialized) PetscFunctionReturn(PETSC_SUCCESS);
     65:   EPSPackageInitialized = PETSC_TRUE;
     66:   /* Register Classes */
     67:   PetscCall(PetscClassIdRegister("EPS Solver",&EPS_CLASSID));
     68:   /* Register Constructors */
     69:   PetscCall(EPSRegisterAll());
     70:   /* Register Monitors */
     71:   PetscCall(EPSMonitorRegisterAll());
     72:   /* Register Events */
     73:   PetscCall(PetscLogEventRegister("EPSSetUp",EPS_CLASSID,&EPS_SetUp));
     74:   PetscCall(PetscLogEventRegister("EPSSolve",EPS_CLASSID,&EPS_Solve));
     75:   PetscCall(PetscLogEventRegister("EPSCISS_SVD",EPS_CLASSID,&EPS_CISS_SVD));
     76:   /* Process Info */
     77:   classids[0] = EPS_CLASSID;
     78:   PetscCall(PetscInfoProcessClass("eps",1,&classids[0]));
     79:   /* Process summary exclusions */
     80:   PetscCall(PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt));
     81:   if (opt) {
     82:     PetscCall(PetscStrInList("eps",logList,',',&pkg));
     83:     if (pkg) PetscCall(PetscLogEventDeactivateClass(EPS_CLASSID));
     84:   }
     85:   /* Register package finalizer */
     86:   PetscCall(PetscRegisterFinalize(EPSFinalizePackage));
     87:   PetscFunctionReturn(PETSC_SUCCESS);
     88: }

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

     95:   This one registers all the EPS methods that are in the basic SLEPc libslepceps
     96:   library.
     97:  */
     98: SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepceps(void)
     99: {
    100:   PetscFunctionBegin;
    101:   PetscCall(EPSInitializePackage());
    102:   PetscFunctionReturn(PETSC_SUCCESS);
    103: }
    104: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */