LCOV - code coverage report
Current view: top level - lme/interface - dlregislme.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 29 29 100.0 %
Date: 2019-11-15 09:58:42 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /*
       2             :    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       3             :    SLEPc - Scalable Library for Eigenvalue Problem Computations
       4             :    Copyright (c) 2002-2019, 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/lmeimpl.h>
      12             : 
      13             : static PetscBool LMEPackageInitialized = PETSC_FALSE;
      14             : 
      15             : const char *LMEProblemTypes[] = {"LYAPUNOV","SYLVESTER","GEN_LYAPUNOV","GEN_SYLVESTER","DT_LYAPUNOV","STEIN","LMEProblemType","LME_",0};
      16             : const char *const LMEConvergedReasons_Shifted[] = {"DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","LMEConvergedReason","LME_",0};
      17             : const char *const*LMEConvergedReasons = LMEConvergedReasons_Shifted + 2;
      18             : 
      19             : /*@C
      20             :   LMEFinalizePackage - This function destroys everything in the SLEPc interface
      21             :   to the LME package. It is called from SlepcFinalize().
      22             : 
      23             :   Level: developer
      24             : 
      25             : .seealso: SlepcFinalize()
      26             : @*/
      27           6 : PetscErrorCode LMEFinalizePackage(void)
      28             : {
      29             :   PetscErrorCode ierr;
      30             : 
      31           6 :   PetscFunctionBegin;
      32           6 :   ierr = PetscFunctionListDestroy(&LMEList);CHKERRQ(ierr);
      33           6 :   LMEPackageInitialized = PETSC_FALSE;
      34           6 :   LMERegisterAllCalled  = PETSC_FALSE;
      35           6 :   PetscFunctionReturn(0);
      36             : }
      37             : 
      38             : /*@C
      39             :   LMEInitializePackage - This function initializes everything in the LME package.
      40             :   It is called from PetscDLLibraryRegister() when using dynamic libraries, and
      41             :   on the first call to LMECreate() when using static libraries.
      42             : 
      43             :   Level: developer
      44             : 
      45             : .seealso: SlepcInitialize()
      46             : @*/
      47          12 : PetscErrorCode LMEInitializePackage(void)
      48             : {
      49             :   char           logList[256];
      50             :   PetscBool      opt,pkg;
      51             :   PetscErrorCode ierr;
      52             : 
      53          12 :   PetscFunctionBegin;
      54          12 :   if (LMEPackageInitialized) PetscFunctionReturn(0);
      55           6 :   LMEPackageInitialized = PETSC_TRUE;
      56             :   /* Register Classes */
      57           6 :   ierr = PetscClassIdRegister("Lin. Matrix Equation",&LME_CLASSID);CHKERRQ(ierr);
      58             :   /* Register Constructors */
      59           6 :   ierr = LMERegisterAll();CHKERRQ(ierr);
      60             :   /* Register Events */
      61           6 :   ierr = PetscLogEventRegister("LMESetUp",LME_CLASSID,&LME_SetUp);CHKERRQ(ierr);
      62           6 :   ierr = PetscLogEventRegister("LMESolve",LME_CLASSID,&LME_Solve);CHKERRQ(ierr);
      63           6 :   ierr = PetscLogEventRegister("LMEComputeError",LME_CLASSID,&LME_ComputeError);CHKERRQ(ierr);
      64             :   /* Process info exclusions */
      65           6 :   ierr = PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,sizeof(logList),&opt);CHKERRQ(ierr);
      66           6 :   if (opt) {
      67           1 :     ierr = PetscStrInList("lme",logList,',',&pkg);CHKERRQ(ierr);
      68           1 :     if (pkg) { ierr = PetscInfoDeactivateClass(LME_CLASSID);CHKERRQ(ierr); }
      69             :   }
      70             :   /* Process summary exclusions */
      71           6 :   ierr = PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);CHKERRQ(ierr);
      72           6 :   if (opt) {
      73           1 :     ierr = PetscStrInList("lme",logList,',',&pkg);CHKERRQ(ierr);
      74           1 :     if (pkg) { ierr = PetscLogEventDeactivateClass(LME_CLASSID);CHKERRQ(ierr); }
      75             :   }
      76             :   /* Register package finalizer */
      77           6 :   ierr = PetscRegisterFinalize(LMEFinalizePackage);CHKERRQ(ierr);
      78           6 :   PetscFunctionReturn(0);
      79             : }
      80             : 
      81             : #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
      82             : /*
      83             :   PetscDLLibraryRegister - This function is called when the dynamic library
      84             :   it is in is opened.
      85             : 
      86             :   This one registers all the LME methods that are in the basic SLEPc libslepclme
      87             :   library.
      88             :  */
      89           1 : SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepclme()
      90             : {
      91             :   PetscErrorCode ierr;
      92             : 
      93           1 :   PetscFunctionBegin;
      94           1 :   ierr = LMEInitializePackage();CHKERRQ(ierr);
      95           1 :   PetscFunctionReturn(0);
      96             : }
      97             : #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */
      98             : 

Generated by: LCOV version 1.13