Date: 2021-02-01T14:42:20+00:00

Actual source code: dlregismfn.c
slepc-3.14.2 2021-02-01
Report Typos and Errors

      1: /*
      2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
      4:    Copyright (c) 2002-2020, Universitat Politecnica de Valencia, Spain

      6:    This file is part of SLEPc.
      7:    SLEPc is distributed under a 2-clause BSD license (see LICENSE).
      8:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      9: */

     11: #include <slepc/private/mfnimpl.h>

     13: static PetscBool MFNPackageInitialized = PETSC_FALSE;

     15: const char *const MFNConvergedReasons_Shifted[] = {"DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_ITS","MFNConvergedReason","MFN_",0};
     16: const char *const*MFNConvergedReasons = MFNConvergedReasons_Shifted + 2;

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

     22:   Level: developer

     24: .seealso: SlepcFinalize()
     25: @*/
     26: PetscErrorCode MFNFinalizePackage(void)
     27: {

     31:   PetscFunctionListDestroy(&MFNList);
     32:   MFNPackageInitialized = PETSC_FALSE;
     33:   MFNRegisterAllCalled  = PETSC_FALSE;
     34:   return(0);
     35: }

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

     42:   Level: developer

     44: .seealso: SlepcInitialize()
     45: @*/
     46: PetscErrorCode MFNInitializePackage(void)
     47: {
     48:   char           logList[256];
     49:   PetscBool      opt,pkg;
     50:   PetscClassId   classids[1];

     54:   if (MFNPackageInitialized) return(0);
     55:   MFNPackageInitialized = PETSC_TRUE;
     56:   /* Register Classes */
     57:   PetscClassIdRegister("Matrix Function",&MFN_CLASSID);
     58:   /* Register Constructors */
     59:   MFNRegisterAll();
     60:   /* Register Events */
     61:   PetscLogEventRegister("MFNSetUp",MFN_CLASSID,&MFN_SetUp);
     62:   PetscLogEventRegister("MFNSolve",MFN_CLASSID,&MFN_Solve);
     63:   /* Process Info */
     64:   classids[0] = MFN_CLASSID;
     65:   PetscInfoProcessClass("mfn",1,&classids[0]);
     66:   /* Process summary exclusions */
     67:   PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
     68:   if (opt) {
     69:     PetscStrInList("mfn",logList,',',&pkg);
     70:     if (pkg) { PetscLogEventDeactivateClass(MFN_CLASSID); }
     71:   }
     72:   /* Register package finalizer */
     73:   PetscRegisterFinalize(MFNFinalizePackage);
     74:   return(0);
     75: }

     77: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
     78: /*
     79:   PetscDLLibraryRegister - This function is called when the dynamic library
     80:   it is in is opened.

     82:   This one registers all the MFN methods that are in the basic SLEPc libslepcmfn
     83:   library.
     84:  */
     85: SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcmfn()
     86: {

     90:   MFNInitializePackage();
     91:   return(0);
     92: }
     93: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */