Actual source code: slepceps.h
slepc-main 2025-03-25
1: /*
2: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3: SLEPc - Scalable Library for Eigenvalue Problem Computations
4: Copyright (c) 2002-, 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: User interface for the SLEPc linear eigenvalue solvers
12: */
14: #pragma once
16: #include <slepcst.h>
17: #include <slepcbv.h>
18: #include <slepcds.h>
19: #include <slepcrg.h>
20: #include <slepclme.h>
21: #include <petscsnes.h>
23: /* SUBMANSEC = EPS */
25: SLEPC_EXTERN PetscErrorCode EPSInitializePackage(void);
26: SLEPC_EXTERN PetscErrorCode EPSFinalizePackage(void);
28: /*S
29: EPS - Abstract SLEPc object that manages all the eigenvalue
30: problem solvers.
32: Level: beginner
34: .seealso: EPSCreate(), ST
35: S*/
36: typedef struct _p_EPS* EPS;
38: /*J
39: EPSType - String with the name of a SLEPc eigensolver
41: Level: beginner
43: .seealso: EPSSetType(), EPS
44: J*/
45: typedef const char *EPSType;
46: #define EPSPOWER "power"
47: #define EPSSUBSPACE "subspace"
48: #define EPSARNOLDI "arnoldi"
49: #define EPSLANCZOS "lanczos"
50: #define EPSKRYLOVSCHUR "krylovschur"
51: #define EPSGD "gd"
52: #define EPSJD "jd"
53: #define EPSRQCG "rqcg"
54: #define EPSLOBPCG "lobpcg"
55: #define EPSCISS "ciss"
56: #define EPSLYAPII "lyapii"
57: #define EPSLAPACK "lapack"
58: #define EPSARPACK "arpack"
59: #define EPSTRLAN "trlan"
60: #define EPSBLOPEX "blopex"
61: #define EPSPRIMME "primme"
62: #define EPSFEAST "feast"
63: #define EPSSCALAPACK "scalapack"
64: #define EPSELPA "elpa"
65: #define EPSELEMENTAL "elemental"
66: #define EPSEVSL "evsl"
67: #define EPSCHASE "chase"
69: /* Logging support */
70: SLEPC_EXTERN PetscClassId EPS_CLASSID;
72: /*E
73: EPSProblemType - Determines the type of eigenvalue problem
75: Level: beginner
77: .seealso: EPSSetProblemType(), EPSGetProblemType()
78: E*/
79: typedef enum { EPS_HEP = 1,
80: EPS_GHEP = 2,
81: EPS_NHEP = 3,
82: EPS_GNHEP = 4,
83: EPS_PGNHEP = 5,
84: EPS_GHIEP = 6,
85: EPS_BSE = 7 } EPSProblemType;
87: /*E
88: EPSExtraction - Determines the type of extraction technique employed
89: by the eigensolver
91: Level: advanced
93: .seealso: EPSSetExtraction(), EPSGetExtraction()
94: E*/
95: typedef enum { EPS_RITZ,
96: EPS_HARMONIC,
97: EPS_HARMONIC_RELATIVE,
98: EPS_HARMONIC_RIGHT,
99: EPS_HARMONIC_LARGEST,
100: EPS_REFINED,
101: EPS_REFINED_HARMONIC } EPSExtraction;
103: /*E
104: EPSWhich - Determines which part of the spectrum is requested
106: Level: intermediate
108: .seealso: EPSSetWhichEigenpairs(), EPSGetWhichEigenpairs()
109: E*/
110: typedef enum { EPS_LARGEST_MAGNITUDE = 1,
111: EPS_SMALLEST_MAGNITUDE = 2,
112: EPS_LARGEST_REAL = 3,
113: EPS_SMALLEST_REAL = 4,
114: EPS_LARGEST_IMAGINARY = 5,
115: EPS_SMALLEST_IMAGINARY = 6,
116: EPS_TARGET_MAGNITUDE = 7,
117: EPS_TARGET_REAL = 8,
118: EPS_TARGET_IMAGINARY = 9,
119: EPS_ALL = 10,
120: EPS_WHICH_USER = 11 } EPSWhich;
122: /*E
123: EPSBalance - The type of balancing used for non-Hermitian problems
125: Level: intermediate
127: .seealso: EPSSetBalance()
128: E*/
129: typedef enum { EPS_BALANCE_NONE,
130: EPS_BALANCE_ONESIDE,
131: EPS_BALANCE_TWOSIDE,
132: EPS_BALANCE_USER } EPSBalance;
133: SLEPC_EXTERN const char *EPSBalanceTypes[];
135: /*E
136: EPSErrorType - The error type used to assess accuracy of computed solutions
138: Level: intermediate
140: .seealso: EPSComputeError()
141: E*/
142: typedef enum { EPS_ERROR_ABSOLUTE,
143: EPS_ERROR_RELATIVE,
144: EPS_ERROR_BACKWARD } EPSErrorType;
145: SLEPC_EXTERN const char *EPSErrorTypes[];
147: /*E
148: EPSConv - Determines the convergence test
150: Level: intermediate
152: .seealso: EPSSetConvergenceTest(), EPSSetConvergenceTestFunction()
153: E*/
154: typedef enum { EPS_CONV_ABS,
155: EPS_CONV_REL,
156: EPS_CONV_NORM,
157: EPS_CONV_USER } EPSConv;
159: /*E
160: EPSStop - Determines the stopping test
162: Level: advanced
164: .seealso: EPSSetStoppingTest(), EPSSetStoppingTestFunction()
165: E*/
166: typedef enum { EPS_STOP_BASIC,
167: EPS_STOP_USER,
168: EPS_STOP_THRESHOLD } EPSStop;
170: /*E
171: EPSConvergedReason - Reason an eigensolver was said to
172: have converged or diverged
174: Level: intermediate
176: .seealso: EPSSolve(), EPSGetConvergedReason(), EPSSetTolerances()
177: E*/
178: typedef enum {/* converged */
179: EPS_CONVERGED_TOL = 1,
180: EPS_CONVERGED_USER = 2,
181: /* diverged */
182: EPS_DIVERGED_ITS = -1,
183: EPS_DIVERGED_BREAKDOWN = -2,
184: EPS_DIVERGED_SYMMETRY_LOST = -3,
185: EPS_CONVERGED_ITERATING = 0} EPSConvergedReason;
186: SLEPC_EXTERN const char *const*EPSConvergedReasons;
188: /*S
189: EPSStoppingCtx - Data structure (C struct) to hold additional information to
190: be used in some stopping test functions.
192: Level: advanced
194: .seealso: EPSSetStoppingTestFunction()
195: S*/
196: struct _n_EPSStoppingCtx {
197: PetscReal firstev; /* the (absolute) value of the first converged eigenvalue */
198: PetscReal lastev; /* the (absolute) value of the last converged eigenvalue */
199: PetscReal thres; /* threshold set with EPSSetThreshold() */
200: PetscBool threlative; /* threshold is relative */
201: EPSWhich which; /* which eigenvalues are being computed */
202: };
203: typedef struct _n_EPSStoppingCtx* EPSStoppingCtx;
205: SLEPC_EXTERN PetscErrorCode EPSCreate(MPI_Comm,EPS*);
206: SLEPC_EXTERN PetscErrorCode EPSDestroy(EPS*);
207: SLEPC_EXTERN PetscErrorCode EPSReset(EPS);
208: SLEPC_EXTERN PetscErrorCode EPSSetType(EPS,EPSType);
209: SLEPC_EXTERN PetscErrorCode EPSGetType(EPS,EPSType*);
210: SLEPC_EXTERN PetscErrorCode EPSSetProblemType(EPS,EPSProblemType);
211: SLEPC_EXTERN PetscErrorCode EPSGetProblemType(EPS,EPSProblemType*);
212: SLEPC_EXTERN PetscErrorCode EPSSetExtraction(EPS,EPSExtraction);
213: SLEPC_EXTERN PetscErrorCode EPSGetExtraction(EPS,EPSExtraction*);
214: SLEPC_EXTERN PetscErrorCode EPSSetBalance(EPS,EPSBalance,PetscInt,PetscReal);
215: SLEPC_EXTERN PetscErrorCode EPSGetBalance(EPS,EPSBalance*,PetscInt*,PetscReal*);
216: SLEPC_EXTERN PetscErrorCode EPSSetOperators(EPS,Mat,Mat);
217: SLEPC_EXTERN PetscErrorCode EPSGetOperators(EPS,Mat*,Mat*);
218: SLEPC_EXTERN PetscErrorCode EPSSetFromOptions(EPS);
219: SLEPC_EXTERN PetscErrorCode EPSSetDSType(EPS);
220: SLEPC_EXTERN PetscErrorCode EPSSetUp(EPS);
221: SLEPC_EXTERN PetscErrorCode EPSSolve(EPS);
222: SLEPC_EXTERN PetscErrorCode EPSView(EPS,PetscViewer);
223: SLEPC_EXTERN PetscErrorCode EPSViewFromOptions(EPS,PetscObject,const char[]);
224: SLEPC_EXTERN PetscErrorCode EPSErrorView(EPS,EPSErrorType,PetscViewer);
225: PETSC_DEPRECATED_FUNCTION(3, 6, 0, "EPSErrorView()", ) static inline PetscErrorCode EPSPrintSolution(EPS eps,PetscViewer v) {return EPSErrorView(eps,EPS_ERROR_RELATIVE,v);}
226: SLEPC_EXTERN PetscErrorCode EPSErrorViewFromOptions(EPS);
227: SLEPC_EXTERN PetscErrorCode EPSConvergedReasonView(EPS,PetscViewer);
228: SLEPC_EXTERN PetscErrorCode EPSConvergedReasonViewFromOptions(EPS);
229: PETSC_DEPRECATED_FUNCTION(3, 14, 0, "EPSConvergedReasonView()", ) static inline PetscErrorCode EPSReasonView(EPS eps,PetscViewer v) {return EPSConvergedReasonView(eps,v);}
230: PETSC_DEPRECATED_FUNCTION(3, 14, 0, "EPSConvergedReasonViewFromOptions()", ) static inline PetscErrorCode EPSReasonViewFromOptions(EPS eps) {return EPSConvergedReasonViewFromOptions(eps);}
231: SLEPC_EXTERN PetscErrorCode EPSValuesView(EPS,PetscViewer);
232: SLEPC_EXTERN PetscErrorCode EPSValuesViewFromOptions(EPS);
233: SLEPC_EXTERN PetscErrorCode EPSVectorsView(EPS,PetscViewer);
234: SLEPC_EXTERN PetscErrorCode EPSVectorsViewFromOptions(EPS);
236: SLEPC_EXTERN PetscErrorCode EPSSetTarget(EPS,PetscScalar);
237: SLEPC_EXTERN PetscErrorCode EPSGetTarget(EPS,PetscScalar*);
238: SLEPC_EXTERN PetscErrorCode EPSSetInterval(EPS,PetscReal,PetscReal);
239: SLEPC_EXTERN PetscErrorCode EPSGetInterval(EPS,PetscReal*,PetscReal*);
240: SLEPC_EXTERN PetscErrorCode EPSSetST(EPS,ST);
241: SLEPC_EXTERN PetscErrorCode EPSGetST(EPS,ST*);
242: SLEPC_EXTERN PetscErrorCode EPSSetBV(EPS,BV);
243: SLEPC_EXTERN PetscErrorCode EPSGetBV(EPS,BV*);
244: SLEPC_EXTERN PetscErrorCode EPSSetRG(EPS,RG);
245: SLEPC_EXTERN PetscErrorCode EPSGetRG(EPS,RG*);
246: SLEPC_EXTERN PetscErrorCode EPSSetDS(EPS,DS);
247: SLEPC_EXTERN PetscErrorCode EPSGetDS(EPS,DS*);
248: SLEPC_EXTERN PetscErrorCode EPSSetTolerances(EPS,PetscReal,PetscInt);
249: SLEPC_EXTERN PetscErrorCode EPSGetTolerances(EPS,PetscReal*,PetscInt*);
250: SLEPC_EXTERN PetscErrorCode EPSSetConvergenceTest(EPS,EPSConv);
251: SLEPC_EXTERN PetscErrorCode EPSGetConvergenceTest(EPS,EPSConv*);
252: SLEPC_EXTERN PetscErrorCode EPSConvergedAbsolute(EPS,PetscScalar,PetscScalar,PetscReal,PetscReal*,void*);
253: SLEPC_EXTERN PetscErrorCode EPSConvergedRelative(EPS,PetscScalar,PetscScalar,PetscReal,PetscReal*,void*);
254: SLEPC_EXTERN PetscErrorCode EPSConvergedNorm(EPS,PetscScalar,PetscScalar,PetscReal,PetscReal*,void*);
255: SLEPC_EXTERN PetscErrorCode EPSSetStoppingTest(EPS,EPSStop);
256: SLEPC_EXTERN PetscErrorCode EPSGetStoppingTest(EPS,EPSStop*);
257: SLEPC_EXTERN PetscErrorCode EPSStoppingBasic(EPS,PetscInt,PetscInt,PetscInt,PetscInt,EPSConvergedReason*,void*);
258: SLEPC_EXTERN PetscErrorCode EPSStoppingThreshold(EPS,PetscInt,PetscInt,PetscInt,PetscInt,EPSConvergedReason*,void*);
259: SLEPC_EXTERN PetscErrorCode EPSGetConvergedReason(EPS,EPSConvergedReason*);
261: SLEPC_EXTERN PetscErrorCode EPSSetDimensions(EPS,PetscInt,PetscInt,PetscInt);
262: SLEPC_EXTERN PetscErrorCode EPSGetDimensions(EPS,PetscInt*,PetscInt*,PetscInt*);
264: SLEPC_EXTERN PetscErrorCode EPSGetConverged(EPS,PetscInt*);
265: SLEPC_EXTERN PetscErrorCode EPSGetEigenpair(EPS,PetscInt,PetscScalar*,PetscScalar*,Vec,Vec);
266: SLEPC_EXTERN PetscErrorCode EPSGetEigenvalue(EPS,PetscInt,PetscScalar*,PetscScalar*);
267: SLEPC_EXTERN PetscErrorCode EPSGetEigenvector(EPS,PetscInt,Vec,Vec);
268: SLEPC_EXTERN PetscErrorCode EPSGetLeftEigenvector(EPS,PetscInt,Vec,Vec);
270: SLEPC_EXTERN PetscErrorCode EPSComputeError(EPS,PetscInt,EPSErrorType,PetscReal*);
271: PETSC_DEPRECATED_FUNCTION(3, 6, 0, "EPSComputeError()", ) static inline PetscErrorCode EPSComputeRelativeError(EPS eps,PetscInt i,PetscReal *r) {return EPSComputeError(eps,i,EPS_ERROR_RELATIVE,r);}
272: PETSC_DEPRECATED_FUNCTION(3, 6, 0, "EPSComputeError() with EPS_ERROR_ABSOLUTE", ) static inline PetscErrorCode EPSComputeResidualNorm(EPS eps,PetscInt i,PetscReal *r) {return EPSComputeError(eps,i,EPS_ERROR_ABSOLUTE,r);}
273: SLEPC_EXTERN PetscErrorCode EPSGetInvariantSubspace(EPS,Vec[]);
274: SLEPC_EXTERN PetscErrorCode EPSGetErrorEstimate(EPS,PetscInt,PetscReal*);
275: SLEPC_EXTERN PetscErrorCode EPSGetIterationNumber(EPS,PetscInt*);
277: SLEPC_EXTERN PetscErrorCode EPSSetWhichEigenpairs(EPS,EPSWhich);
278: SLEPC_EXTERN PetscErrorCode EPSGetWhichEigenpairs(EPS,EPSWhich*);
279: SLEPC_EXTERN PetscErrorCode EPSSetThreshold(EPS,PetscReal,PetscBool);
280: SLEPC_EXTERN PetscErrorCode EPSGetThreshold(EPS,PetscReal*,PetscBool*);
281: SLEPC_EXTERN PetscErrorCode EPSSetTwoSided(EPS,PetscBool);
282: SLEPC_EXTERN PetscErrorCode EPSGetTwoSided(EPS,PetscBool*);
283: SLEPC_EXTERN PetscErrorCode EPSSetTrueResidual(EPS,PetscBool);
284: SLEPC_EXTERN PetscErrorCode EPSGetTrueResidual(EPS,PetscBool*);
285: SLEPC_EXTERN PetscErrorCode EPSSetPurify(EPS,PetscBool);
286: SLEPC_EXTERN PetscErrorCode EPSGetPurify(EPS,PetscBool*);
287: SLEPC_EXTERN PetscErrorCode EPSIsGeneralized(EPS,PetscBool*);
288: SLEPC_EXTERN PetscErrorCode EPSIsHermitian(EPS,PetscBool*);
289: SLEPC_EXTERN PetscErrorCode EPSIsPositive(EPS,PetscBool*);
290: SLEPC_EXTERN PetscErrorCode EPSIsStructured(EPS,PetscBool*);
292: SLEPC_EXTERN PetscErrorCode EPSSetTrackAll(EPS,PetscBool);
293: SLEPC_EXTERN PetscErrorCode EPSGetTrackAll(EPS,PetscBool*);
295: SLEPC_EXTERN PetscErrorCode EPSSetDeflationSpace(EPS,PetscInt,Vec[]);
296: SLEPC_EXTERN PetscErrorCode EPSSetInitialSpace(EPS,PetscInt,Vec[]);
297: SLEPC_EXTERN PetscErrorCode EPSSetLeftInitialSpace(EPS,PetscInt,Vec[]);
299: SLEPC_EXTERN PetscErrorCode EPSMonitor(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt);
300: SLEPC_EXTERN PetscErrorCode EPSMonitorSet(EPS,PetscErrorCode (*)(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,void*),void*,PetscCtxDestroyFn*);
301: SLEPC_EXTERN PetscErrorCode EPSMonitorCancel(EPS);
302: SLEPC_EXTERN PetscErrorCode EPSGetMonitorContext(EPS,void*);
304: SLEPC_EXTERN PetscErrorCode EPSMonitorSetFromOptions(EPS,const char[],const char[],void*,PetscBool);
305: SLEPC_EXTERN PetscErrorCode EPSMonitorFirst(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
306: SLEPC_EXTERN PetscErrorCode EPSMonitorFirstDrawLG(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
307: SLEPC_EXTERN PetscErrorCode EPSMonitorFirstDrawLGCreate(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**);
308: SLEPC_EXTERN PetscErrorCode EPSMonitorAll(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
309: SLEPC_EXTERN PetscErrorCode EPSMonitorAllDrawLG(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
310: SLEPC_EXTERN PetscErrorCode EPSMonitorAllDrawLGCreate(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**);
311: SLEPC_EXTERN PetscErrorCode EPSMonitorConverged(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
312: SLEPC_EXTERN PetscErrorCode EPSMonitorConvergedCreate(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**);
313: SLEPC_EXTERN PetscErrorCode EPSMonitorConvergedDrawLG(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
314: SLEPC_EXTERN PetscErrorCode EPSMonitorConvergedDrawLGCreate(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**);
315: SLEPC_EXTERN PetscErrorCode EPSMonitorConvergedDestroy(PetscViewerAndFormat**);
317: SLEPC_EXTERN PetscErrorCode EPSSetOptionsPrefix(EPS,const char*);
318: SLEPC_EXTERN PetscErrorCode EPSAppendOptionsPrefix(EPS,const char*);
319: SLEPC_EXTERN PetscErrorCode EPSGetOptionsPrefix(EPS,const char*[]);
321: SLEPC_EXTERN PetscFunctionList EPSList;
322: SLEPC_EXTERN PetscFunctionList EPSMonitorList;
323: SLEPC_EXTERN PetscFunctionList EPSMonitorCreateList;
324: SLEPC_EXTERN PetscFunctionList EPSMonitorDestroyList;
325: SLEPC_EXTERN PetscErrorCode EPSRegister(const char[],PetscErrorCode(*)(EPS));
326: SLEPC_EXTERN PetscErrorCode EPSMonitorRegister(const char[],PetscViewerType,PetscViewerFormat,PetscErrorCode(*)(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*),PetscErrorCode(*)(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**),PetscErrorCode(*)(PetscViewerAndFormat**));
328: SLEPC_EXTERN PetscErrorCode EPSSetWorkVecs(EPS,PetscInt);
329: SLEPC_EXTERN PetscErrorCode EPSAllocateSolution(EPS,PetscInt);
330: SLEPC_EXTERN PetscErrorCode EPSReallocateSolution(EPS,PetscInt);
332: /*S
333: EPSConvergenceTestFn - A prototype of an EPS convergence test function that would be passed to EPSSetConvergenceTestFunction()
335: Calling Sequence:
336: + eps - eigensolver context obtained from EPSCreate()
337: . eigr - real part of the eigenvalue
338: . eigi - imaginary part of the eigenvalue
339: . res - residual norm associated to the eigenpair
340: . errest - [output] computed error estimate
341: - ctx - [optional] user-defined context for private data for the
342: convergence test routine (may be NULL)
344: Level: advanced
346: .seealso: EPSSetConvergenceTestFunction()
347: S*/
348: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode(EPSConvergenceTestFn)(EPS eps,PetscScalar eigr,PetscScalar eigi,PetscReal res,PetscReal *errest,void *ctx);
350: /*S
351: EPSStoppingTestFn - A prototype of an EPS stopping test function that would be passed to EPSSetStoppingTestFunction()
353: Calling Sequence:
354: + eps - eigensolver context obtained from EPSCreate()
355: . its - current number of iterations
356: . max_it - maximum number of iterations
357: . nconv - number of currently converged eigenpairs
358: . nev - number of requested eigenpairs
359: . reason - [output] result of the stopping test
360: - ctx - [optional] user-defined context for private data for the
361: stopping test routine (may be NULL)
363: Level: advanced
365: .seealso: EPSSetStoppingTestFunction()
366: S*/
367: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode(EPSStoppingTestFn)(EPS eps,PetscInt its,PetscInt max_it,PetscInt nconv,PetscInt nev,EPSConvergedReason *reason,void *ctx);
369: SLEPC_EXTERN PetscErrorCode EPSSetConvergenceTestFunction(EPS,EPSConvergenceTestFn*,void*,PetscCtxDestroyFn*);
370: SLEPC_EXTERN PetscErrorCode EPSSetStoppingTestFunction(EPS,EPSStoppingTestFn*,void*,PetscCtxDestroyFn*);
371: SLEPC_EXTERN PetscErrorCode EPSSetEigenvalueComparison(EPS,SlepcEigenvalueComparisonFn*,void*);
372: SLEPC_EXTERN PetscErrorCode EPSSetArbitrarySelection(EPS,SlepcArbitrarySelectionFn*,void*);
374: /* --------- options specific to particular eigensolvers -------- */
376: /*E
377: EPSPowerShiftType - determines the type of shift used in the Power iteration
379: Level: advanced
381: .seealso: EPSPowerSetShiftType(), EPSPowerGetShiftType()
382: E*/
383: typedef enum { EPS_POWER_SHIFT_CONSTANT,
384: EPS_POWER_SHIFT_RAYLEIGH,
385: EPS_POWER_SHIFT_WILKINSON } EPSPowerShiftType;
386: SLEPC_EXTERN const char *EPSPowerShiftTypes[];
388: SLEPC_EXTERN PetscErrorCode EPSPowerSetShiftType(EPS,EPSPowerShiftType);
389: SLEPC_EXTERN PetscErrorCode EPSPowerGetShiftType(EPS,EPSPowerShiftType*);
390: SLEPC_EXTERN PetscErrorCode EPSPowerSetNonlinear(EPS,PetscBool);
391: SLEPC_EXTERN PetscErrorCode EPSPowerGetNonlinear(EPS,PetscBool*);
392: SLEPC_EXTERN PetscErrorCode EPSPowerSetUpdate(EPS,PetscBool);
393: SLEPC_EXTERN PetscErrorCode EPSPowerGetUpdate(EPS,PetscBool*);
394: SLEPC_EXTERN PetscErrorCode EPSPowerSetSignNormalization(EPS,PetscBool);
395: SLEPC_EXTERN PetscErrorCode EPSPowerGetSignNormalization(EPS,PetscBool*);
396: SLEPC_EXTERN PetscErrorCode EPSPowerSetSNES(EPS,SNES);
397: SLEPC_EXTERN PetscErrorCode EPSPowerGetSNES(EPS,SNES*);
399: SLEPC_EXTERN PetscErrorCode EPSArnoldiSetDelayed(EPS,PetscBool);
400: SLEPC_EXTERN PetscErrorCode EPSArnoldiGetDelayed(EPS,PetscBool*);
402: /*E
403: EPSKrylovSchurBSEType - the method to be used in the Krylov-Schur solver
404: for the case of BSE structured eigenproblems
406: Level: advanced
408: .seealso: EPSKrylovSchurSetBSEType(), EPSKrylovSchurGetBSEType()
409: E*/
410: typedef enum { EPS_KRYLOVSCHUR_BSE_SHAO,
411: EPS_KRYLOVSCHUR_BSE_GRUNING,
412: EPS_KRYLOVSCHUR_BSE_PROJECTEDBSE } EPSKrylovSchurBSEType;
413: SLEPC_EXTERN const char *EPSKrylovSchurBSETypes[];
415: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurSetBSEType(EPS,EPSKrylovSchurBSEType);
416: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetBSEType(EPS,EPSKrylovSchurBSEType*);
417: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurSetRestart(EPS,PetscReal);
418: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetRestart(EPS,PetscReal*);
419: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurSetLocking(EPS,PetscBool);
420: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetLocking(EPS,PetscBool*);
421: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurSetPartitions(EPS,PetscInt);
422: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetPartitions(EPS,PetscInt*);
423: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurSetDetectZeros(EPS,PetscBool);
424: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetDetectZeros(EPS,PetscBool*);
425: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurSetDimensions(EPS,PetscInt,PetscInt,PetscInt);
426: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetDimensions(EPS,PetscInt*,PetscInt*,PetscInt*);
427: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurSetSubintervals(EPS,PetscReal*);
428: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetSubintervals(EPS,PetscReal*[]);
429: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetInertias(EPS,PetscInt*,PetscReal*[],PetscInt*[]);
430: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetSubcommInfo(EPS,PetscInt*,PetscInt*,Vec*);
431: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetSubcommPairs(EPS,PetscInt,PetscScalar*,Vec);
432: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetSubcommMats(EPS,Mat*,Mat*);
433: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurUpdateSubcommMats(EPS,PetscScalar,PetscScalar,Mat,PetscScalar,PetscScalar, Mat,MatStructure,PetscBool);
434: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetKSP(EPS,KSP*);
436: /*E
437: EPSLanczosReorthogType - determines the type of reorthogonalization
438: used in the Lanczos method
440: Level: advanced
442: .seealso: EPSLanczosSetReorthog(), EPSLanczosGetReorthog()
443: E*/
444: typedef enum { EPS_LANCZOS_REORTHOG_LOCAL,
445: EPS_LANCZOS_REORTHOG_FULL,
446: EPS_LANCZOS_REORTHOG_SELECTIVE,
447: EPS_LANCZOS_REORTHOG_PERIODIC,
448: EPS_LANCZOS_REORTHOG_PARTIAL,
449: EPS_LANCZOS_REORTHOG_DELAYED } EPSLanczosReorthogType;
450: SLEPC_EXTERN const char *EPSLanczosReorthogTypes[];
452: SLEPC_EXTERN PetscErrorCode EPSLanczosSetReorthog(EPS,EPSLanczosReorthogType);
453: SLEPC_EXTERN PetscErrorCode EPSLanczosGetReorthog(EPS,EPSLanczosReorthogType*);
455: /*E
456: EPSPRIMMEMethod - determines the method selected in the PRIMME library
458: Level: advanced
460: .seealso: EPSPRIMMESetMethod(), EPSPRIMMEGetMethod()
461: E*/
462: typedef enum { EPS_PRIMME_DYNAMIC = 1,
463: EPS_PRIMME_DEFAULT_MIN_TIME = 2,
464: EPS_PRIMME_DEFAULT_MIN_MATVECS = 3,
465: EPS_PRIMME_ARNOLDI = 4,
466: EPS_PRIMME_GD = 5,
467: EPS_PRIMME_GD_PLUSK = 6,
468: EPS_PRIMME_GD_OLSEN_PLUSK = 7,
469: EPS_PRIMME_JD_OLSEN_PLUSK = 8,
470: EPS_PRIMME_RQI = 9,
471: EPS_PRIMME_JDQR = 10,
472: EPS_PRIMME_JDQMR = 11,
473: EPS_PRIMME_JDQMR_ETOL = 12,
474: EPS_PRIMME_SUBSPACE_ITERATION = 13,
475: EPS_PRIMME_LOBPCG_ORTHOBASIS = 14,
476: EPS_PRIMME_LOBPCG_ORTHOBASISW = 15 } EPSPRIMMEMethod;
477: SLEPC_EXTERN const char *EPSPRIMMEMethods[];
479: SLEPC_EXTERN PetscErrorCode EPSPRIMMESetBlockSize(EPS,PetscInt);
480: SLEPC_EXTERN PetscErrorCode EPSPRIMMEGetBlockSize(EPS,PetscInt*);
481: SLEPC_EXTERN PetscErrorCode EPSPRIMMESetMethod(EPS,EPSPRIMMEMethod);
482: SLEPC_EXTERN PetscErrorCode EPSPRIMMEGetMethod(EPS,EPSPRIMMEMethod*);
484: SLEPC_EXTERN PetscErrorCode EPSGDSetKrylovStart(EPS,PetscBool);
485: SLEPC_EXTERN PetscErrorCode EPSGDGetKrylovStart(EPS,PetscBool*);
486: SLEPC_EXTERN PetscErrorCode EPSGDSetBlockSize(EPS,PetscInt);
487: SLEPC_EXTERN PetscErrorCode EPSGDGetBlockSize(EPS,PetscInt*);
488: SLEPC_EXTERN PetscErrorCode EPSGDSetRestart(EPS,PetscInt,PetscInt);
489: SLEPC_EXTERN PetscErrorCode EPSGDGetRestart(EPS,PetscInt*,PetscInt*);
490: SLEPC_EXTERN PetscErrorCode EPSGDSetInitialSize(EPS,PetscInt);
491: SLEPC_EXTERN PetscErrorCode EPSGDGetInitialSize(EPS,PetscInt*);
492: SLEPC_EXTERN PetscErrorCode EPSGDSetBOrth(EPS,PetscBool);
493: SLEPC_EXTERN PetscErrorCode EPSGDGetBOrth(EPS,PetscBool*);
494: SLEPC_EXTERN PetscErrorCode EPSGDSetDoubleExpansion(EPS,PetscBool);
495: SLEPC_EXTERN PetscErrorCode EPSGDGetDoubleExpansion(EPS,PetscBool*);
497: SLEPC_EXTERN PetscErrorCode EPSJDSetKrylovStart(EPS,PetscBool);
498: SLEPC_EXTERN PetscErrorCode EPSJDGetKrylovStart(EPS,PetscBool*);
499: SLEPC_EXTERN PetscErrorCode EPSJDSetBlockSize(EPS,PetscInt);
500: SLEPC_EXTERN PetscErrorCode EPSJDGetBlockSize(EPS,PetscInt*);
501: SLEPC_EXTERN PetscErrorCode EPSJDSetRestart(EPS,PetscInt,PetscInt);
502: SLEPC_EXTERN PetscErrorCode EPSJDGetRestart(EPS,PetscInt*,PetscInt*);
503: SLEPC_EXTERN PetscErrorCode EPSJDSetInitialSize(EPS,PetscInt);
504: SLEPC_EXTERN PetscErrorCode EPSJDGetInitialSize(EPS,PetscInt*);
505: SLEPC_EXTERN PetscErrorCode EPSJDSetFix(EPS,PetscReal);
506: SLEPC_EXTERN PetscErrorCode EPSJDGetFix(EPS,PetscReal*);
507: SLEPC_EXTERN PetscErrorCode EPSJDSetConstCorrectionTol(EPS,PetscBool);
508: SLEPC_EXTERN PetscErrorCode EPSJDGetConstCorrectionTol(EPS,PetscBool*);
509: SLEPC_EXTERN PetscErrorCode EPSJDSetBOrth(EPS,PetscBool);
510: SLEPC_EXTERN PetscErrorCode EPSJDGetBOrth(EPS,PetscBool*);
512: SLEPC_EXTERN PetscErrorCode EPSRQCGSetReset(EPS,PetscInt);
513: SLEPC_EXTERN PetscErrorCode EPSRQCGGetReset(EPS,PetscInt*);
515: SLEPC_EXTERN PetscErrorCode EPSLOBPCGSetBlockSize(EPS,PetscInt);
516: SLEPC_EXTERN PetscErrorCode EPSLOBPCGGetBlockSize(EPS,PetscInt*);
517: SLEPC_EXTERN PetscErrorCode EPSLOBPCGSetRestart(EPS,PetscReal);
518: SLEPC_EXTERN PetscErrorCode EPSLOBPCGGetRestart(EPS,PetscReal*);
519: SLEPC_EXTERN PetscErrorCode EPSLOBPCGSetLocking(EPS,PetscBool);
520: SLEPC_EXTERN PetscErrorCode EPSLOBPCGGetLocking(EPS,PetscBool*);
522: /*E
523: EPSCISSQuadRule - determines the quadrature rule in the CISS solver
525: Level: advanced
527: .seealso: EPSCISSSetQuadRule(), EPSCISSGetQuadRule()
528: E*/
529: typedef enum { EPS_CISS_QUADRULE_TRAPEZOIDAL = 1,
530: EPS_CISS_QUADRULE_CHEBYSHEV = 2 } EPSCISSQuadRule;
531: SLEPC_EXTERN const char *EPSCISSQuadRules[];
533: /*E
534: EPSCISSExtraction - determines the extraction technique in the CISS solver
536: Level: advanced
538: .seealso: EPSCISSSetExtraction(), EPSCISSGetExtraction()
539: E*/
540: typedef enum { EPS_CISS_EXTRACTION_RITZ,
541: EPS_CISS_EXTRACTION_HANKEL } EPSCISSExtraction;
542: SLEPC_EXTERN const char *EPSCISSExtractions[];
544: SLEPC_EXTERN PetscErrorCode EPSCISSSetExtraction(EPS,EPSCISSExtraction);
545: SLEPC_EXTERN PetscErrorCode EPSCISSGetExtraction(EPS,EPSCISSExtraction*);
546: SLEPC_EXTERN PetscErrorCode EPSCISSSetQuadRule(EPS,EPSCISSQuadRule);
547: SLEPC_EXTERN PetscErrorCode EPSCISSGetQuadRule(EPS,EPSCISSQuadRule*);
548: SLEPC_EXTERN PetscErrorCode EPSCISSSetSizes(EPS,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscBool);
549: SLEPC_EXTERN PetscErrorCode EPSCISSGetSizes(EPS,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscBool*);
550: SLEPC_EXTERN PetscErrorCode EPSCISSSetThreshold(EPS,PetscReal,PetscReal);
551: SLEPC_EXTERN PetscErrorCode EPSCISSGetThreshold(EPS,PetscReal*,PetscReal*);
552: SLEPC_EXTERN PetscErrorCode EPSCISSSetRefinement(EPS,PetscInt,PetscInt);
553: SLEPC_EXTERN PetscErrorCode EPSCISSGetRefinement(EPS,PetscInt*,PetscInt*);
554: SLEPC_EXTERN PetscErrorCode EPSCISSSetUseST(EPS,PetscBool);
555: SLEPC_EXTERN PetscErrorCode EPSCISSGetUseST(EPS,PetscBool*);
556: SLEPC_EXTERN PetscErrorCode EPSCISSGetKSPs(EPS,PetscInt*,KSP*[]);
558: SLEPC_EXTERN PetscErrorCode EPSLyapIISetLME(EPS,LME);
559: SLEPC_EXTERN PetscErrorCode EPSLyapIIGetLME(EPS,LME*);
560: SLEPC_EXTERN PetscErrorCode EPSLyapIISetRanks(EPS,PetscInt,PetscInt);
561: SLEPC_EXTERN PetscErrorCode EPSLyapIIGetRanks(EPS,PetscInt*,PetscInt*);
563: SLEPC_EXTERN PetscErrorCode EPSBLOPEXSetBlockSize(EPS,PetscInt);
564: SLEPC_EXTERN PetscErrorCode EPSBLOPEXGetBlockSize(EPS,PetscInt*);
566: /*E
567: EPSEVSLDOSMethod - the method to approximate the density of states (DOS) in the EVSL solver
569: Level: advanced
571: .seealso: EPSEVSLSetDOSParameters(), EPSEVSLGetDOSParameters()
572: E*/
573: typedef enum { EPS_EVSL_DOS_KPM,
574: EPS_EVSL_DOS_LANCZOS } EPSEVSLDOSMethod;
575: SLEPC_EXTERN const char *EPSEVSLDOSMethods[];
577: /*E
578: EPSEVSLDamping - the damping type used in the EVSL solver
580: Level: advanced
582: .seealso: EPSEVSLSetDOSParameters(), EPSEVSLGetDOSParameters()
583: E*/
584: typedef enum { EPS_EVSL_DAMPING_NONE,
585: EPS_EVSL_DAMPING_JACKSON,
586: EPS_EVSL_DAMPING_SIGMA } EPSEVSLDamping;
587: SLEPC_EXTERN const char *EPSEVSLDampings[];
589: SLEPC_EXTERN PetscErrorCode EPSEVSLSetRange(EPS,PetscReal,PetscReal);
590: SLEPC_EXTERN PetscErrorCode EPSEVSLGetRange(EPS,PetscReal*,PetscReal*);
591: SLEPC_EXTERN PetscErrorCode EPSEVSLSetSlices(EPS,PetscInt);
592: SLEPC_EXTERN PetscErrorCode EPSEVSLGetSlices(EPS,PetscInt*);
593: SLEPC_EXTERN PetscErrorCode EPSEVSLSetDOSParameters(EPS,EPSEVSLDOSMethod,PetscInt,PetscInt,PetscInt,PetscInt);
594: SLEPC_EXTERN PetscErrorCode EPSEVSLGetDOSParameters(EPS,EPSEVSLDOSMethod*,PetscInt*,PetscInt*,PetscInt*,PetscInt*);
595: SLEPC_EXTERN PetscErrorCode EPSEVSLSetPolParameters(EPS,PetscInt,PetscReal);
596: SLEPC_EXTERN PetscErrorCode EPSEVSLGetPolParameters(EPS,PetscInt*,PetscReal*);
597: SLEPC_EXTERN PetscErrorCode EPSEVSLSetDamping(EPS,EPSEVSLDamping);
598: SLEPC_EXTERN PetscErrorCode EPSEVSLGetDamping(EPS,EPSEVSLDamping*);
600: SLEPC_EXTERN PetscErrorCode EPSFEASTSetNumPoints(EPS,PetscInt);
601: SLEPC_EXTERN PetscErrorCode EPSFEASTGetNumPoints(EPS,PetscInt*);
603: SLEPC_EXTERN PetscErrorCode EPSCHASESetDegree(EPS,PetscInt,PetscBool);
604: SLEPC_EXTERN PetscErrorCode EPSCHASEGetDegree(EPS,PetscInt*,PetscBool*);