Date: 2021-09-20T09:44:00+00:00

Actual source code: dlregissvd.c
slepc-3.15.2 2021-09-20
Report Typos and Errors

      1: /*
      2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
      4:    Copyright (c) 2002-2021, 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/svdimpl.h>

     13: static PetscBool SVDPackageInitialized = PETSC_FALSE;

     15: const char *SVDErrorTypes[] = {"ABSOLUTE","RELATIVE","SVDErrorType","SVD_ERROR_",0};
     16: const char *SVDPRIMMEMethods[] = {"","HYBRID","NORMALEQUATIONS","AUGMENTED","SVDPRIMMEMethod","SVD_PRIMME_",0};
     17: const char *const SVDConvergedReasons_Shifted[] = {"","","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","CONVERGED_MAXIT","SVDConvergedReason","SVD_",0};
     18: const char *const*SVDConvergedReasons = SVDConvergedReasons_Shifted + 4;

     20: /*@C
     21:    SVDFinalizePackage - This function destroys everything in the Slepc interface
     22:    to the SVD package. It is called from SlepcFinalize().

     24:    Level: developer

     26: .seealso: SlepcFinalize()
     27: @*/
     28: PetscErrorCode SVDFinalizePackage(void)
     29: {

     33:   PetscFunctionListDestroy(&SVDList);
     34:   PetscFunctionListDestroy(&SVDMonitorList);
     35:   PetscFunctionListDestroy(&SVDMonitorCreateList);
     36:   PetscFunctionListDestroy(&SVDMonitorDestroyList);
     37:   SVDPackageInitialized       = PETSC_FALSE;
     38:   SVDRegisterAllCalled        = PETSC_FALSE;
     39:   SVDMonitorRegisterAllCalled = PETSC_FALSE;
     40:   return(0);
     41: }

     43: /*@C
     44:    SVDInitializePackage - This function initializes everything in the SVD package.
     45:    It is called from PetscDLLibraryRegister() when using dynamic libraries, and
     46:    on the first call to SVDCreate() when using static libraries.

     48:    Level: developer

     50: .seealso: SlepcInitialize()
     51: @*/
     52: PetscErrorCode SVDInitializePackage(void)
     53: {
     54:   char           logList[256];
     55:   PetscBool      opt,pkg;
     56:   PetscClassId   classids[1];

     60:   if (SVDPackageInitialized) return(0);
     61:   SVDPackageInitialized = PETSC_TRUE;
     62:   /* Register Classes */
     63:   PetscClassIdRegister("SVD Solver",&SVD_CLASSID);
     64:   /* Register Constructors */
     65:   SVDRegisterAll();
     66:   /* Register Monitors */
     67:   SVDMonitorRegisterAll();
     68:   /* Register Events */
     69:   PetscLogEventRegister("SVDSetUp",SVD_CLASSID,&SVD_SetUp);
     70:   PetscLogEventRegister("SVDSolve",SVD_CLASSID,&SVD_Solve);
     71:   /* Process Info */
     72:   classids[0] = SVD_CLASSID;
     73:   PetscInfoProcessClass("svd",1,&classids[0]);
     74:   /* Process summary exclusions */
     75:   PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
     76:   if (opt) {
     77:     PetscStrInList("svd",logList,',',&pkg);
     78:     if (pkg) { PetscLogEventDeactivateClass(SVD_CLASSID); }
     79:   }
     80:   /* Register package finalizer */
     81:   PetscRegisterFinalize(SVDFinalizePackage);
     82:   return(0);
     83: }

     85: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
     86: /*
     87:   PetscDLLibraryRegister - This function is called when the dynamic library
     88:   it is in is opened.

     90:   This one registers all the SVD methods that are in the basic SLEPc libslepcsvd
     91:   library.
     92:  */
     93: SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcsvd()
     94: {

     98:   SVDInitializePackage();
     99:   return(0);
    100: }
    101: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */