Actual source code: dlregissvd.c

slepc-3.16.3 2022-04-11
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 *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;

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

 25:    Level: developer

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

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

 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.

 49:    Level: developer

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

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

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

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

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