LCOV - code coverage report
Current view: top level - nep/interface - dlregisnep.c (source / functions) Hit Total Coverage
Test: SLEPc Lines: 41 41 100.0 %
Date: 2021-08-02 00:35:43 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       3             :    SLEPc - Scalable Library for Eigenvalue Problem Computations
       4             :    Copyright (c) 2002-2021, Universitat Politecnica de Valencia, Spain
       5             : 
       6             :    This file is part of SLEPc.
       7             :    SLEPc is distributed under a 2-clause BSD license (see LICENSE).
       8             :    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       9             : */
      10             : 
      11             : #include <slepc/private/nepimpl.h>
      12             : 
      13             : static PetscBool NEPPackageInitialized = PETSC_FALSE;
      14             : 
      15             : const char *NEPErrorTypes[] = {"ABSOLUTE","RELATIVE","BACKWARD","NEPErrorType","NEP_ERROR_",0};
      16             : const char *NEPRefineTypes[] = {"NONE","SIMPLE","MULTIPLE","NEPRefine","NEP_REFINE_",0};
      17             : const char *NEPRefineSchemes[] = {"","SCHUR","MBE","EXPLICIT","NEPRefineScheme","NEP_REFINE_SCHEME_",0};
      18             : const char *NEPCISSExtractions[] = {"RITZ","HANKEL","CAA","NEPCISSExtraction","NEP_CISS_EXTRACTION_",0};
      19             : const char *const NEPConvergedReasons_Shifted[] = {"DIVERGED_SUBSPACE_EXHAUSTED","DIVERGED_LINEAR_SOLVE","","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","NEPConvergedReason","NEP_",0};
      20             : const char *const*NEPConvergedReasons = NEPConvergedReasons_Shifted + 5;
      21             : 
      22             : /*@C
      23             :    NEPFinalizePackage - This function destroys everything in the Slepc interface
      24             :    to the NEP package. It is called from SlepcFinalize().
      25             : 
      26             :    Level: developer
      27             : 
      28             : .seealso: SlepcFinalize()
      29             : @*/
      30         111 : PetscErrorCode NEPFinalizePackage(void)
      31             : {
      32         111 :   PetscErrorCode ierr;
      33             : 
      34         111 :   PetscFunctionBegin;
      35         111 :   ierr = PetscFunctionListDestroy(&NEPList);CHKERRQ(ierr);
      36         111 :   ierr = PetscFunctionListDestroy(&NEPMonitorList);CHKERRQ(ierr);
      37         111 :   ierr = PetscFunctionListDestroy(&NEPMonitorCreateList);CHKERRQ(ierr);
      38         111 :   ierr = PetscFunctionListDestroy(&NEPMonitorDestroyList);CHKERRQ(ierr);
      39         111 :   NEPPackageInitialized       = PETSC_FALSE;
      40         111 :   NEPRegisterAllCalled        = PETSC_FALSE;
      41         111 :   NEPMonitorRegisterAllCalled = PETSC_FALSE;
      42         111 :   PetscFunctionReturn(0);
      43             : }
      44             : 
      45             : /*@C
      46             :    NEPInitializePackage - This function initializes everything in the NEP package.
      47             :    It is called from PetscDLLibraryRegister() when using dynamic libraries, and
      48             :    on the first call to NEPCreate() when using static libraries.
      49             : 
      50             :    Level: developer
      51             : 
      52             : .seealso: SlepcInitialize()
      53             : @*/
      54        1443 : PetscErrorCode NEPInitializePackage(void)
      55             : {
      56        1443 :   char           logList[256];
      57        1443 :   PetscBool      opt,pkg;
      58        1443 :   PetscClassId   classids[1];
      59        1443 :   PetscErrorCode ierr;
      60             : 
      61        1443 :   PetscFunctionBegin;
      62        1443 :   if (NEPPackageInitialized) PetscFunctionReturn(0);
      63         111 :   NEPPackageInitialized = PETSC_TRUE;
      64             :   /* Register Classes */
      65         111 :   ierr = PetscClassIdRegister("NEP Solver",&NEP_CLASSID);CHKERRQ(ierr);
      66             :   /* Register Constructors */
      67         111 :   ierr = NEPRegisterAll();CHKERRQ(ierr);
      68             :   /* Register Monitors */
      69         111 :   ierr = NEPMonitorRegisterAll();CHKERRQ(ierr);
      70             :   /* Register Events */
      71         111 :   ierr = PetscLogEventRegister("NEPSetUp",NEP_CLASSID,&NEP_SetUp);CHKERRQ(ierr);
      72         111 :   ierr = PetscLogEventRegister("NEPSolve",NEP_CLASSID,&NEP_Solve);CHKERRQ(ierr);
      73         111 :   ierr = PetscLogEventRegister("NEPRefine",NEP_CLASSID,&NEP_Refine);CHKERRQ(ierr);
      74         111 :   ierr = PetscLogEventRegister("NEPFunctionEval",NEP_CLASSID,&NEP_FunctionEval);CHKERRQ(ierr);
      75         111 :   ierr = PetscLogEventRegister("NEPJacobianEval",NEP_CLASSID,&NEP_JacobianEval);CHKERRQ(ierr);
      76         111 :   ierr = PetscLogEventRegister("NEPResolvent",NEP_CLASSID,&NEP_Resolvent);CHKERRQ(ierr);
      77             :   /* Process Info */
      78         111 :   classids[0] = NEP_CLASSID;
      79         111 :   ierr = PetscInfoProcessClass("nep",1,&classids[0]);CHKERRQ(ierr);
      80             :   /* Process summary exclusions */
      81         111 :   ierr = PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);CHKERRQ(ierr);
      82         111 :   if (opt) {
      83           4 :     ierr = PetscStrInList("nep",logList,',',&pkg);CHKERRQ(ierr);
      84           4 :     if (pkg) { ierr = PetscLogEventDeactivateClass(NEP_CLASSID);CHKERRQ(ierr); }
      85             :   }
      86             :   /* Register package finalizer */
      87         111 :   ierr = PetscRegisterFinalize(NEPFinalizePackage);CHKERRQ(ierr);
      88         111 :   PetscFunctionReturn(0);
      89             : }
      90             : 
      91             : #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
      92             : /*
      93             :   PetscDLLibraryRegister - This function is called when the dynamic library
      94             :   it is in is opened.
      95             : 
      96             :   This one registers all the NEP methods that are in the basic SLEPc libslepcnep
      97             :   library.
      98             :  */
      99           1 : SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcnep()
     100             : {
     101           1 :   PetscErrorCode ierr;
     102             : 
     103           1 :   PetscFunctionBegin;
     104           1 :   ierr = NEPInitializePackage();CHKERRQ(ierr);
     105           1 :   PetscFunctionReturn(0);
     106             : }
     107             : #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */
     108             : 

Generated by: LCOV version 1.14