1: /*
2: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3: SLEPc - Scalable Library for Eigenvalue Problem Computations
4: Copyright (c) 2002-2016, Universitat Politecnica de Valencia, Spain
6: This file is part of SLEPc.
8: SLEPc is free software: you can redistribute it and/or modify it under the
9: terms of version 3 of the GNU Lesser General Public License as published by
10: the Free Software Foundation.
12: SLEPc is distributed in the hope that it will be useful, but WITHOUT ANY
13: WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14: FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
15: more details.
17: You should have received a copy of the GNU Lesser General Public License
18: along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
19: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
20: */
22: #include <slepc/private/pepimpl.h>
24: static PetscBool PEPPackageInitialized = PETSC_FALSE;
26: const char *PEPBasisTypes[] = {"MONOMIAL","CHEBYSHEV1","CHEBYSHEV2","LEGENDRE","LAGUERRE","HERMITE","PEPBasis","PEP_BASIS_",0};
27: const char *PEPScaleTypes[] = {"NONE","SCALAR","DIAGONAL","BOTH","PEPScale","PEP_SCALE_",0};
28: const char *PEPRefineTypes[] = {"NONE","SIMPLE","MULTIPLE","PEPRefine","PEP_REFINE_",0};
29: const char *PEPRefineSchemes[] = {"","SCHUR","MBE","EXPLICIT","PEPRefineScheme","PEP_REFINE_SCHEME_",0};
30: const char *PEPExtractTypes[] = {"","NONE","NORM","RESIDUAL","STRUCTURED","PEPExtract","PEP_EXTRACT_",0};
31: const char *PEPErrorTypes[] = {"ABSOLUTE","RELATIVE","BACKWARD","PEPErrorType","PEP_ERROR_",0};
32: const char *const PEPConvergedReasons_Shifted[] = {"","DIVERGED_SYMMETRY_LOST","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","PEPConvergedReason","PEP_",0};
33: const char *const*PEPConvergedReasons = PEPConvergedReasons_Shifted + 4;
37: /*@C
38: PEPFinalizePackage - This function destroys everything in the Slepc interface
39: to the PEP package. It is called from SlepcFinalize().
41: Level: developer
43: .seealso: SlepcFinalize()
44: @*/
45: PetscErrorCode PEPFinalizePackage(void) 46: {
50: PetscFunctionListDestroy(&PEPList);
51: PEPPackageInitialized = PETSC_FALSE;
52: PEPRegisterAllCalled = PETSC_FALSE;
53: return(0);
54: }
58: /*@C
59: PEPInitializePackage - This function initializes everything in the PEP package.
60: It is called from PetscDLLibraryRegister() when using dynamic libraries, and
61: on the first call to PEPCreate() when using static libraries.
63: Level: developer
65: .seealso: SlepcInitialize()
66: @*/
67: PetscErrorCode PEPInitializePackage(void) 68: {
69: char logList[256];
70: char *className;
71: PetscBool opt;
75: if (PEPPackageInitialized) return(0);
76: PEPPackageInitialized = PETSC_TRUE;
77: /* Register Classes */
78: PetscClassIdRegister("PEP Solver",&PEP_CLASSID);
79: /* Register Constructors */
80: PEPRegisterAll();
81: /* Register Events */
82: PetscLogEventRegister("PEPSetUp",PEP_CLASSID,&PEP_SetUp);
83: PetscLogEventRegister("PEPSolve",PEP_CLASSID,&PEP_Solve);
84: PetscLogEventRegister("PEPRefine",PEP_CLASSID,&PEP_Refine);
85: /* Process info exclusions */
86: PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,256,&opt);
87: if (opt) {
88: PetscStrstr(logList,"pep",&className);
89: if (className) {
90: PetscInfoDeactivateClass(PEP_CLASSID);
91: }
92: }
93: /* Process summary exclusions */
94: PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,256,&opt);
95: if (opt) {
96: PetscStrstr(logList,"pep",&className);
97: if (className) {
98: PetscLogEventDeactivateClass(PEP_CLASSID);
99: }
100: }
101: PetscRegisterFinalize(PEPFinalizePackage);
102: return(0);
103: }
105: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
109: /*
110: PetscDLLibraryRegister - This function is called when the dynamic library
111: it is in is opened.
113: This one registers all the PEP methods that are in the basic SLEPc libslepcpep
114: library.
115: */
116: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcpep()117: {
121: PEPInitializePackage();
122: return(0);
123: }
124: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */