1: /*
2: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3: SLEPc - Scalable Library for Eigenvalue Problem Computations
4: Copyright (c) 2002-2015, 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 *PEPExtractTypes[] = {"","NONE","NORM","RESIDUAL","STRUCTURED","PEPExtract","PEP_EXTRACT_",0};
30: const char *PEPErrorTypes[] = {"ABSOLUTE","RELATIVE","BACKWARD","PEPErrorType","PEP_ERROR_",0};
31: const char *const PEPConvergedReasons_Shifted[] = {"DIVERGED_SYMMETRY_LOST","DIVERGED_BREAKDOWN","DIVERGED_ITS","","","CONVERGED_ITERATING","","CONVERGED_TOL","PEPConvergedReason","PEP_",0};
32: const char *const*PEPConvergedReasons = PEPConvergedReasons_Shifted + 5;
36: /*@C
37: PEPFinalizePackage - This function destroys everything in the Slepc interface
38: to the PEP package. It is called from SlepcFinalize().
40: Level: developer
42: .seealso: SlepcFinalize()
43: @*/
44: PetscErrorCode PEPFinalizePackage(void) 45: {
49: PetscFunctionListDestroy(&PEPList);
50: PEPPackageInitialized = PETSC_FALSE;
51: PEPRegisterAllCalled = PETSC_FALSE;
52: return(0);
53: }
57: /*@C
58: PEPInitializePackage - This function initializes everything in the PEP package.
59: It is called from PetscDLLibraryRegister() when using dynamic libraries, and
60: on the first call to PEPCreate() when using static libraries.
62: Level: developer
64: .seealso: SlepcInitialize()
65: @*/
66: PetscErrorCode PEPInitializePackage(void) 67: {
68: char logList[256];
69: char *className;
70: PetscBool opt;
74: if (PEPPackageInitialized) return(0);
75: PEPPackageInitialized = PETSC_TRUE;
76: /* Register Classes */
77: PetscClassIdRegister("PEP Solver",&PEP_CLASSID);
78: /* Register Constructors */
79: PEPRegisterAll();
80: /* Register Events */
81: PetscLogEventRegister("PEPSetUp",PEP_CLASSID,&PEP_SetUp);
82: PetscLogEventRegister("PEPSolve",PEP_CLASSID,&PEP_Solve);
83: PetscLogEventRegister("PEPRefine",PEP_CLASSID,&PEP_Refine);
84: /* Process info exclusions */
85: PetscOptionsGetString(NULL,"-info_exclude",logList,256,&opt);
86: if (opt) {
87: PetscStrstr(logList,"pep",&className);
88: if (className) {
89: PetscInfoDeactivateClass(PEP_CLASSID);
90: }
91: }
92: /* Process summary exclusions */
93: PetscOptionsGetString(NULL,"-log_summary_exclude",logList,256,&opt);
94: if (opt) {
95: PetscStrstr(logList,"pep",&className);
96: if (className) {
97: PetscLogEventDeactivateClass(PEP_CLASSID);
98: }
99: }
100: PetscRegisterFinalize(PEPFinalizePackage);
101: return(0);
102: }
104: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
108: /*
109: PetscDLLibraryRegister - This function is called when the dynamic library
110: it is in is opened.
112: This one registers all the PEP methods that are in the basic SLEPc libslepcpep
113: library.
114: */
115: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcpep()116: {
120: PEPInitializePackage();
121: return(0);
122: }
123: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */