Actual source code: slepcpep.h

slepc-3.18.2 2023-01-26
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 SLEPc's polynomial eigenvalue solvers
 12: */

 14: #if !defined(SLEPCPEP_H)
 15: #define SLEPCPEP_H

 17: #include <slepceps.h>

 19: /* SUBMANSEC = PEP */

 21: SLEPC_EXTERN PetscErrorCode PEPInitializePackage(void);

 23: /*S
 24:      PEP - Abstract SLEPc object that manages all the polynomial eigenvalue
 25:      problem solvers.

 27:    Level: beginner

 29: .seealso:  PEPCreate()
 30: S*/
 31: typedef struct _p_PEP* PEP;

 33: /*J
 34:     PEPType - String with the name of a polynomial eigensolver

 36:    Level: beginner

 38: .seealso: PEPSetType(), PEP
 39: J*/
 40: typedef const char* PEPType;
 41: #define PEPLINEAR    "linear"
 42: #define PEPQARNOLDI  "qarnoldi"
 43: #define PEPTOAR      "toar"
 44: #define PEPSTOAR     "stoar"
 45: #define PEPJD        "jd"
 46: #define PEPCISS      "ciss"

 48: /* Logging support */
 49: SLEPC_EXTERN PetscClassId PEP_CLASSID;

 51: /*E
 52:     PEPProblemType - Determines the type of the polynomial eigenproblem

 54:     Level: intermediate

 56: .seealso: PEPSetProblemType(), PEPGetProblemType()
 57: E*/
 58: typedef enum { PEP_GENERAL=1,
 59:                PEP_HERMITIAN,   /* All A_i  Hermitian */
 60:                PEP_HYPERBOLIC,  /* QEP with Hermitian matrices, M>0, (x'Cx)^2 > 4(x'Mx)(x'Kx) */
 61:                PEP_GYROSCOPIC   /* QEP with M, K  Hermitian, M>0, C skew-Hermitian */
 62:              } PEPProblemType;

 64: /*E
 65:     PEPWhich - Determines which part of the spectrum is requested

 67:     Level: intermediate

 69: .seealso: PEPSetWhichEigenpairs(), PEPGetWhichEigenpairs()
 70: E*/
 71: typedef enum { PEP_LARGEST_MAGNITUDE=1,
 72:                PEP_SMALLEST_MAGNITUDE,
 73:                PEP_LARGEST_REAL,
 74:                PEP_SMALLEST_REAL,
 75:                PEP_LARGEST_IMAGINARY,
 76:                PEP_SMALLEST_IMAGINARY,
 77:                PEP_TARGET_MAGNITUDE,
 78:                PEP_TARGET_REAL,
 79:                PEP_TARGET_IMAGINARY,
 80:                PEP_ALL,
 81:                PEP_WHICH_USER } PEPWhich;

 83: /*E
 84:     PEPBasis - The type of polynomial basis used to represent the polynomial
 85:     eigenproblem

 87:     Level: intermediate

 89: .seealso: PEPSetBasis()
 90: E*/
 91: typedef enum { PEP_BASIS_MONOMIAL,
 92:                PEP_BASIS_CHEBYSHEV1,
 93:                PEP_BASIS_CHEBYSHEV2,
 94:                PEP_BASIS_LEGENDRE,
 95:                PEP_BASIS_LAGUERRE,
 96:                PEP_BASIS_HERMITE } PEPBasis;
 97: SLEPC_EXTERN const char *PEPBasisTypes[];

 99: /*E
100:     PEPScale - The scaling strategy

102:     Level: intermediate

104: .seealso: PEPSetScale()
105: E*/
106: typedef enum { PEP_SCALE_NONE,
107:                PEP_SCALE_SCALAR,
108:                PEP_SCALE_DIAGONAL,
109:                PEP_SCALE_BOTH } PEPScale;
110: SLEPC_EXTERN const char *PEPScaleTypes[];

112: /*E
113:     PEPRefine - The refinement type

115:     Level: intermediate

117: .seealso: PEPSetRefine()
118: E*/
119: typedef enum { PEP_REFINE_NONE,
120:                PEP_REFINE_SIMPLE,
121:                PEP_REFINE_MULTIPLE } PEPRefine;
122: SLEPC_EXTERN const char *PEPRefineTypes[];

124: /*E
125:     PEPRefineScheme - The scheme used for solving linear systems during iterative refinement

127:     Level: intermediate

129: .seealso: PEPSetRefine()
130: E*/
131: typedef enum { PEP_REFINE_SCHEME_SCHUR=1,
132:                PEP_REFINE_SCHEME_MBE,
133:                PEP_REFINE_SCHEME_EXPLICIT } PEPRefineScheme;
134: SLEPC_EXTERN const char *PEPRefineSchemes[];

136: /*E
137:     PEPExtract - The extraction type

139:     Level: intermediate

141: .seealso: PEPSetExtract()
142: E*/
143: typedef enum { PEP_EXTRACT_NONE=1,
144:                PEP_EXTRACT_NORM,
145:                PEP_EXTRACT_RESIDUAL,
146:                PEP_EXTRACT_STRUCTURED } PEPExtract;
147: SLEPC_EXTERN const char *PEPExtractTypes[];

149: /*E
150:     PEPErrorType - The error type used to assess accuracy of computed solutions

152:     Level: intermediate

154: .seealso: PEPComputeError()
155: E*/
156: typedef enum { PEP_ERROR_ABSOLUTE,
157:                PEP_ERROR_RELATIVE,
158:                PEP_ERROR_BACKWARD } PEPErrorType;
159: SLEPC_EXTERN const char *PEPErrorTypes[];

161: /*E
162:     PEPConv - Determines the convergence test

164:     Level: intermediate

166: .seealso: PEPSetConvergenceTest(), PEPSetConvergenceTestFunction()
167: E*/
168: typedef enum { PEP_CONV_ABS,
169:                PEP_CONV_REL,
170:                PEP_CONV_NORM,
171:                PEP_CONV_USER } PEPConv;

173: /*E
174:     PEPStop - Determines the stopping test

176:     Level: advanced

178: .seealso: PEPSetStoppingTest(), PEPSetStoppingTestFunction()
179: E*/
180: typedef enum { PEP_STOP_BASIC,
181:                PEP_STOP_USER } PEPStop;

183: /*E
184:     PEPConvergedReason - Reason an eigensolver was said to
185:          have converged or diverged

187:     Level: intermediate

189: .seealso: PEPSolve(), PEPGetConvergedReason(), PEPSetTolerances()
190: E*/
191: typedef enum {/* converged */
192:               PEP_CONVERGED_TOL                =  1,
193:               PEP_CONVERGED_USER               =  2,
194:               /* diverged */
195:               PEP_DIVERGED_ITS                 = -1,
196:               PEP_DIVERGED_BREAKDOWN           = -2,
197:               PEP_DIVERGED_SYMMETRY_LOST       = -3,
198:               PEP_CONVERGED_ITERATING          =  0} PEPConvergedReason;
199: SLEPC_EXTERN const char *const*PEPConvergedReasons;

201: SLEPC_EXTERN PetscErrorCode PEPCreate(MPI_Comm,PEP*);
202: SLEPC_EXTERN PetscErrorCode PEPDestroy(PEP*);
203: SLEPC_EXTERN PetscErrorCode PEPReset(PEP);
204: SLEPC_EXTERN PetscErrorCode PEPSetType(PEP,PEPType);
205: SLEPC_EXTERN PetscErrorCode PEPGetType(PEP,PEPType*);
206: SLEPC_EXTERN PetscErrorCode PEPSetProblemType(PEP,PEPProblemType);
207: SLEPC_EXTERN PetscErrorCode PEPGetProblemType(PEP,PEPProblemType*);
208: SLEPC_EXTERN PetscErrorCode PEPSetOperators(PEP,PetscInt,Mat[]);
209: SLEPC_EXTERN PetscErrorCode PEPGetOperators(PEP,PetscInt,Mat*);
210: SLEPC_EXTERN PetscErrorCode PEPGetNumMatrices(PEP,PetscInt*);
211: SLEPC_EXTERN PetscErrorCode PEPSetTarget(PEP,PetscScalar);
212: SLEPC_EXTERN PetscErrorCode PEPGetTarget(PEP,PetscScalar*);
213: SLEPC_EXTERN PetscErrorCode PEPSetInterval(PEP,PetscReal,PetscReal);
214: SLEPC_EXTERN PetscErrorCode PEPGetInterval(PEP,PetscReal*,PetscReal*);
215: SLEPC_EXTERN PetscErrorCode PEPSetFromOptions(PEP);
216: SLEPC_EXTERN PetscErrorCode PEPSetUp(PEP);
217: SLEPC_EXTERN PetscErrorCode PEPSolve(PEP);
218: SLEPC_EXTERN PetscErrorCode PEPView(PEP,PetscViewer);
219: SLEPC_EXTERN PetscErrorCode PEPViewFromOptions(PEP,PetscObject,const char[]);
220: SLEPC_EXTERN PetscErrorCode PEPErrorView(PEP,PEPErrorType,PetscViewer);
221: PETSC_DEPRECATED_FUNCTION("Use PEPErrorView()") static inline PetscErrorCode PEPPrintSolution(PEP pep,PetscViewer v) {return PEPErrorView(pep,PEP_ERROR_BACKWARD,v);}
222: SLEPC_EXTERN PetscErrorCode PEPErrorViewFromOptions(PEP);
223: SLEPC_EXTERN PetscErrorCode PEPConvergedReasonView(PEP,PetscViewer);
224: SLEPC_EXTERN PetscErrorCode PEPConvergedReasonViewFromOptions(PEP);
225: PETSC_DEPRECATED_FUNCTION("Use PEPConvergedReasonView() (since version 3.14)") static inline PetscErrorCode PEPReasonView(PEP pep,PetscViewer v) {return PEPConvergedReasonView(pep,v);}
226: PETSC_DEPRECATED_FUNCTION("Use PEPConvergedReasonViewFromOptions() (since version 3.14)") static inline PetscErrorCode PEPReasonViewFromOptions(PEP pep) {return PEPConvergedReasonViewFromOptions(pep);}
227: SLEPC_EXTERN PetscErrorCode PEPValuesView(PEP,PetscViewer);
228: SLEPC_EXTERN PetscErrorCode PEPValuesViewFromOptions(PEP);
229: SLEPC_EXTERN PetscErrorCode PEPVectorsView(PEP,PetscViewer);
230: SLEPC_EXTERN PetscErrorCode PEPVectorsViewFromOptions(PEP);
231: SLEPC_EXTERN PetscErrorCode PEPSetBV(PEP,BV);
232: SLEPC_EXTERN PetscErrorCode PEPGetBV(PEP,BV*);
233: SLEPC_EXTERN PetscErrorCode PEPSetRG(PEP,RG);
234: SLEPC_EXTERN PetscErrorCode PEPGetRG(PEP,RG*);
235: SLEPC_EXTERN PetscErrorCode PEPSetDS(PEP,DS);
236: SLEPC_EXTERN PetscErrorCode PEPGetDS(PEP,DS*);
237: SLEPC_EXTERN PetscErrorCode PEPSetST(PEP,ST);
238: SLEPC_EXTERN PetscErrorCode PEPGetST(PEP,ST*);
239: SLEPC_EXTERN PetscErrorCode PEPRefineGetKSP(PEP,KSP*);

241: SLEPC_EXTERN PetscErrorCode PEPSetTolerances(PEP,PetscReal,PetscInt);
242: SLEPC_EXTERN PetscErrorCode PEPGetTolerances(PEP,PetscReal*,PetscInt*);
243: SLEPC_EXTERN PetscErrorCode PEPSetConvergenceTestFunction(PEP,PetscErrorCode (*)(PEP,PetscScalar,PetscScalar,PetscReal,PetscReal*,void*),void*,PetscErrorCode (*)(void*));
244: SLEPC_EXTERN PetscErrorCode PEPSetConvergenceTest(PEP,PEPConv);
245: SLEPC_EXTERN PetscErrorCode PEPGetConvergenceTest(PEP,PEPConv*);
246: SLEPC_EXTERN PetscErrorCode PEPConvergedAbsolute(PEP,PetscScalar,PetscScalar,PetscReal,PetscReal*,void*);
247: SLEPC_EXTERN PetscErrorCode PEPConvergedRelative(PEP,PetscScalar,PetscScalar,PetscReal,PetscReal*,void*);
248: SLEPC_EXTERN PetscErrorCode PEPConvergedNorm(PEP,PetscScalar,PetscScalar,PetscReal,PetscReal*,void*);
249: SLEPC_EXTERN PetscErrorCode PEPSetStoppingTestFunction(PEP,PetscErrorCode (*)(PEP,PetscInt,PetscInt,PetscInt,PetscInt,PEPConvergedReason*,void*),void*,PetscErrorCode (*)(void*));
250: SLEPC_EXTERN PetscErrorCode PEPSetStoppingTest(PEP,PEPStop);
251: SLEPC_EXTERN PetscErrorCode PEPGetStoppingTest(PEP,PEPStop*);
252: SLEPC_EXTERN PetscErrorCode PEPStoppingBasic(PEP,PetscInt,PetscInt,PetscInt,PetscInt,PEPConvergedReason*,void*);
253: SLEPC_EXTERN PetscErrorCode PEPGetConvergedReason(PEP,PEPConvergedReason*);

255: SLEPC_EXTERN PetscErrorCode PEPSetDimensions(PEP,PetscInt,PetscInt,PetscInt);
256: SLEPC_EXTERN PetscErrorCode PEPGetDimensions(PEP,PetscInt*,PetscInt*,PetscInt*);
257: SLEPC_EXTERN PetscErrorCode PEPSetScale(PEP,PEPScale,PetscReal,Vec,Vec,PetscInt,PetscReal);
258: SLEPC_EXTERN PetscErrorCode PEPGetScale(PEP,PEPScale*,PetscReal*,Vec*,Vec*,PetscInt*,PetscReal*);
259: SLEPC_EXTERN PetscErrorCode PEPSetRefine(PEP,PEPRefine,PetscInt,PetscReal,PetscInt,PEPRefineScheme);
260: SLEPC_EXTERN PetscErrorCode PEPGetRefine(PEP,PEPRefine*,PetscInt*,PetscReal*,PetscInt*,PEPRefineScheme*);
261: SLEPC_EXTERN PetscErrorCode PEPSetExtract(PEP,PEPExtract);
262: SLEPC_EXTERN PetscErrorCode PEPGetExtract(PEP,PEPExtract*);
263: SLEPC_EXTERN PetscErrorCode PEPSetBasis(PEP,PEPBasis);
264: SLEPC_EXTERN PetscErrorCode PEPGetBasis(PEP,PEPBasis*);

266: SLEPC_EXTERN PetscErrorCode PEPGetConverged(PEP,PetscInt*);
267: SLEPC_EXTERN PetscErrorCode PEPGetEigenpair(PEP,PetscInt,PetscScalar*,PetscScalar*,Vec,Vec);
268: SLEPC_EXTERN PetscErrorCode PEPComputeError(PEP,PetscInt,PEPErrorType,PetscReal*);
269: PETSC_DEPRECATED_FUNCTION("Use PEPComputeError()") static inline PetscErrorCode PEPComputeRelativeError(PEP pep,PetscInt i,PetscReal *r) {return PEPComputeError(pep,i,PEP_ERROR_BACKWARD,r);}
270: PETSC_DEPRECATED_FUNCTION("Use PEPComputeError() with PEP_ERROR_ABSOLUTE") static inline PetscErrorCode PEPComputeResidualNorm(PEP pep,PetscInt i,PetscReal *r) {return PEPComputeError(pep,i,PEP_ERROR_ABSOLUTE,r);}
271: SLEPC_EXTERN PetscErrorCode PEPGetErrorEstimate(PEP,PetscInt,PetscReal*);
272: SLEPC_EXTERN PetscErrorCode PEPGetIterationNumber(PEP,PetscInt*);

274: SLEPC_EXTERN PetscErrorCode PEPSetInitialSpace(PEP,PetscInt,Vec[]);
275: SLEPC_EXTERN PetscErrorCode PEPSetWhichEigenpairs(PEP,PEPWhich);
276: SLEPC_EXTERN PetscErrorCode PEPGetWhichEigenpairs(PEP,PEPWhich*);
277: SLEPC_EXTERN PetscErrorCode PEPSetEigenvalueComparison(PEP,PetscErrorCode (*func)(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*),void*);

279: SLEPC_EXTERN PetscErrorCode PEPSetTrackAll(PEP,PetscBool);
280: SLEPC_EXTERN PetscErrorCode PEPGetTrackAll(PEP,PetscBool*);

282: SLEPC_EXTERN PetscErrorCode PEPMonitor(PEP,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt);
283: SLEPC_EXTERN PetscErrorCode PEPMonitorSet(PEP,PetscErrorCode (*)(PEP,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,void*),void*,PetscErrorCode (*)(void**));
284: SLEPC_EXTERN PetscErrorCode PEPMonitorCancel(PEP);
285: SLEPC_EXTERN PetscErrorCode PEPGetMonitorContext(PEP,void*);

287: SLEPC_EXTERN PetscErrorCode PEPMonitorSetFromOptions(PEP,const char[],const char[],void*,PetscBool);
288: SLEPC_EXTERN PetscErrorCode PEPMonitorLGCreate(MPI_Comm,const char[],const char[],const char[],PetscInt,const char*[],int,int,int,int,PetscDrawLG*);
289: SLEPC_EXTERN PetscErrorCode PEPMonitorFirst(PEP,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
290: SLEPC_EXTERN PetscErrorCode PEPMonitorFirstDrawLG(PEP,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
291: SLEPC_EXTERN PetscErrorCode PEPMonitorFirstDrawLGCreate(PetscViewer,PetscViewerFormat,void *,PetscViewerAndFormat**);
292: SLEPC_EXTERN PetscErrorCode PEPMonitorAll(PEP,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
293: SLEPC_EXTERN PetscErrorCode PEPMonitorAllDrawLG(PEP,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
294: SLEPC_EXTERN PetscErrorCode PEPMonitorAllDrawLGCreate(PetscViewer,PetscViewerFormat,void *,PetscViewerAndFormat**);
295: SLEPC_EXTERN PetscErrorCode PEPMonitorConverged(PEP,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
296: SLEPC_EXTERN PetscErrorCode PEPMonitorConvergedCreate(PetscViewer,PetscViewerFormat,void *,PetscViewerAndFormat**);
297: SLEPC_EXTERN PetscErrorCode PEPMonitorConvergedDrawLG(PEP,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*);
298: SLEPC_EXTERN PetscErrorCode PEPMonitorConvergedDrawLGCreate(PetscViewer,PetscViewerFormat,void *,PetscViewerAndFormat**);
299: SLEPC_EXTERN PetscErrorCode PEPMonitorConvergedDestroy(PetscViewerAndFormat**);

301: SLEPC_EXTERN PetscErrorCode PEPSetOptionsPrefix(PEP,const char*);
302: SLEPC_EXTERN PetscErrorCode PEPAppendOptionsPrefix(PEP,const char*);
303: SLEPC_EXTERN PetscErrorCode PEPGetOptionsPrefix(PEP,const char*[]);

305: SLEPC_EXTERN PetscFunctionList PEPList;
306: SLEPC_EXTERN PetscFunctionList PEPMonitorList;
307: SLEPC_EXTERN PetscFunctionList PEPMonitorCreateList;
308: SLEPC_EXTERN PetscFunctionList PEPMonitorDestroyList;
309: SLEPC_EXTERN PetscErrorCode PEPRegister(const char[],PetscErrorCode(*)(PEP));
310: SLEPC_EXTERN PetscErrorCode PEPMonitorRegister(const char[],PetscViewerType,PetscViewerFormat,PetscErrorCode(*)(PEP,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,PetscViewerAndFormat*),PetscErrorCode(*)(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**),PetscErrorCode(*)(PetscViewerAndFormat**));

312: SLEPC_EXTERN PetscErrorCode PEPSetWorkVecs(PEP,PetscInt);
313: SLEPC_EXTERN PetscErrorCode PEPAllocateSolution(PEP,PetscInt);

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

317: SLEPC_EXTERN PetscErrorCode PEPLinearSetLinearization(PEP,PetscReal,PetscReal);
318: SLEPC_EXTERN PetscErrorCode PEPLinearGetLinearization(PEP,PetscReal*,PetscReal*);
319: SLEPC_EXTERN PetscErrorCode PEPLinearSetExplicitMatrix(PEP,PetscBool);
320: SLEPC_EXTERN PetscErrorCode PEPLinearGetExplicitMatrix(PEP,PetscBool*);
321: SLEPC_EXTERN PetscErrorCode PEPLinearSetEPS(PEP,EPS);
322: SLEPC_EXTERN PetscErrorCode PEPLinearGetEPS(PEP,EPS*);
323: PETSC_DEPRECATED_FUNCTION("Use PEPLinearSetLinearization()") static inline PetscErrorCode PEPLinearSetCompanionForm(PEP pep,PetscInt cform) {return (cform==1)?PEPLinearSetLinearization(pep,1.0,0.0):PEPLinearSetLinearization(pep,0.0,1.0);}
324: PETSC_DEPRECATED_FUNCTION("Use PEPLinearGetLinearization()") static inline PetscErrorCode PEPLinearGetCompanionForm(PEP pep,PetscInt *cform) {(void)pep; if (cform) *cform=1; return 0;}

326: SLEPC_EXTERN PetscErrorCode PEPQArnoldiSetRestart(PEP,PetscReal);
327: SLEPC_EXTERN PetscErrorCode PEPQArnoldiGetRestart(PEP,PetscReal*);
328: SLEPC_EXTERN PetscErrorCode PEPQArnoldiSetLocking(PEP,PetscBool);
329: SLEPC_EXTERN PetscErrorCode PEPQArnoldiGetLocking(PEP,PetscBool*);

331: SLEPC_EXTERN PetscErrorCode PEPTOARSetRestart(PEP,PetscReal);
332: SLEPC_EXTERN PetscErrorCode PEPTOARGetRestart(PEP,PetscReal*);
333: SLEPC_EXTERN PetscErrorCode PEPTOARSetLocking(PEP,PetscBool);
334: SLEPC_EXTERN PetscErrorCode PEPTOARGetLocking(PEP,PetscBool*);

336: SLEPC_EXTERN PetscErrorCode PEPSTOARSetLinearization(PEP,PetscReal,PetscReal);
337: SLEPC_EXTERN PetscErrorCode PEPSTOARGetLinearization(PEP,PetscReal*,PetscReal*);
338: SLEPC_EXTERN PetscErrorCode PEPSTOARSetLocking(PEP,PetscBool);
339: SLEPC_EXTERN PetscErrorCode PEPSTOARGetLocking(PEP,PetscBool*);
340: SLEPC_EXTERN PetscErrorCode PEPSTOARSetDetectZeros(PEP,PetscBool);
341: SLEPC_EXTERN PetscErrorCode PEPSTOARGetDetectZeros(PEP,PetscBool*);
342: SLEPC_EXTERN PetscErrorCode PEPSTOARGetInertias(PEP,PetscInt*,PetscReal**,PetscInt**);
343: SLEPC_EXTERN PetscErrorCode PEPSTOARSetDimensions(PEP,PetscInt,PetscInt,PetscInt);
344: SLEPC_EXTERN PetscErrorCode PEPSTOARGetDimensions(PEP,PetscInt*,PetscInt*,PetscInt*);
345: SLEPC_EXTERN PetscErrorCode PEPSTOARSetCheckEigenvalueType(PEP,PetscBool);
346: SLEPC_EXTERN PetscErrorCode PEPSTOARGetCheckEigenvalueType(PEP,PetscBool*);
347: SLEPC_EXTERN PetscErrorCode PEPCheckDefiniteQEP(PEP,PetscReal*,PetscReal*,PetscInt*,PetscInt*);

349: /*E
350:     PEPJDProjection - The type of projection to be used in the Jacobi-Davidson solver

352:     Level: intermediate

354: .seealso: PEPJDSetProjection()
355: E*/
356: typedef enum { PEP_JD_PROJECTION_HARMONIC,
357:                PEP_JD_PROJECTION_ORTHOGONAL } PEPJDProjection;
358: SLEPC_EXTERN const char *PEPJDProjectionTypes[];

360: SLEPC_EXTERN PetscErrorCode PEPJDSetRestart(PEP,PetscReal);
361: SLEPC_EXTERN PetscErrorCode PEPJDGetRestart(PEP,PetscReal*);
362: SLEPC_EXTERN PetscErrorCode PEPJDSetFix(PEP,PetscReal);
363: SLEPC_EXTERN PetscErrorCode PEPJDGetFix(PEP,PetscReal*);
364: SLEPC_EXTERN PetscErrorCode PEPJDSetReusePreconditioner(PEP,PetscBool);
365: SLEPC_EXTERN PetscErrorCode PEPJDGetReusePreconditioner(PEP,PetscBool*);
366: SLEPC_EXTERN PetscErrorCode PEPJDSetMinimalityIndex(PEP,PetscInt);
367: SLEPC_EXTERN PetscErrorCode PEPJDGetMinimalityIndex(PEP,PetscInt*);
368: SLEPC_EXTERN PetscErrorCode PEPJDSetProjection(PEP,PEPJDProjection);
369: SLEPC_EXTERN PetscErrorCode PEPJDGetProjection(PEP,PEPJDProjection*);

371: /*E
372:     PEPCISSExtraction - determines the extraction technique in the CISS solver

374:     Level: advanced

376: .seealso: PEPCISSSetExtraction(), PEPCISSGetExtraction()
377: E*/
378: typedef enum { PEP_CISS_EXTRACTION_RITZ,
379:                PEP_CISS_EXTRACTION_HANKEL,
380:                PEP_CISS_EXTRACTION_CAA    } PEPCISSExtraction;
381: SLEPC_EXTERN const char *PEPCISSExtractions[];

383: #if defined(PETSC_USE_COMPLEX) || defined(PETSC_CLANG_STATIC_ANALYZER)
384: SLEPC_EXTERN PetscErrorCode PEPCISSSetExtraction(PEP,PEPCISSExtraction);
385: SLEPC_EXTERN PetscErrorCode PEPCISSGetExtraction(PEP,PEPCISSExtraction*);
386: SLEPC_EXTERN PetscErrorCode PEPCISSSetSizes(PEP,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscBool);
387: SLEPC_EXTERN PetscErrorCode PEPCISSGetSizes(PEP,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscBool*);
388: SLEPC_EXTERN PetscErrorCode PEPCISSSetThreshold(PEP,PetscReal,PetscReal);
389: SLEPC_EXTERN PetscErrorCode PEPCISSGetThreshold(PEP,PetscReal*,PetscReal*);
390: SLEPC_EXTERN PetscErrorCode PEPCISSSetRefinement(PEP,PetscInt,PetscInt);
391: SLEPC_EXTERN PetscErrorCode PEPCISSGetRefinement(PEP,PetscInt*,PetscInt*);
392: SLEPC_EXTERN PetscErrorCode PEPCISSGetKSPs(PEP,PetscInt*,KSP**);
393: #else
394: #define SlepcPEPCISSUnavailable(pep) do { \
395:     SETERRQ(PetscObjectComm((PetscObject)pep),PETSC_ERR_SUP,"%s() not available with real scalars",PETSC_FUNCTION_NAME); \
396:     } while (0)
397: static inline PetscErrorCode PEPCISSSetExtraction(PEP pep,PETSC_UNUSED PEPCISSExtraction ex) {SlepcPEPCISSUnavailable(pep);}
398: static inline PetscErrorCode PEPCISSGetExtraction(PEP pep,PETSC_UNUSED PEPCISSExtraction *ex) {SlepcPEPCISSUnavailable(pep);}
399: static inline PetscErrorCode PEPCISSSetSizes(PEP pep,PETSC_UNUSED PetscInt ip,PETSC_UNUSED PetscInt bs,PETSC_UNUSED PetscInt ms,PETSC_UNUSED PetscInt npart,PETSC_UNUSED PetscInt bsmax,PETSC_UNUSED PetscBool realmats) {SlepcPEPCISSUnavailable(pep);}
400: static inline PetscErrorCode PEPCISSGetSizes(PEP pep,PETSC_UNUSED PetscInt *ip,PETSC_UNUSED PetscInt *bs,PETSC_UNUSED PetscInt *ms,PETSC_UNUSED PetscInt *npart,PETSC_UNUSED PetscInt *bsmak,PETSC_UNUSED PetscBool *realmats) {SlepcPEPCISSUnavailable(pep);}
401: static inline PetscErrorCode PEPCISSSetThreshold(PEP pep,PETSC_UNUSED PetscReal delta,PETSC_UNUSED PetscReal spur) {SlepcPEPCISSUnavailable(pep);}
402: static inline PetscErrorCode PEPCISSGetThreshold(PEP pep,PETSC_UNUSED PetscReal *delta,PETSC_UNUSED PetscReal *spur) {SlepcPEPCISSUnavailable(pep);}
403: static inline PetscErrorCode PEPCISSSetRefinement(PEP pep,PETSC_UNUSED PetscInt inner,PETSC_UNUSED PetscInt blsize) {SlepcPEPCISSUnavailable(pep);}
404: static inline PetscErrorCode PEPCISSGetRefinement(PEP pep,PETSC_UNUSED PetscInt *inner,PETSC_UNUSED PetscInt *blsize) {SlepcPEPCISSUnavailable(pep);}
405: static inline PetscErrorCode PEPCISSGetKSPs(PEP pep,PETSC_UNUSED PetscInt *nsolve,PETSC_UNUSED KSP **ksp) {SlepcPEPCISSUnavailable(pep);}
406: #undef SlepcPEPCISSUnavailable
407: #endif
408: #endif