| 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/nepimpl.h> | ||
| 12 | |||
| 13 | static PetscBool NEPPackageInitialized = PETSC_FALSE; | ||
| 14 | |||
| 15 | const char *NEPErrorTypes[] = {"ABSOLUTE","RELATIVE","BACKWARD","NEPErrorType","NEP_ERROR_",NULL}; | ||
| 16 | const char *NEPRefineTypes[] = {"NONE","SIMPLE","MULTIPLE","NEPRefine","NEP_REFINE_",NULL}; | ||
| 17 | const char *NEPRefineSchemes[] = {"","SCHUR","MBE","EXPLICIT","NEPRefineScheme","NEP_REFINE_SCHEME_",NULL}; | ||
| 18 | const char *NEPCISSExtractions[] = {"RITZ","HANKEL","CAA","NEPCISSExtraction","NEP_CISS_EXTRACTION_",NULL}; | ||
| 19 | const char *const NEPConvergedReasons_Shifted[] = {"DIVERGED_SUBSPACE_EXHAUSTED","DIVERGED_LINEAR_SOLVE","","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","NEPConvergedReason","NEP_",NULL}; | ||
| 20 | const char *const*NEPConvergedReasons = NEPConvergedReasons_Shifted + 5; | ||
| 21 | |||
| 22 | /*@C | ||
| 23 | NEPFinalizePackage - This function destroys everything in the SLEPc interface | ||
| 24 | to the `NEP` package. It is called from `SlepcFinalize()`. | ||
| 25 | |||
| 26 | Level: developer | ||
| 27 | |||
| 28 | .seealso: [](ch:nep), `SlepcFinalize()`, `NEPInitializePackage()` | ||
| 29 | @*/ | ||
| 30 | 1335 | PetscErrorCode NEPFinalizePackage(void) | |
| 31 | { | ||
| 32 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
1335 | PetscFunctionBegin; |
| 33 |
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.
|
1335 | PetscCall(PetscFunctionListDestroy(&NEPList)); |
| 34 |
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.
|
1335 | PetscCall(PetscFunctionListDestroy(&NEPMonitorList)); |
| 35 |
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.
|
1335 | PetscCall(PetscFunctionListDestroy(&NEPMonitorCreateList)); |
| 36 |
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.
|
1335 | PetscCall(PetscFunctionListDestroy(&NEPMonitorDestroyList)); |
| 37 | 1335 | NEPPackageInitialized = PETSC_FALSE; | |
| 38 | 1335 | NEPRegisterAllCalled = PETSC_FALSE; | |
| 39 | 1335 | NEPMonitorRegisterAllCalled = PETSC_FALSE; | |
| 40 |
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.
|
1335 | PetscFunctionReturn(PETSC_SUCCESS); |
| 41 | } | ||
| 42 | |||
| 43 | /*@C | ||
| 44 | NEPInitializePackage - This function initializes everything in the `NEP` package. | ||
| 45 | It is called from `PetscDLLibraryRegister_slepcnep()` when using dynamic libraries, and | ||
| 46 | on the first call to `NEPCreate()` when using shared or static libraries. | ||
| 47 | |||
| 48 | Note: | ||
| 49 | This function never needs to be called by SLEPc users. | ||
| 50 | |||
| 51 | Level: developer | ||
| 52 | |||
| 53 | .seealso: [](ch:nep), `NEP`, `SlepcInitialize()`, `NEPFinalizePackage()` | ||
| 54 | @*/ | ||
| 55 | 16893 | PetscErrorCode NEPInitializePackage(void) | |
| 56 | { | ||
| 57 | 16893 | char logList[256]; | |
| 58 | 16893 | PetscBool opt,pkg; | |
| 59 | 16893 | PetscClassId classids[1]; | |
| 60 | |||
| 61 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
16893 | PetscFunctionBegin; |
| 62 |
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.
|
16893 | if (NEPPackageInitialized) PetscFunctionReturn(PETSC_SUCCESS); |
| 63 | 1335 | NEPPackageInitialized = PETSC_TRUE; | |
| 64 | /* Register Classes */ | ||
| 65 |
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.
|
1335 | PetscCall(PetscClassIdRegister("NEP Solver",&NEP_CLASSID)); |
| 66 | /* Register Constructors */ | ||
| 67 |
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.
|
1335 | PetscCall(NEPRegisterAll()); |
| 68 | /* Register Monitors */ | ||
| 69 |
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.
|
1335 | PetscCall(NEPMonitorRegisterAll()); |
| 70 | /* Register Events */ | ||
| 71 |
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.
|
1335 | PetscCall(PetscLogEventRegister("NEPSetUp",NEP_CLASSID,&NEP_SetUp)); |
| 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.
|
1335 | PetscCall(PetscLogEventRegister("NEPSolve",NEP_CLASSID,&NEP_Solve)); |
| 73 |
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.
|
1335 | PetscCall(PetscLogEventRegister("NEPRefine",NEP_CLASSID,&NEP_Refine)); |
| 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.
|
1335 | PetscCall(PetscLogEventRegister("NEPFunctionEval",NEP_CLASSID,&NEP_FunctionEval)); |
| 75 |
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.
|
1335 | PetscCall(PetscLogEventRegister("NEPJacobianEval",NEP_CLASSID,&NEP_JacobianEval)); |
| 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.
|
1335 | PetscCall(PetscLogEventRegister("NEPResolvent",NEP_CLASSID,&NEP_Resolvent)); |
| 77 |
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.
|
1335 | PetscCall(PetscLogEventRegister("NEPCISS_SVD",NEP_CLASSID,&NEP_CISS_SVD)); |
| 78 | /* Process Info */ | ||
| 79 | 1335 | classids[0] = NEP_CLASSID; | |
| 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.
|
1335 | PetscCall(PetscInfoProcessClass("nep",1,&classids[0])); |
| 81 | /* Process summary exclusions */ | ||
| 82 |
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.
|
1335 | PetscCall(PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt)); |
| 83 |
2/2✓ Branch 0 taken 10 times.
✓ Branch 1 taken 10 times.
|
1335 | if (opt) { |
| 84 |
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.
|
40 | PetscCall(PetscStrInList("nep",logList,',',&pkg)); |
| 85 |
5/8✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
✓ 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.
|
40 | if (pkg) PetscCall(PetscLogEventDeactivateClass(NEP_CLASSID)); |
| 86 | } | ||
| 87 | /* Register package finalizer */ | ||
| 88 |
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.
|
1335 | PetscCall(PetscRegisterFinalize(NEPFinalizePackage)); |
| 89 |
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.
|
247 | PetscFunctionReturn(PETSC_SUCCESS); |
| 90 | } | ||
| 91 | |||
| 92 | #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES) | ||
| 93 | /* | ||
| 94 | PetscDLLibraryRegister - This function is called when the dynamic library | ||
| 95 | it is in is opened. | ||
| 96 | |||
| 97 | This one registers all the NEP methods that are in the basic SLEPc libslepcnep | ||
| 98 | library. | ||
| 99 | */ | ||
| 100 | 10 | SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcnep(void) | |
| 101 | { | ||
| 102 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
10 | PetscFunctionBegin; |
| 103 |
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(NEPInitializePackage()); |
| 104 |
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); |
| 105 | } | ||
| 106 | #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */ | ||
| 107 |