LCOV - code coverage report
Current view: top level - svd/interface - dlregissvd.c (source / functions) Hit Total Coverage
Test: SLEPc Lines: 37 37 100.0 %
Date: 2021-08-02 00:32:28 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/svdimpl.h>
      12             : 
      13             : static PetscBool SVDPackageInitialized = PETSC_FALSE;
      14             : 
      15             : const char *SVDTRLanczosGBidiags[] = {"SINGLE","UPPER","LOWER","SVDTRLanczosGBidiag","SVD_TRLANCZOS_GBIDIAG_",0};
      16             : const char *SVDErrorTypes[] = {"ABSOLUTE","RELATIVE","SVDErrorType","SVD_ERROR_",0};
      17             : const char *SVDPRIMMEMethods[] = {"","HYBRID","NORMALEQUATIONS","AUGMENTED","SVDPRIMMEMethod","SVD_PRIMME_",0};
      18             : const char *const SVDConvergedReasons_Shifted[] = {"","","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","CONVERGED_MAXIT","SVDConvergedReason","SVD_",0};
      19             : const char *const*SVDConvergedReasons = SVDConvergedReasons_Shifted + 4;
      20             : 
      21             : /*@C
      22             :    SVDFinalizePackage - This function destroys everything in the Slepc interface
      23             :    to the SVD package. It is called from SlepcFinalize().
      24             : 
      25             :    Level: developer
      26             : 
      27             : .seealso: SlepcFinalize()
      28             : @*/
      29         144 : PetscErrorCode SVDFinalizePackage(void)
      30             : {
      31         144 :   PetscErrorCode ierr;
      32             : 
      33         144 :   PetscFunctionBegin;
      34         144 :   ierr = PetscFunctionListDestroy(&SVDList);CHKERRQ(ierr);
      35         144 :   ierr = PetscFunctionListDestroy(&SVDMonitorList);CHKERRQ(ierr);
      36         144 :   ierr = PetscFunctionListDestroy(&SVDMonitorCreateList);CHKERRQ(ierr);
      37         144 :   ierr = PetscFunctionListDestroy(&SVDMonitorDestroyList);CHKERRQ(ierr);
      38         144 :   SVDPackageInitialized       = PETSC_FALSE;
      39         144 :   SVDRegisterAllCalled        = PETSC_FALSE;
      40         144 :   SVDMonitorRegisterAllCalled = PETSC_FALSE;
      41         144 :   PetscFunctionReturn(0);
      42             : }
      43             : 
      44             : /*@C
      45             :    SVDInitializePackage - This function initializes everything in the SVD package.
      46             :    It is called from PetscDLLibraryRegister() when using dynamic libraries, and
      47             :    on the first call to SVDCreate() when using static libraries.
      48             : 
      49             :    Level: developer
      50             : 
      51             : .seealso: SlepcInitialize()
      52             : @*/
      53        2016 : PetscErrorCode SVDInitializePackage(void)
      54             : {
      55        2016 :   char           logList[256];
      56        2016 :   PetscBool      opt,pkg;
      57        2016 :   PetscClassId   classids[1];
      58        2016 :   PetscErrorCode ierr;
      59             : 
      60        2016 :   PetscFunctionBegin;
      61        2016 :   if (SVDPackageInitialized) PetscFunctionReturn(0);
      62         144 :   SVDPackageInitialized = PETSC_TRUE;
      63             :   /* Register Classes */
      64         144 :   ierr = PetscClassIdRegister("SVD Solver",&SVD_CLASSID);CHKERRQ(ierr);
      65             :   /* Register Constructors */
      66         144 :   ierr = SVDRegisterAll();CHKERRQ(ierr);
      67             :   /* Register Monitors */
      68         144 :   ierr = SVDMonitorRegisterAll();CHKERRQ(ierr);
      69             :   /* Register Events */
      70         144 :   ierr = PetscLogEventRegister("SVDSetUp",SVD_CLASSID,&SVD_SetUp);CHKERRQ(ierr);
      71         144 :   ierr = PetscLogEventRegister("SVDSolve",SVD_CLASSID,&SVD_Solve);CHKERRQ(ierr);
      72             :   /* Process Info */
      73         144 :   classids[0] = SVD_CLASSID;
      74         144 :   ierr = PetscInfoProcessClass("svd",1,&classids[0]);CHKERRQ(ierr);
      75             :   /* Process summary exclusions */
      76         144 :   ierr = PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);CHKERRQ(ierr);
      77         144 :   if (opt) {
      78           1 :     ierr = PetscStrInList("svd",logList,',',&pkg);CHKERRQ(ierr);
      79           1 :     if (pkg) { ierr = PetscLogEventDeactivateClass(SVD_CLASSID);CHKERRQ(ierr); }
      80             :   }
      81             :   /* Register package finalizer */
      82         144 :   ierr = PetscRegisterFinalize(SVDFinalizePackage);CHKERRQ(ierr);
      83         144 :   PetscFunctionReturn(0);
      84             : }
      85             : 
      86             : #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
      87             : /*
      88             :   PetscDLLibraryRegister - This function is called when the dynamic library
      89             :   it is in is opened.
      90             : 
      91             :   This one registers all the SVD methods that are in the basic SLEPc libslepcsvd
      92             :   library.
      93             :  */
      94           1 : SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcsvd()
      95             : {
      96           1 :   PetscErrorCode ierr;
      97             : 
      98           1 :   PetscFunctionBegin;
      99           1 :   ierr = SVDInitializePackage();CHKERRQ(ierr);
     100           1 :   PetscFunctionReturn(0);
     101             : }
     102             : #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */
     103             : 

Generated by: LCOV version 1.14