Actual source code: dlregisnep.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/nepimpl.h>

 24: static PetscBool NEPPackageInitialized = PETSC_FALSE;

 26: const char *NEPRefineTypes[] = {"NONE","SIMPLE","MULTIPLE","NEPRefine","NEP_REFINE_",0};

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

 34:    Level: developer

 36: .seealso: SlepcFinalize()
 37: @*/
 38: PetscErrorCode NEPFinalizePackage(void)
 39: {

 43:   PetscFunctionListDestroy(&NEPList);
 44:   NEPPackageInitialized = PETSC_FALSE;
 45:   NEPRegisterAllCalled  = PETSC_FALSE;
 46:   return(0);
 47: }

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

 56:    Level: developer

 58: .seealso: SlepcInitialize()
 59: @*/
 60: PetscErrorCode NEPInitializePackage(void)
 61: {
 62:   char           logList[256];
 63:   char           *className;
 64:   PetscBool      opt;

 68:   if (NEPPackageInitialized) return(0);
 69:   NEPPackageInitialized = PETSC_TRUE;
 70:   /* Register Classes */
 71:   PetscClassIdRegister("Nonlinear Eigenvalue Problem solver",&NEP_CLASSID);
 72:   /* Register Constructors */
 73:   NEPRegisterAll();
 74:   /* Register Events */
 75:   PetscLogEventRegister("NEPSetUp",NEP_CLASSID,&NEP_SetUp);
 76:   PetscLogEventRegister("NEPSolve",NEP_CLASSID,&NEP_Solve);
 77:   PetscLogEventRegister("NEPRefine",NEP_CLASSID,&NEP_Refine);
 78:   PetscLogEventRegister("NEPFunctionEval",NEP_CLASSID,&NEP_FunctionEval);
 79:   PetscLogEventRegister("NEPJacobianEval",NEP_CLASSID,&NEP_JacobianEval);
 80:   /* Process info exclusions */
 81:   PetscOptionsGetString(NULL,"-info_exclude",logList,256,&opt);
 82:   if (opt) {
 83:     PetscStrstr(logList,"nep",&className);
 84:     if (className) {
 85:       PetscInfoDeactivateClass(NEP_CLASSID);
 86:     }
 87:   }
 88:   /* Process summary exclusions */
 89:   PetscOptionsGetString(NULL,"-log_summary_exclude",logList,256,&opt);
 90:   if (opt) {
 91:     PetscStrstr(logList,"nep",&className);
 92:     if (className) {
 93:       PetscLogEventDeactivateClass(NEP_CLASSID);
 94:     }
 95:   }
 96:   PetscRegisterFinalize(NEPFinalizePackage);
 97:   return(0);
 98: }

100: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)

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

108:   This one registers all the NEP methods that are in the basic SLEPc libslepcnep
109:   library.
110:  */
111: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcnep()
112: {

116:   NEPInitializePackage();
117:   return(0);
118: }
119: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */