Actual source code: slepceps.h

slepc-main 2024-12-17
Report Typos and Errors
  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,
 81:                EPS_NHEP,
 82:                EPS_GNHEP,
 83:                EPS_PGNHEP,
 84:                EPS_GHIEP,
 85:                EPS_BSE   } 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,
112:                EPS_LARGEST_REAL,
113:                EPS_SMALLEST_REAL,
114:                EPS_LARGEST_IMAGINARY,
115:                EPS_SMALLEST_IMAGINARY,
116:                EPS_TARGET_MAGNITUDE,
117:                EPS_TARGET_REAL,
118:                EPS_TARGET_IMAGINARY,
119:                EPS_ALL,
120:                EPS_WHICH_USER } 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 EPSMonitorLGCreate(MPI_Comm,const char[],const char[],const char[],PetscInt,const char*[],int,int,int,int,PetscDrawLG*);
306: SLEPC_EXTERN PetscErrorCode EPSMonitorFirst(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
307: SLEPC_EXTERN PetscErrorCode EPSMonitorFirstDrawLG(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
308: SLEPC_EXTERN PetscErrorCode EPSMonitorFirstDrawLGCreate(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**);
309: SLEPC_EXTERN PetscErrorCode EPSMonitorAll(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
310: SLEPC_EXTERN PetscErrorCode EPSMonitorAllDrawLG(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
311: SLEPC_EXTERN PetscErrorCode EPSMonitorAllDrawLGCreate(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**);
312: SLEPC_EXTERN PetscErrorCode EPSMonitorConverged(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
313: SLEPC_EXTERN PetscErrorCode EPSMonitorConvergedCreate(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**);
314: SLEPC_EXTERN PetscErrorCode EPSMonitorConvergedDrawLG(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
315: SLEPC_EXTERN PetscErrorCode EPSMonitorConvergedDrawLGCreate(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**);
316: SLEPC_EXTERN PetscErrorCode EPSMonitorConvergedDestroy(PetscViewerAndFormat**);

318: SLEPC_EXTERN PetscErrorCode EPSSetOptionsPrefix(EPS,const char*);
319: SLEPC_EXTERN PetscErrorCode EPSAppendOptionsPrefix(EPS,const char*);
320: SLEPC_EXTERN PetscErrorCode EPSGetOptionsPrefix(EPS,const char*[]);

322: SLEPC_EXTERN PetscFunctionList EPSList;
323: SLEPC_EXTERN PetscFunctionList EPSMonitorList;
324: SLEPC_EXTERN PetscFunctionList EPSMonitorCreateList;
325: SLEPC_EXTERN PetscFunctionList EPSMonitorDestroyList;
326: SLEPC_EXTERN PetscErrorCode EPSRegister(const char[],PetscErrorCode(*)(EPS));
327: SLEPC_EXTERN PetscErrorCode EPSMonitorRegister(const char[],PetscViewerType,PetscViewerFormat,PetscErrorCode(*)(EPS,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*),PetscErrorCode(*)(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**),PetscErrorCode(*)(PetscViewerAndFormat**));

329: SLEPC_EXTERN PetscErrorCode EPSSetWorkVecs(EPS,PetscInt);
330: SLEPC_EXTERN PetscErrorCode EPSAllocateSolution(EPS,PetscInt);
331: SLEPC_EXTERN PetscErrorCode EPSReallocateSolution(EPS,PetscInt);

333: /*S
334:   EPSConvergenceTestFn - A prototype of an EPS convergence test function that would be passed to EPSSetConvergenceTestFunction()

336:   Calling Sequence:
337: +   eps    - eigensolver context obtained from EPSCreate()
338: .   eigr   - real part of the eigenvalue
339: .   eigi   - imaginary part of the eigenvalue
340: .   res    - residual norm associated to the eigenpair
341: .   errest - [output] computed error estimate
342: -   ctx    - [optional] user-defined context for private data for the
343:              convergence test routine (may be NULL)

345:   Level: advanced

347: .seealso: EPSSetConvergenceTestFunction()
348: S*/
349: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode(EPSConvergenceTestFn)(EPS eps,PetscScalar eigr,PetscScalar eigi,PetscReal res,PetscReal *errest,void *ctx);

351: /*S
352:   EPSStoppingTestFn - A prototype of an EPS stopping test function that would be passed to EPSSetStoppingTestFunction()

354:   Calling Sequence:
355: +   eps    - eigensolver context obtained from EPSCreate()
356: .   its    - current number of iterations
357: .   max_it - maximum number of iterations
358: .   nconv  - number of currently converged eigenpairs
359: .   nev    - number of requested eigenpairs
360: .   reason - [output] result of the stopping test
361: -   ctx    - [optional] user-defined context for private data for the
362:              stopping test routine (may be NULL)

364:   Level: advanced

366: .seealso: EPSSetStoppingTestFunction()
367: S*/
368: PETSC_EXTERN_TYPEDEF typedef PetscErrorCode(EPSStoppingTestFn)(EPS eps,PetscInt its,PetscInt max_it,PetscInt nconv,PetscInt nev,EPSConvergedReason *reason,void *ctx);

370: SLEPC_EXTERN PetscErrorCode EPSSetConvergenceTestFunction(EPS,EPSConvergenceTestFn*,void*,PetscCtxDestroyFn*);
371: SLEPC_EXTERN PetscErrorCode EPSSetStoppingTestFunction(EPS,EPSStoppingTestFn*,void*,PetscCtxDestroyFn*);
372: SLEPC_EXTERN PetscErrorCode EPSSetEigenvalueComparison(EPS,SlepcEigenvalueComparisonFn*,void*);
373: SLEPC_EXTERN PetscErrorCode EPSSetArbitrarySelection(EPS,SlepcArbitrarySelectionFn*,void*);

375: /* --------- options specific to particular eigensolvers -------- */

377: /*E
378:     EPSPowerShiftType - determines the type of shift used in the Power iteration

380:     Level: advanced

382: .seealso: EPSPowerSetShiftType(), EPSPowerGetShiftType()
383: E*/
384: typedef enum { EPS_POWER_SHIFT_CONSTANT,
385:                EPS_POWER_SHIFT_RAYLEIGH,
386:                EPS_POWER_SHIFT_WILKINSON } EPSPowerShiftType;
387: SLEPC_EXTERN const char *EPSPowerShiftTypes[];

389: SLEPC_EXTERN PetscErrorCode EPSPowerSetShiftType(EPS,EPSPowerShiftType);
390: SLEPC_EXTERN PetscErrorCode EPSPowerGetShiftType(EPS,EPSPowerShiftType*);
391: SLEPC_EXTERN PetscErrorCode EPSPowerSetNonlinear(EPS,PetscBool);
392: SLEPC_EXTERN PetscErrorCode EPSPowerGetNonlinear(EPS,PetscBool*);
393: SLEPC_EXTERN PetscErrorCode EPSPowerSetUpdate(EPS,PetscBool);
394: SLEPC_EXTERN PetscErrorCode EPSPowerGetUpdate(EPS,PetscBool*);
395: SLEPC_EXTERN PetscErrorCode EPSPowerSetSignNormalization(EPS,PetscBool);
396: SLEPC_EXTERN PetscErrorCode EPSPowerGetSignNormalization(EPS,PetscBool*);
397: SLEPC_EXTERN PetscErrorCode EPSPowerSetSNES(EPS,SNES);
398: SLEPC_EXTERN PetscErrorCode EPSPowerGetSNES(EPS,SNES*);

400: SLEPC_EXTERN PetscErrorCode EPSArnoldiSetDelayed(EPS,PetscBool);
401: SLEPC_EXTERN PetscErrorCode EPSArnoldiGetDelayed(EPS,PetscBool*);

403: /*E
404:     EPSKrylovSchurBSEType - the method to be used in the Krylov-Schur solver
405:     for the case of BSE structured eigenproblems

407:     Level: advanced

409: .seealso: EPSKrylovSchurSetBSEType(), EPSKrylovSchurGetBSEType()
410: E*/
411: typedef enum { EPS_KRYLOVSCHUR_BSE_SHAO,
412:                EPS_KRYLOVSCHUR_BSE_GRUNING,
413:                EPS_KRYLOVSCHUR_BSE_PROJECTEDBSE } EPSKrylovSchurBSEType;
414: SLEPC_EXTERN const char *EPSKrylovSchurBSETypes[];

416: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurSetBSEType(EPS,EPSKrylovSchurBSEType);
417: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetBSEType(EPS,EPSKrylovSchurBSEType*);
418: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurSetRestart(EPS,PetscReal);
419: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetRestart(EPS,PetscReal*);
420: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurSetLocking(EPS,PetscBool);
421: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetLocking(EPS,PetscBool*);
422: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurSetPartitions(EPS,PetscInt);
423: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetPartitions(EPS,PetscInt*);
424: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurSetDetectZeros(EPS,PetscBool);
425: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetDetectZeros(EPS,PetscBool*);
426: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurSetDimensions(EPS,PetscInt,PetscInt,PetscInt);
427: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetDimensions(EPS,PetscInt*,PetscInt*,PetscInt*);
428: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurSetSubintervals(EPS,PetscReal*);
429: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetSubintervals(EPS,PetscReal**);
430: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetInertias(EPS,PetscInt*,PetscReal**,PetscInt**);
431: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetSubcommInfo(EPS,PetscInt*,PetscInt*,Vec*);
432: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetSubcommPairs(EPS,PetscInt,PetscScalar*,Vec);
433: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetSubcommMats(EPS,Mat*,Mat*);
434: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurUpdateSubcommMats(EPS,PetscScalar,PetscScalar,Mat,PetscScalar,PetscScalar, Mat,MatStructure,PetscBool);
435: SLEPC_EXTERN PetscErrorCode EPSKrylovSchurGetKSP(EPS,KSP*);

437: /*E
438:     EPSLanczosReorthogType - determines the type of reorthogonalization
439:     used in the Lanczos method

441:     Level: advanced

443: .seealso: EPSLanczosSetReorthog(), EPSLanczosGetReorthog()
444: E*/
445: typedef enum { EPS_LANCZOS_REORTHOG_LOCAL,
446:                EPS_LANCZOS_REORTHOG_FULL,
447:                EPS_LANCZOS_REORTHOG_SELECTIVE,
448:                EPS_LANCZOS_REORTHOG_PERIODIC,
449:                EPS_LANCZOS_REORTHOG_PARTIAL,
450:                EPS_LANCZOS_REORTHOG_DELAYED } EPSLanczosReorthogType;
451: SLEPC_EXTERN const char *EPSLanczosReorthogTypes[];

453: SLEPC_EXTERN PetscErrorCode EPSLanczosSetReorthog(EPS,EPSLanczosReorthogType);
454: SLEPC_EXTERN PetscErrorCode EPSLanczosGetReorthog(EPS,EPSLanczosReorthogType*);

456: /*E
457:     EPSPRIMMEMethod - determines the method selected in the PRIMME library

459:     Level: advanced

461: .seealso: EPSPRIMMESetMethod(), EPSPRIMMEGetMethod()
462: E*/
463: typedef enum { EPS_PRIMME_DYNAMIC=1,
464:                EPS_PRIMME_DEFAULT_MIN_TIME,
465:                EPS_PRIMME_DEFAULT_MIN_MATVECS,
466:                EPS_PRIMME_ARNOLDI,
467:                EPS_PRIMME_GD,
468:                EPS_PRIMME_GD_PLUSK,
469:                EPS_PRIMME_GD_OLSEN_PLUSK,
470:                EPS_PRIMME_JD_OLSEN_PLUSK,
471:                EPS_PRIMME_RQI,
472:                EPS_PRIMME_JDQR,
473:                EPS_PRIMME_JDQMR,
474:                EPS_PRIMME_JDQMR_ETOL,
475:                EPS_PRIMME_SUBSPACE_ITERATION,
476:                EPS_PRIMME_LOBPCG_ORTHOBASIS,
477:                EPS_PRIMME_LOBPCG_ORTHOBASISW } EPSPRIMMEMethod;
478: SLEPC_EXTERN const char *EPSPRIMMEMethods[];

480: SLEPC_EXTERN PetscErrorCode EPSPRIMMESetBlockSize(EPS,PetscInt);
481: SLEPC_EXTERN PetscErrorCode EPSPRIMMEGetBlockSize(EPS,PetscInt*);
482: SLEPC_EXTERN PetscErrorCode EPSPRIMMESetMethod(EPS,EPSPRIMMEMethod);
483: SLEPC_EXTERN PetscErrorCode EPSPRIMMEGetMethod(EPS,EPSPRIMMEMethod*);

485: SLEPC_EXTERN PetscErrorCode EPSGDSetKrylovStart(EPS,PetscBool);
486: SLEPC_EXTERN PetscErrorCode EPSGDGetKrylovStart(EPS,PetscBool*);
487: SLEPC_EXTERN PetscErrorCode EPSGDSetBlockSize(EPS,PetscInt);
488: SLEPC_EXTERN PetscErrorCode EPSGDGetBlockSize(EPS,PetscInt*);
489: SLEPC_EXTERN PetscErrorCode EPSGDSetRestart(EPS,PetscInt,PetscInt);
490: SLEPC_EXTERN PetscErrorCode EPSGDGetRestart(EPS,PetscInt*,PetscInt*);
491: SLEPC_EXTERN PetscErrorCode EPSGDSetInitialSize(EPS,PetscInt);
492: SLEPC_EXTERN PetscErrorCode EPSGDGetInitialSize(EPS,PetscInt*);
493: SLEPC_EXTERN PetscErrorCode EPSGDSetBOrth(EPS,PetscBool);
494: SLEPC_EXTERN PetscErrorCode EPSGDGetBOrth(EPS,PetscBool*);
495: SLEPC_EXTERN PetscErrorCode EPSGDSetDoubleExpansion(EPS,PetscBool);
496: SLEPC_EXTERN PetscErrorCode EPSGDGetDoubleExpansion(EPS,PetscBool*);

498: SLEPC_EXTERN PetscErrorCode EPSJDSetKrylovStart(EPS,PetscBool);
499: SLEPC_EXTERN PetscErrorCode EPSJDGetKrylovStart(EPS,PetscBool*);
500: SLEPC_EXTERN PetscErrorCode EPSJDSetBlockSize(EPS,PetscInt);
501: SLEPC_EXTERN PetscErrorCode EPSJDGetBlockSize(EPS,PetscInt*);
502: SLEPC_EXTERN PetscErrorCode EPSJDSetRestart(EPS,PetscInt,PetscInt);
503: SLEPC_EXTERN PetscErrorCode EPSJDGetRestart(EPS,PetscInt*,PetscInt*);
504: SLEPC_EXTERN PetscErrorCode EPSJDSetInitialSize(EPS,PetscInt);
505: SLEPC_EXTERN PetscErrorCode EPSJDGetInitialSize(EPS,PetscInt*);
506: SLEPC_EXTERN PetscErrorCode EPSJDSetFix(EPS,PetscReal);
507: SLEPC_EXTERN PetscErrorCode EPSJDGetFix(EPS,PetscReal*);
508: SLEPC_EXTERN PetscErrorCode EPSJDSetConstCorrectionTol(EPS,PetscBool);
509: SLEPC_EXTERN PetscErrorCode EPSJDGetConstCorrectionTol(EPS,PetscBool*);
510: SLEPC_EXTERN PetscErrorCode EPSJDSetBOrth(EPS,PetscBool);
511: SLEPC_EXTERN PetscErrorCode EPSJDGetBOrth(EPS,PetscBool*);

513: SLEPC_EXTERN PetscErrorCode EPSRQCGSetReset(EPS,PetscInt);
514: SLEPC_EXTERN PetscErrorCode EPSRQCGGetReset(EPS,PetscInt*);

516: SLEPC_EXTERN PetscErrorCode EPSLOBPCGSetBlockSize(EPS,PetscInt);
517: SLEPC_EXTERN PetscErrorCode EPSLOBPCGGetBlockSize(EPS,PetscInt*);
518: SLEPC_EXTERN PetscErrorCode EPSLOBPCGSetRestart(EPS,PetscReal);
519: SLEPC_EXTERN PetscErrorCode EPSLOBPCGGetRestart(EPS,PetscReal*);
520: SLEPC_EXTERN PetscErrorCode EPSLOBPCGSetLocking(EPS,PetscBool);
521: SLEPC_EXTERN PetscErrorCode EPSLOBPCGGetLocking(EPS,PetscBool*);

523: /*E
524:     EPSCISSQuadRule - determines the quadrature rule in the CISS solver

526:     Level: advanced

528: .seealso: EPSCISSSetQuadRule(), EPSCISSGetQuadRule()
529: E*/
530: typedef enum { EPS_CISS_QUADRULE_TRAPEZOIDAL=1,
531:                EPS_CISS_QUADRULE_CHEBYSHEV } EPSCISSQuadRule;
532: SLEPC_EXTERN const char *EPSCISSQuadRules[];

534: /*E
535:     EPSCISSExtraction - determines the extraction technique in the CISS solver

537:     Level: advanced

539: .seealso: EPSCISSSetExtraction(), EPSCISSGetExtraction()
540: E*/
541: typedef enum { EPS_CISS_EXTRACTION_RITZ,
542:                EPS_CISS_EXTRACTION_HANKEL } EPSCISSExtraction;
543: SLEPC_EXTERN const char *EPSCISSExtractions[];

545: SLEPC_EXTERN PetscErrorCode EPSCISSSetExtraction(EPS,EPSCISSExtraction);
546: SLEPC_EXTERN PetscErrorCode EPSCISSGetExtraction(EPS,EPSCISSExtraction*);
547: SLEPC_EXTERN PetscErrorCode EPSCISSSetQuadRule(EPS,EPSCISSQuadRule);
548: SLEPC_EXTERN PetscErrorCode EPSCISSGetQuadRule(EPS,EPSCISSQuadRule*);
549: SLEPC_EXTERN PetscErrorCode EPSCISSSetSizes(EPS,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscBool);
550: SLEPC_EXTERN PetscErrorCode EPSCISSGetSizes(EPS,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscBool*);
551: SLEPC_EXTERN PetscErrorCode EPSCISSSetThreshold(EPS,PetscReal,PetscReal);
552: SLEPC_EXTERN PetscErrorCode EPSCISSGetThreshold(EPS,PetscReal*,PetscReal*);
553: SLEPC_EXTERN PetscErrorCode EPSCISSSetRefinement(EPS,PetscInt,PetscInt);
554: SLEPC_EXTERN PetscErrorCode EPSCISSGetRefinement(EPS,PetscInt*,PetscInt*);
555: SLEPC_EXTERN PetscErrorCode EPSCISSSetUseST(EPS,PetscBool);
556: SLEPC_EXTERN PetscErrorCode EPSCISSGetUseST(EPS,PetscBool*);
557: SLEPC_EXTERN PetscErrorCode EPSCISSGetKSPs(EPS,PetscInt*,KSP**);

559: SLEPC_EXTERN PetscErrorCode EPSLyapIISetLME(EPS,LME);
560: SLEPC_EXTERN PetscErrorCode EPSLyapIIGetLME(EPS,LME*);
561: SLEPC_EXTERN PetscErrorCode EPSLyapIISetRanks(EPS,PetscInt,PetscInt);
562: SLEPC_EXTERN PetscErrorCode EPSLyapIIGetRanks(EPS,PetscInt*,PetscInt*);

564: SLEPC_EXTERN PetscErrorCode EPSBLOPEXSetBlockSize(EPS,PetscInt);
565: SLEPC_EXTERN PetscErrorCode EPSBLOPEXGetBlockSize(EPS,PetscInt*);

567: /*E
568:     EPSEVSLDOSMethod - the method to approximate the density of states (DOS) in the EVSL solver

570:     Level: advanced

572: .seealso: EPSEVSLSetDOSParameters(), EPSEVSLGetDOSParameters()
573: E*/
574: typedef enum { EPS_EVSL_DOS_KPM,
575:                EPS_EVSL_DOS_LANCZOS } EPSEVSLDOSMethod;
576: SLEPC_EXTERN const char *EPSEVSLDOSMethods[];

578: /*E
579:     EPSEVSLDamping - the damping type used in the EVSL solver

581:     Level: advanced

583: .seealso: EPSEVSLSetDOSParameters(), EPSEVSLGetDOSParameters()
584: E*/
585: typedef enum { EPS_EVSL_DAMPING_NONE,
586:                EPS_EVSL_DAMPING_JACKSON,
587:                EPS_EVSL_DAMPING_SIGMA } EPSEVSLDamping;
588: SLEPC_EXTERN const char *EPSEVSLDampings[];

590: SLEPC_EXTERN PetscErrorCode EPSEVSLSetRange(EPS,PetscReal,PetscReal);
591: SLEPC_EXTERN PetscErrorCode EPSEVSLGetRange(EPS,PetscReal*,PetscReal*);
592: SLEPC_EXTERN PetscErrorCode EPSEVSLSetSlices(EPS,PetscInt);
593: SLEPC_EXTERN PetscErrorCode EPSEVSLGetSlices(EPS,PetscInt*);
594: SLEPC_EXTERN PetscErrorCode EPSEVSLSetDOSParameters(EPS,EPSEVSLDOSMethod,PetscInt,PetscInt,PetscInt,PetscInt);
595: SLEPC_EXTERN PetscErrorCode EPSEVSLGetDOSParameters(EPS,EPSEVSLDOSMethod*,PetscInt*,PetscInt*,PetscInt*,PetscInt*);
596: SLEPC_EXTERN PetscErrorCode EPSEVSLSetPolParameters(EPS,PetscInt,PetscReal);
597: SLEPC_EXTERN PetscErrorCode EPSEVSLGetPolParameters(EPS,PetscInt*,PetscReal*);
598: SLEPC_EXTERN PetscErrorCode EPSEVSLSetDamping(EPS,EPSEVSLDamping);
599: SLEPC_EXTERN PetscErrorCode EPSEVSLGetDamping(EPS,EPSEVSLDamping*);

601: SLEPC_EXTERN PetscErrorCode EPSFEASTSetNumPoints(EPS,PetscInt);
602: SLEPC_EXTERN PetscErrorCode EPSFEASTGetNumPoints(EPS,PetscInt*);

604: SLEPC_EXTERN PetscErrorCode EPSCHASESetDegree(EPS,PetscInt,PetscBool);
605: SLEPC_EXTERN PetscErrorCode EPSCHASEGetDegree(EPS,PetscInt*,PetscBool*);