Actual source code: slepclme.h

slepc-3.15.2 2021-09-20
Report Typos and Errors
  1: /*
  2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  4:    Copyright (c) 2002-2021, 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*);
 86: SLEPC_EXTERN PetscErrorCode LMEGetIterationNumber(LME,PetscInt*);

 88: SLEPC_EXTERN PetscErrorCode LMEGetErrorEstimate(LME,PetscReal*);
 89: SLEPC_EXTERN PetscErrorCode LMEComputeError(LME,PetscReal*);
 90: SLEPC_EXTERN PetscErrorCode LMESetErrorIfNotConverged(LME,PetscBool);
 91: SLEPC_EXTERN PetscErrorCode LMEGetErrorIfNotConverged(LME,PetscBool*);

 93: SLEPC_EXTERN PetscErrorCode LMEDenseLyapunov(LME,PetscInt,PetscScalar*,PetscInt,PetscScalar*,PetscInt,PetscScalar*,PetscInt);
 94: SLEPC_EXTERN PetscErrorCode LMEDenseHessLyapunovChol(LME,PetscInt,PetscScalar*,PetscInt,PetscInt,PetscScalar*,PetscInt,PetscScalar*,PetscInt,PetscReal*);
 95: 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);}

 97: SLEPC_EXTERN PetscErrorCode LMEMonitor(LME,PetscInt,PetscReal);
 98: SLEPC_EXTERN PetscErrorCode LMEMonitorSet(LME,PetscErrorCode (*)(LME,PetscInt,PetscReal,void*),void*,PetscErrorCode (*)(void**));
 99: SLEPC_EXTERN PetscErrorCode LMEMonitorCancel(LME);
100: SLEPC_EXTERN PetscErrorCode LMEGetMonitorContext(LME,void **);

102: SLEPC_EXTERN PetscErrorCode LMEMonitorSetFromOptions(LME,const char[],const char[],void*);
103: SLEPC_EXTERN PetscErrorCode LMEMonitorLGCreate(MPI_Comm,const char[],const char[],const char[],PetscInt,const char*[],int,int,int,int,PetscDrawLG*);
104: SLEPC_EXTERN PetscErrorCode LMEMonitorDefault(LME,PetscInt,PetscReal,PetscViewerAndFormat*);
105: SLEPC_EXTERN PetscErrorCode LMEMonitorDefaultDrawLG(LME,PetscInt,PetscReal,PetscViewerAndFormat*);
106: SLEPC_EXTERN PetscErrorCode LMEMonitorDefaultDrawLGCreate(PetscViewer,PetscViewerFormat,void *,PetscViewerAndFormat**);

108: SLEPC_EXTERN PetscErrorCode LMESetOptionsPrefix(LME,const char*);
109: SLEPC_EXTERN PetscErrorCode LMEAppendOptionsPrefix(LME,const char*);
110: SLEPC_EXTERN PetscErrorCode LMEGetOptionsPrefix(LME,const char*[]);

112: /*E
113:     LMEConvergedReason - reason a matrix function iteration was said to
114:          have converged or diverged

116:     Level: intermediate

118: .seealso: LMESolve(), LMEGetConvergedReason(), LMESetTolerances()
119: E*/
120: typedef enum {/* converged */
121:               LME_CONVERGED_TOL                =  1,
122:               /* diverged */
123:               LME_DIVERGED_ITS                 = -1,
124:               LME_DIVERGED_BREAKDOWN           = -2,
125:               LME_CONVERGED_ITERATING          =  0} LMEConvergedReason;
126: SLEPC_EXTERN const char *const*LMEConvergedReasons;

128: SLEPC_EXTERN PetscErrorCode LMEGetConvergedReason(LME,LMEConvergedReason *);

130: SLEPC_EXTERN PetscFunctionList LMEList;
131: SLEPC_EXTERN PetscFunctionList LMEMonitorList;
132: SLEPC_EXTERN PetscFunctionList LMEMonitorCreateList;
133: SLEPC_EXTERN PetscFunctionList LMEMonitorDestroyList;
134: SLEPC_EXTERN PetscErrorCode LMERegister(const char[],PetscErrorCode(*)(LME));
135: SLEPC_EXTERN PetscErrorCode LMEMonitorRegister(const char[],PetscViewerType,PetscViewerFormat,PetscErrorCode(*)(LME,PetscInt,PetscReal,PetscViewerAndFormat*),PetscErrorCode(*)(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**),PetscErrorCode(*)(PetscViewerAndFormat**));

137: SLEPC_EXTERN PetscErrorCode LMEAllocateSolution(LME,PetscInt);

139: #endif