Actual source code: dlregispep.c

slepc-3.16.1 2021-11-17
Report Typos and Errors
  1: /*
  2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  4:    Copyright (c) 2002-2021, 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;
 23: const char *PEPJDProjectionTypes[] = {"HARMONIC","ORTHOGONAL","PEPJDProjection","PEP_JD_PROJECTION_",0};
 24: const char *PEPCISSExtractions[] = {"RITZ","HANKEL","CAA","PEPCISSExtraction","PEP_CISS_EXTRACTION_",0};

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

 30:    Level: developer

 32: .seealso: SlepcFinalize()
 33: @*/
 34: PetscErrorCode PEPFinalizePackage(void)
 35: {

 39:   PetscFunctionListDestroy(&PEPList);
 40:   PetscFunctionListDestroy(&PEPMonitorList);
 41:   PetscFunctionListDestroy(&PEPMonitorCreateList);
 42:   PetscFunctionListDestroy(&PEPMonitorDestroyList);
 43:   PEPPackageInitialized       = PETSC_FALSE;
 44:   PEPRegisterAllCalled        = PETSC_FALSE;
 45:   PEPMonitorRegisterAllCalled = PETSC_FALSE;
 46:   return(0);
 47: }

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

 54:    Level: developer

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

 66:   if (PEPPackageInitialized) return(0);
 67:   PEPPackageInitialized = PETSC_TRUE;
 68:   /* Register Classes */
 69:   PetscClassIdRegister("PEP Solver",&PEP_CLASSID);
 70:   /* Register Constructors */
 71:   PEPRegisterAll();
 72:   /* Register Monitors */
 73:   PEPMonitorRegisterAll();
 74:   /* Register Events */
 75:   PetscLogEventRegister("PEPSetUp",PEP_CLASSID,&PEP_SetUp);
 76:   PetscLogEventRegister("PEPSolve",PEP_CLASSID,&PEP_Solve);
 77:   PetscLogEventRegister("PEPRefine",PEP_CLASSID,&PEP_Refine);
 78:   PetscLogEventRegister("PEPCISS_SVD",PEP_CLASSID,&PEP_CISS_SVD);
 79:   /* Process Info */
 80:   classids[0] = PEP_CLASSID;
 81:   PetscInfoProcessClass("pep",1,&classids[0]);
 82:   /* Process summary exclusions */
 83:   PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
 84:   if (opt) {
 85:     PetscStrInList("pep",logList,',',&pkg);
 86:     if (pkg) { PetscLogEventDeactivateClass(PEP_CLASSID); }
 87:   }
 88:   /* Register package finalizer */
 89:   PetscRegisterFinalize(PEPFinalizePackage);
 90:   return(0);
 91: }

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

 98:   This one registers all the PEP methods that are in the basic SLEPc libslepcpep
 99:   library.
100:  */
101: SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcpep()
102: {

106:   PEPInitializePackage();
107:   return(0);
108: }
109: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */