Actual source code: slepclme.h
slepc-3.14.1 2020-12-08
1: /*
2: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3: SLEPc - Scalable Library for Eigenvalue Problem Computations
4: Copyright (c) 2002-2020, 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 object for solving linear matrix equations
12: */
14: #if !defined(SLEPCLME_H)
15: #define SLEPCLME_H
16: #include <slepcbv.h>
18: SLEPC_EXTERN PetscErrorCode LMEInitializePackage(void);
20: /*S
21: LME - SLEPc object that encapsulates functionality for linear matrix equations
23: Level: beginner
25: .seealso: LMECreate()
26: S*/
27: typedef struct _p_LME* LME;
29: /*J
30: LMEType - String with the name of a method for solving linear matrix equations
32: Level: beginner
34: .seealso: LMESetType(), LME
35: J*/
36: typedef const char* LMEType;
37: #define LMEKRYLOV "krylov"
39: /* Logging support */
40: SLEPC_EXTERN PetscClassId LME_CLASSID;
42: /*E
43: LMEProblemType - Determines the type of linear matrix equation
45: Level: beginner
47: .seealso: LMESetProblemType(), LMEGetProblemType()
48: E*/
49: typedef enum { LME_LYAPUNOV,
50: LME_SYLVESTER,
51: LME_GEN_LYAPUNOV,
52: LME_GEN_SYLVESTER,
53: LME_DT_LYAPUNOV ,
54: LME_STEIN} LMEProblemType;
55: SLEPC_EXTERN const char *LMEProblemTypes[];
57: SLEPC_EXTERN PetscErrorCode LMECreate(MPI_Comm,LME *);
58: SLEPC_EXTERN PetscErrorCode LMEDestroy(LME*);
59: SLEPC_EXTERN PetscErrorCode LMEReset(LME);
60: SLEPC_EXTERN PetscErrorCode LMESetType(LME,LMEType);
61: SLEPC_EXTERN PetscErrorCode LMEGetType(LME,LMEType*);
62: SLEPC_EXTERN PetscErrorCode LMESetProblemType(LME,LMEProblemType);
63: SLEPC_EXTERN PetscErrorCode LMEGetProblemType(LME,LMEProblemType*);
64: SLEPC_EXTERN PetscErrorCode LMESetCoefficients(LME,Mat,Mat,Mat,Mat);
65: SLEPC_EXTERN PetscErrorCode LMEGetCoefficients(LME,Mat*,Mat*,Mat*,Mat*);
66: SLEPC_EXTERN PetscErrorCode LMESetRHS(LME,Mat);
67: SLEPC_EXTERN PetscErrorCode LMEGetRHS(LME,Mat*);
68: SLEPC_EXTERN PetscErrorCode LMESetSolution(LME,Mat);
69: SLEPC_EXTERN PetscErrorCode LMEGetSolution(LME,Mat*);
70: SLEPC_EXTERN PetscErrorCode LMESetFromOptions(LME);
71: SLEPC_EXTERN PetscErrorCode LMESetUp(LME);
72: SLEPC_EXTERN PetscErrorCode LMESolve(LME);
73: SLEPC_EXTERN PetscErrorCode LMEView(LME,PetscViewer);
74: SLEPC_EXTERN PetscErrorCode LMEViewFromOptions(LME,PetscObject,const char[]);
75: SLEPC_EXTERN PetscErrorCode LMEConvergedReasonView(LME,PetscViewer);
76: SLEPC_EXTERN PetscErrorCode LMEConvergedReasonViewFromOptions(LME);
77: PETSC_DEPRECATED_FUNCTION("Use LMEConvergedReasonView() (since version 3.14)") PETSC_STATIC_INLINE PetscErrorCode LMEReasonView(LME lme,PetscViewer v) {return LMEConvergedReasonView(lme,v);}
78: PETSC_DEPRECATED_FUNCTION("Use LMEConvergedReasonViewFromOptions() (since version 3.14)") PETSC_STATIC_INLINE PetscErrorCode LMEReasonViewFromOptions(LME lme) {return LMEConvergedReasonViewFromOptions(lme);}
80: SLEPC_EXTERN PetscErrorCode LMESetBV(LME,BV);
81: SLEPC_EXTERN PetscErrorCode LMEGetBV(LME,BV*);
82: SLEPC_EXTERN PetscErrorCode LMESetTolerances(LME,PetscReal,PetscInt);
83: SLEPC_EXTERN PetscErrorCode LMEGetTolerances(LME,PetscReal*,PetscInt*);
84: SLEPC_EXTERN PetscErrorCode LMESetDimensions(LME,PetscInt);
85: SLEPC_EXTERN PetscErrorCode LMEGetDimensions(LME,PetscInt*);
87: SLEPC_EXTERN PetscErrorCode LMEMonitor(LME,PetscInt,PetscReal);
88: SLEPC_EXTERN PetscErrorCode LMEMonitorSet(LME,PetscErrorCode (*)(LME,PetscInt,PetscReal,void*),void*,PetscErrorCode (*)(void**));
89: SLEPC_EXTERN PetscErrorCode LMEMonitorSetFromOptions(LME,const char*,const char*,const char*,PetscErrorCode (*)(LME,PetscInt,PetscReal,PetscViewerAndFormat*));
90: SLEPC_EXTERN PetscErrorCode LMEMonitorCancel(LME);
91: SLEPC_EXTERN PetscErrorCode LMEGetMonitorContext(LME,void **);
92: SLEPC_EXTERN PetscErrorCode LMEGetIterationNumber(LME,PetscInt*);
94: SLEPC_EXTERN PetscErrorCode LMEGetErrorEstimate(LME,PetscReal*);
95: SLEPC_EXTERN PetscErrorCode LMEComputeError(LME,PetscReal*);
96: SLEPC_EXTERN PetscErrorCode LMESetErrorIfNotConverged(LME,PetscBool);
97: SLEPC_EXTERN PetscErrorCode LMEGetErrorIfNotConverged(LME,PetscBool*);
99: SLEPC_EXTERN PetscErrorCode LMEDenseLyapunov(LME,PetscInt,PetscScalar*,PetscInt,PetscScalar*,PetscInt,PetscScalar*,PetscInt);
100: SLEPC_EXTERN PetscErrorCode LMEDenseHessLyapunovChol(LME,PetscInt,PetscScalar*,PetscInt,PetscInt,PetscScalar*,PetscInt,PetscScalar*,PetscInt,PetscReal*);
101: PETSC_DEPRECATED_FUNCTION("Use LMEDenseHessLyapunovChol()") PETSC_STATIC_INLINE PetscErrorCode LMEDenseLyapunovChol(LME lme,PetscScalar *H,PetscInt m,PetscInt ldh,PetscScalar *r,PetscScalar *L,PetscInt ldl,PetscReal *res) {return LMEDenseHessLyapunovChol(lme,m,H,ldh,1,r,m,L,ldl,res);}
103: SLEPC_EXTERN PetscErrorCode LMEMonitorDefault(LME,PetscInt,PetscReal,PetscViewerAndFormat*);
104: SLEPC_EXTERN PetscErrorCode LMEMonitorLGCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscDrawLG*);
105: SLEPC_EXTERN PetscErrorCode LMEMonitorLG(LME,PetscInt,PetscReal,void*);
107: SLEPC_EXTERN PetscErrorCode LMESetOptionsPrefix(LME,const char*);
108: SLEPC_EXTERN PetscErrorCode LMEAppendOptionsPrefix(LME,const char*);
109: SLEPC_EXTERN PetscErrorCode LMEGetOptionsPrefix(LME,const char*[]);
111: /*E
112: LMEConvergedReason - reason a matrix function iteration was said to
113: have converged or diverged
115: Level: intermediate
117: .seealso: LMESolve(), LMEGetConvergedReason(), LMESetTolerances()
118: E*/
119: typedef enum {/* converged */
120: LME_CONVERGED_TOL = 1,
121: /* diverged */
122: LME_DIVERGED_ITS = -1,
123: LME_DIVERGED_BREAKDOWN = -2,
124: LME_CONVERGED_ITERATING = 0} LMEConvergedReason;
125: SLEPC_EXTERN const char *const*LMEConvergedReasons;
127: SLEPC_EXTERN PetscErrorCode LMEGetConvergedReason(LME,LMEConvergedReason *);
129: SLEPC_EXTERN PetscFunctionList LMEList;
130: SLEPC_EXTERN PetscErrorCode LMERegister(const char[],PetscErrorCode(*)(LME));
132: SLEPC_EXTERN PetscErrorCode LMEAllocateSolution(LME,PetscInt);
134: #endif