Actual source code: dlregispep.c

slepc-3.5.2 2014-10-10
Report Typos and Errors
  1: /*
  2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  4:    Copyright (c) 2002-2014, 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[] = {"NORM","RESIDUAL","STRUCTURED","PEPExtract","PEP_EXTRACT_",0};

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

 37:    Level: developer

 39: .seealso: SlepcFinalize()
 40: @*/
 41: PetscErrorCode PEPFinalizePackage(void)
 42: {

 46:   PetscFunctionListDestroy(&PEPList);
 47:   PEPPackageInitialized = PETSC_FALSE;
 48:   PEPRegisterAllCalled  = PETSC_FALSE;
 49:   return(0);
 50: }

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

 59:    Level: developer

 61: .seealso: SlepcInitialize()
 62: @*/
 63: PetscErrorCode PEPInitializePackage(void)
 64: {
 65:   char           logList[256];
 66:   char           *className;
 67:   PetscBool      opt;

 71:   if (PEPPackageInitialized) return(0);
 72:   PEPPackageInitialized = PETSC_TRUE;
 73:   /* Register Classes */
 74:   PetscClassIdRegister("Polynomial Eigenvalue Problem solver",&PEP_CLASSID);
 75:   /* Register Constructors */
 76:   PEPRegisterAll();
 77:   /* Register Events */
 78:   PetscLogEventRegister("PEPSetUp",PEP_CLASSID,&PEP_SetUp);
 79:   PetscLogEventRegister("PEPSolve",PEP_CLASSID,&PEP_Solve);
 80:   PetscLogEventRegister("PEPRefine",PEP_CLASSID,&PEP_Refine);
 81:   /* Process info exclusions */
 82:   PetscOptionsGetString(NULL,"-info_exclude",logList,256,&opt);
 83:   if (opt) {
 84:     PetscStrstr(logList,"pep",&className);
 85:     if (className) {
 86:       PetscInfoDeactivateClass(PEP_CLASSID);
 87:     }
 88:   }
 89:   /* Process summary exclusions */
 90:   PetscOptionsGetString(NULL,"-log_summary_exclude",logList,256,&opt);
 91:   if (opt) {
 92:     PetscStrstr(logList,"pep",&className);
 93:     if (className) {
 94:       PetscLogEventDeactivateClass(PEP_CLASSID);
 95:     }
 96:   }
 97:   PetscRegisterFinalize(PEPFinalizePackage);
 98:   return(0);
 99: }

101: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)

105: /*
106:   PetscDLLibraryRegister - This function is called when the dynamic library
107:   it is in is opened.

109:   This one registers all the PEP methods that are in the basic SLEPc libslepcpep
110:   library.
111:  */
112: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcpep()
113: {

117:   PEPInitializePackage();
118:   return(0);
119: }
120: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */