Actual source code: krylovschur.h
slepc-3.9.0 2018-04-12
1: /*
2: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3: SLEPc - Scalable Library for Eigenvalue Problem Computations
4: Copyright (c) 2002-2018, 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: */
10: /*
11: Private header for Krylov-Schur
12: */
17: PETSC_INTERN PetscErrorCode EPSReset_KrylovSchur_Slice(EPS);
18: PETSC_INTERN PetscErrorCode EPSSolve_KrylovSchur_Default(EPS);
19: PETSC_INTERN PetscErrorCode EPSSolve_KrylovSchur_Symm(EPS);
20: PETSC_INTERN PetscErrorCode EPSSolve_KrylovSchur_Slice(EPS);
21: PETSC_INTERN PetscErrorCode EPSSetUp_KrylovSchur_Slice(EPS);
22: PETSC_INTERN PetscErrorCode EPSSolve_KrylovSchur_Indefinite(EPS);
23: PETSC_INTERN PetscErrorCode EPSGetArbitraryValues(EPS,PetscScalar*,PetscScalar*);
25: /* Structure characterizing a shift in spectrum slicing */
26: typedef struct _n_shift *EPS_shift;
27: struct _n_shift {
28: PetscReal value;
29: PetscInt inertia;
30: PetscBool comp[2]; /* Shows completion of subintervals (left and right) */
31: EPS_shift neighb[2]; /* Adjacent shifts */
32: PetscInt index; /* Index in eig where found values are stored */
33: PetscInt neigs; /* Number of values found */
34: PetscReal ext[2]; /* Limits for accepted values */
35: PetscInt nsch[2]; /* Number of missing values for each subinterval */
36: PetscInt nconv[2]; /* Converged on each side (accepted or not) */
37: };
39: /* Structure for storing the state of spectrum slicing */
40: struct _n_SR {
41: PetscReal int0,int1; /* Extremes of the interval */
42: PetscInt dir; /* Determines the order of values in eig (+1 incr, -1 decr) */
43: PetscBool hasEnd; /* Tells whether the interval has an end */
44: PetscInt inertia0,inertia1;
45: PetscScalar *back;
46: PetscInt numEigs; /* Number of eigenvalues in the interval */
47: PetscInt indexEig;
48: EPS_shift sPres; /* Present shift */
49: EPS_shift *pending; /* Pending shifts array */
50: PetscInt nPend; /* Number of pending shifts */
51: PetscInt maxPend; /* Size of "pending" array */
52: PetscInt *idxDef; /* For deflation */
53: PetscInt nMAXCompl;
54: PetscInt iterCompl;
55: PetscInt itsKs; /* Krylovschur restarts */
56: PetscInt nleap;
57: EPS_shift s0; /* Initial shift */
58: PetscScalar *S; /* Matrix for projected problem */
59: PetscInt nS;
60: EPS_shift sPrev;
61: PetscInt nv; /* position of restart vector */
62: BV V; /* working basis (for subsolve) */
63: BV Vnext; /* temporary working basis during change of shift */
64: PetscScalar *eigr,*eigi; /* eigenvalues (for subsolve) */
65: PetscReal *errest; /* error estimates (for subsolve) */
66: PetscInt *perm; /* permutation (for subsolve) */
67: };
68: typedef struct _n_SR *EPS_SR;
70: typedef struct {
71: PetscReal keep; /* restart parameter */
72: PetscBool lock; /* locking/non-locking variant */
73: /* the following are used only in spectrum slicing */
74: EPS_SR sr; /* spectrum slicing context */
75: PetscInt nev; /* number of eigenvalues to compute */
76: PetscInt ncv; /* number of basis vectors */
77: PetscInt mpd; /* maximum dimension of projected problem */
78: PetscInt npart; /* number of partitions of subcommunicator */
79: PetscBool detect; /* check for zeros during factorizations */
80: PetscReal *subintervals; /* partition of global interval */
81: PetscBool subintset; /* subintervals set by user */
82: PetscMPIInt *nconv_loc; /* converged eigenpairs for each subinterval */
83: EPS eps; /* additional eps for slice runs */
84: PetscBool global; /* flag distinguishing global from local eps */
85: PetscReal *shifts; /* array containing global shifts */
86: PetscInt *inertias; /* array containing global inertias */
87: PetscInt nshifts; /* elements in the arrays of shifts and inertias */
88: PetscSubcomm subc; /* context for subcommunicators */
89: MPI_Comm commrank; /* group processes with same rank in subcommunicators */
90: PetscBool commset; /* flag indicating that commrank was created */
91: PetscObjectState Astate,Bstate; /* state of subcommunicator matrices */
92: PetscObjectId Aid,Bid; /* Id of subcommunicator matrices */
93: IS isrow,iscol; /* index sets used in update of subcomm mats */
94: Mat *submata,*submatb; /* seq matrices used in update of subcomm mats */
95: } EPS_KRYLOVSCHUR;
97: #endif