Actual source code: dlregismfn.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/mfnimpl.h>

 24: static PetscBool MFNPackageInitialized = PETSC_FALSE;

 28: /*@C
 29:   MFNFinalizePackage - This function destroys everything in the SLEPc interface
 30:   to the MFN package. It is called from SlepcFinalize().

 32:   Level: developer

 34: .seealso: SlepcFinalize()
 35: @*/
 36: PetscErrorCode MFNFinalizePackage(void)
 37: {

 41:   PetscFunctionListDestroy(&MFNList);
 42:   MFNPackageInitialized = PETSC_FALSE;
 43:   MFNRegisterAllCalled  = PETSC_FALSE;
 44:   return(0);
 45: }

 49: /*@C
 50:   MFNInitializePackage - This function initializes everything in the MFN package.
 51:   It is called from PetscDLLibraryRegister() when using dynamic libraries, and
 52:   on the first call to MFNCreate() when using static libraries.

 54:   Level: developer

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

 66:   if (MFNPackageInitialized) return(0);
 67:   MFNPackageInitialized = PETSC_TRUE;
 68:   /* Register Classes */
 69:   PetscClassIdRegister("Matrix Function",&MFN_CLASSID);
 70:   /* Register Constructors */
 71:   MFNRegisterAll();
 72:   /* Register Events */
 73:   PetscLogEventRegister("MFNSetUp",MFN_CLASSID,&MFN_SetUp);
 74:   PetscLogEventRegister("MFNSolve",MFN_CLASSID,&MFN_Solve);
 75:   /* Process info exclusions */
 76:   PetscOptionsGetString(NULL,"-info_exclude",logList,256,&opt);
 77:   if (opt) {
 78:     PetscStrstr(logList,"mfn",&className);
 79:     if (className) {
 80:       PetscInfoDeactivateClass(MFN_CLASSID);
 81:     }
 82:   }
 83:   /* Process summary exclusions */
 84:   PetscOptionsGetString(NULL,"-log_summary_exclude",logList,256,&opt);
 85:   if (opt) {
 86:     PetscStrstr(logList,"mfn",&className);
 87:     if (className) {
 88:       PetscLogEventDeactivateClass(MFN_CLASSID);
 89:     }
 90:   }
 91:   PetscRegisterFinalize(MFNFinalizePackage);
 92:   return(0);
 93: }

 95: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)

 99: /*
100:   PetscDLLibraryRegister - This function is called when the dynamic library
101:   it is in is opened.

103:   This one registers all the MFN methods that are in the basic SLEPc libslepcmfn
104:   library.
105:  */
106: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcmfn()
107: {

111:   MFNInitializePackage();
112:   return(0);
113: }
114: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */