| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| 3 | SLEPc - Scalable Library for Eigenvalue Problem Computations | ||
| 4 | Copyright (c) 2002-, 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/epsimpl.h> | ||
| 12 | |||
| 13 | static PetscBool EPSPackageInitialized = PETSC_FALSE; | ||
| 14 | |||
| 15 | const char *EPSBalanceTypes[] = {"NONE","ONESIDE","TWOSIDE","USER","EPSBalance","EPS_BALANCE_",NULL}; | ||
| 16 | const char *EPSErrorTypes[] = {"ABSOLUTE","RELATIVE","BACKWARD","EPSErrorType","EPS_ERROR_",NULL}; | ||
| 17 | const char *EPSPowerShiftTypes[] = {"CONSTANT","RAYLEIGH","WILKINSON","EPSPowerShiftType","EPS_POWER_SHIFT_",NULL}; | ||
| 18 | const char *EPSKrylovSchurBSETypes[] = {"SHAO","GRUNING","PROJECTEDBSE","EPSKrylovSchurBSEType","EPS_KRYLOVSCHUR_BSE_",NULL}; | ||
| 19 | const char *EPSKrylovSchurLREPTypes[] = {"TENG","ZHONG","EPSKrylovSchurLREPType","EPS_KRYLOVSCHUR_LREP_",NULL}; | ||
| 20 | const char *EPSLanczosReorthogTypes[] = {"LOCAL","FULL","SELECTIVE","PERIODIC","PARTIAL","DELAYED","EPSLanczosReorthogType","EPS_LANCZOS_REORTHOG_",NULL}; | ||
| 21 | const char *EPSPRIMMEMethods[] = {"","DYNAMIC","DEFAULT_MIN_TIME","DEFAULT_MIN_MATVECS","ARNOLDI","GD","GD_PLUSK","GD_OLSEN_PLUSK","JD_OLSEN_PLUSK","RQI","JDQR","JDQMR","JDQMR_ETOL","SUBSPACE_ITERATION","LOBPCG_ORTHOBASIS","LOBPCG_ORTHOBASISW","EPSPRIMMEMethod","EPS_PRIMME_",NULL}; | ||
| 22 | const char *EPSCISSQuadRules[] = {"(not set yet)","TRAPEZOIDAL","CHEBYSHEV","EPSCISSQuadRule","EPS_CISS_QUADRULE_",NULL}; | ||
| 23 | const char *EPSCISSExtractions[] = {"RITZ","HANKEL","EPSCISSExtraction","EPS_CISS_EXTRACTION_",NULL}; | ||
| 24 | const char *EPSEVSLDOSMethods[] = {"KPM","LANCZOS","EPSEVSLDOSMethod","EPS_EVSL_DOS_",NULL}; | ||
| 25 | const char *EPSEVSLDampings[] = {"NONE","JACKSON","SIGMA","EPSEVSLDamping","EPS_EVSL_DAMPING_",NULL}; | ||
| 26 | const char *const EPSConvergedReasons_Shifted[] = {"","DIVERGED_SYMMETRY_LOST","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","EPSConvergedReason","EPS_",NULL}; | ||
| 27 | const char *const*EPSConvergedReasons = EPSConvergedReasons_Shifted + 4; | ||
| 28 | |||
| 29 | /*@C | ||
| 30 | EPSFinalizePackage - This function destroys everything in the SLEPc interface | ||
| 31 | to the `EPS` package. It is called from `SlepcFinalize()`. | ||
| 32 | |||
| 33 | Level: developer | ||
| 34 | |||
| 35 | .seealso: [](ch:eps), `SlepcFinalize()`, `EPSInitializePackage()` | ||
| 36 | @*/ | ||
| 37 | 6848 | PetscErrorCode EPSFinalizePackage(void) | |
| 38 | { | ||
| 39 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
6848 | PetscFunctionBegin; |
| 40 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
6848 | PetscCall(PetscFunctionListDestroy(&EPSList)); |
| 41 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
6848 | PetscCall(PetscFunctionListDestroy(&EPSMonitorList)); |
| 42 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
6848 | PetscCall(PetscFunctionListDestroy(&EPSMonitorCreateList)); |
| 43 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
6848 | PetscCall(PetscFunctionListDestroy(&EPSMonitorDestroyList)); |
| 44 | 6848 | EPSPackageInitialized = PETSC_FALSE; | |
| 45 | 6848 | EPSRegisterAllCalled = PETSC_FALSE; | |
| 46 | 6848 | EPSMonitorRegisterAllCalled = PETSC_FALSE; | |
| 47 |
6/12✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
|
6848 | PetscFunctionReturn(PETSC_SUCCESS); |
| 48 | } | ||
| 49 | |||
| 50 | /*@C | ||
| 51 | EPSInitializePackage - This function initializes everything in the `EPS` package. | ||
| 52 | It is called from `PetscDLLibraryRegister_slepceps()` when using dynamic libraries, and | ||
| 53 | on the first call to `EPSCreate()` when using shared or static libraries. | ||
| 54 | |||
| 55 | Note: | ||
| 56 | This function never needs to be called by SLEPc users. | ||
| 57 | |||
| 58 | Level: developer | ||
| 59 | |||
| 60 | .seealso: [](ch:eps), `EPS`, `SlepcInitialize()`, `EPSFinalizePackage()` | ||
| 61 | @*/ | ||
| 62 | 150202 | PetscErrorCode EPSInitializePackage(void) | |
| 63 | { | ||
| 64 | 150202 | char logList[256]; | |
| 65 | 150202 | PetscBool opt,pkg; | |
| 66 | 150202 | PetscClassId classids[1]; | |
| 67 | |||
| 68 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
150202 | PetscFunctionBegin; |
| 69 |
8/14✓ Branch 0 taken 10 times.
✓ Branch 1 taken 10 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
|
150202 | if (EPSPackageInitialized) PetscFunctionReturn(PETSC_SUCCESS); |
| 70 | 6848 | EPSPackageInitialized = PETSC_TRUE; | |
| 71 | /* Register Classes */ | ||
| 72 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
6848 | PetscCall(PetscClassIdRegister("EPS Solver",&EPS_CLASSID)); |
| 73 | /* Register Constructors */ | ||
| 74 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
6848 | PetscCall(EPSRegisterAll()); |
| 75 | /* Register Monitors */ | ||
| 76 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
6848 | PetscCall(EPSMonitorRegisterAll()); |
| 77 | /* Register Events */ | ||
| 78 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
6848 | PetscCall(PetscLogEventRegister("EPSSetUp",EPS_CLASSID,&EPS_SetUp)); |
| 79 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
6848 | PetscCall(PetscLogEventRegister("EPSSolve",EPS_CLASSID,&EPS_Solve)); |
| 80 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
6848 | PetscCall(PetscLogEventRegister("EPSCISS_SVD",EPS_CLASSID,&EPS_CISS_SVD)); |
| 81 | /* Process Info */ | ||
| 82 | 6848 | classids[0] = EPS_CLASSID; | |
| 83 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
6848 | PetscCall(PetscInfoProcessClass("eps",1,&classids[0])); |
| 84 | /* Process summary exclusions */ | ||
| 85 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
6848 | PetscCall(PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt)); |
| 86 |
2/2✓ Branch 0 taken 10 times.
✓ Branch 1 taken 10 times.
|
6848 | if (opt) { |
| 87 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
44 | PetscCall(PetscStrInList("eps",logList,',',&pkg)); |
| 88 |
6/8✓ Branch 0 taken 10 times.
✓ Branch 1 taken 10 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 8 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
|
44 | if (pkg) PetscCall(PetscLogEventDeactivateClass(EPS_CLASSID)); |
| 89 | } | ||
| 90 | /* Register package finalizer */ | ||
| 91 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
6848 | PetscCall(PetscRegisterFinalize(EPSFinalizePackage)); |
| 92 |
6/12✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
|
1333 | PetscFunctionReturn(PETSC_SUCCESS); |
| 93 | } | ||
| 94 | |||
| 95 | #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES) | ||
| 96 | /* | ||
| 97 | PetscDLLibraryRegister - This function is called when the dynamic library | ||
| 98 | it is in is opened. | ||
| 99 | |||
| 100 | This one registers all the EPS methods that are in the basic SLEPc libslepceps | ||
| 101 | library. | ||
| 102 | */ | ||
| 103 | 10 | SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepceps(void) | |
| 104 | { | ||
| 105 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
10 | PetscFunctionBegin; |
| 106 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
10 | PetscCall(EPSInitializePackage()); |
| 107 |
6/12✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
|
2 | PetscFunctionReturn(PETSC_SUCCESS); |
| 108 | } | ||
| 109 | #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */ | ||
| 110 |