Actual source code: dlregisnep.c

slepc-3.7.4 2017-05-17
Report Typos and Errors
  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/nepimpl.h>

 24: static PetscBool NEPPackageInitialized = PETSC_FALSE;

 26: const char *NEPErrorTypes[] = {"ABSOLUTE","RELATIVE","NEPErrorType","NEP_ERROR_",0};
 27: const char *NEPRefineTypes[] = {"NONE","SIMPLE","MULTIPLE","NEPRefine","NEP_REFINE_",0};
 28: const char *NEPRefineSchemes[] = {"","SCHUR","MBE","EXPLICIT","NEPRefineScheme","NEP_REFINE_SCHEME_",0};
 29: const char *const NEPConvergedReasons_Shifted[] = {"DIVERGED_LINEAR_SOLVE","","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","NEPConvergedReason","NEP_",0};
 30: const char *const*NEPConvergedReasons = NEPConvergedReasons_Shifted + 4;

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

 38:    Level: developer

 40: .seealso: SlepcFinalize()
 41: @*/
 42: PetscErrorCode NEPFinalizePackage(void)
 43: {

 47:   PetscFunctionListDestroy(&NEPList);
 48:   NEPPackageInitialized = PETSC_FALSE;
 49:   NEPRegisterAllCalled  = PETSC_FALSE;
 50:   return(0);
 51: }

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

 60:    Level: developer

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

 72:   if (NEPPackageInitialized) return(0);
 73:   NEPPackageInitialized = PETSC_TRUE;
 74:   /* Register Classes */
 75:   PetscClassIdRegister("NEP Solver",&NEP_CLASSID);
 76:   /* Register Constructors */
 77:   NEPRegisterAll();
 78:   /* Register Events */
 79:   PetscLogEventRegister("NEPSetUp",NEP_CLASSID,&NEP_SetUp);
 80:   PetscLogEventRegister("NEPSolve",NEP_CLASSID,&NEP_Solve);
 81:   PetscLogEventRegister("NEPRefine",NEP_CLASSID,&NEP_Refine);
 82:   PetscLogEventRegister("NEPFunctionEval",NEP_CLASSID,&NEP_FunctionEval);
 83:   PetscLogEventRegister("NEPJacobianEval",NEP_CLASSID,&NEP_JacobianEval);
 84:   PetscLogEventRegister("NEPDerivativesEval",NEP_CLASSID,&NEP_DerivativesEval);
 85:   /* Process info exclusions */
 86:   PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,256,&opt);
 87:   if (opt) {
 88:     PetscStrstr(logList,"nep",&className);
 89:     if (className) {
 90:       PetscInfoDeactivateClass(NEP_CLASSID);
 91:     }
 92:   }
 93:   /* Process summary exclusions */
 94:   PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,256,&opt);
 95:   if (opt) {
 96:     PetscStrstr(logList,"nep",&className);
 97:     if (className) {
 98:       PetscLogEventDeactivateClass(NEP_CLASSID);
 99:     }
100:   }
101:   PetscRegisterFinalize(NEPFinalizePackage);
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 NEP methods that are in the basic SLEPc libslepcnep
114:   library.
115:  */
116: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcnep()
117: {

121:   NEPInitializePackage();
122:   return(0);
123: }
124: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */