Actual source code: slepcmfn.h
slepc-3.13.0 2020-03-31
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 matrix function solver object
12: */
14: #if !defined(SLEPCMFN_H)
15: #define SLEPCMFN_H
16: #include <slepcbv.h>
17: #include <slepcfn.h>
19: SLEPC_EXTERN PetscErrorCode MFNInitializePackage(void);
21: /*S
22: MFN - SLEPc object that encapsulates functionality for matrix functions.
24: Level: beginner
26: .seealso: MFNCreate()
27: S*/
28: typedef struct _p_MFN* MFN;
30: /*J
31: MFNType - String with the name of a method for computing matrix functions.
33: Level: beginner
35: .seealso: MFNSetType(), MFN
36: J*/
37: typedef const char* MFNType;
38: #define MFNKRYLOV "krylov"
39: #define MFNEXPOKIT "expokit"
41: /* Logging support */
42: SLEPC_EXTERN PetscClassId MFN_CLASSID;
44: SLEPC_EXTERN PetscErrorCode MFNCreate(MPI_Comm,MFN *);
45: SLEPC_EXTERN PetscErrorCode MFNDestroy(MFN*);
46: SLEPC_EXTERN PetscErrorCode MFNReset(MFN);
47: SLEPC_EXTERN PetscErrorCode MFNSetType(MFN,MFNType);
48: SLEPC_EXTERN PetscErrorCode MFNGetType(MFN,MFNType*);
49: SLEPC_EXTERN PetscErrorCode MFNSetOperator(MFN,Mat);
50: SLEPC_EXTERN PetscErrorCode MFNGetOperator(MFN,Mat*);
51: SLEPC_EXTERN PetscErrorCode MFNSetFromOptions(MFN);
52: SLEPC_EXTERN PetscErrorCode MFNSetUp(MFN);
53: SLEPC_EXTERN PetscErrorCode MFNSolve(MFN,Vec,Vec);
54: SLEPC_EXTERN PetscErrorCode MFNSolveTranspose(MFN,Vec,Vec);
55: SLEPC_EXTERN PetscErrorCode MFNView(MFN,PetscViewer);
56: SLEPC_EXTERN PetscErrorCode MFNViewFromOptions(MFN,PetscObject,const char[]);
57: SLEPC_EXTERN PetscErrorCode MFNReasonView(MFN,PetscViewer);
58: SLEPC_EXTERN PetscErrorCode MFNReasonViewFromOptions(MFN);
60: SLEPC_EXTERN PetscErrorCode MFNSetBV(MFN,BV);
61: SLEPC_EXTERN PetscErrorCode MFNGetBV(MFN,BV*);
62: SLEPC_EXTERN PetscErrorCode MFNSetFN(MFN,FN);
63: SLEPC_EXTERN PetscErrorCode MFNGetFN(MFN,FN*);
64: SLEPC_EXTERN PetscErrorCode MFNSetTolerances(MFN,PetscReal,PetscInt);
65: SLEPC_EXTERN PetscErrorCode MFNGetTolerances(MFN,PetscReal*,PetscInt*);
66: SLEPC_EXTERN PetscErrorCode MFNSetDimensions(MFN,PetscInt);
67: SLEPC_EXTERN PetscErrorCode MFNGetDimensions(MFN,PetscInt*);
69: SLEPC_EXTERN PetscErrorCode MFNMonitor(MFN,PetscInt,PetscReal);
70: SLEPC_EXTERN PetscErrorCode MFNMonitorSet(MFN,PetscErrorCode (*)(MFN,PetscInt,PetscReal,void*),void*,PetscErrorCode (*)(void**));
71: SLEPC_EXTERN PetscErrorCode MFNMonitorSetFromOptions(MFN,const char*,const char*,const char*,PetscErrorCode (*)(MFN,PetscInt,PetscReal,PetscViewerAndFormat*));
72: SLEPC_EXTERN PetscErrorCode MFNMonitorCancel(MFN);
73: SLEPC_EXTERN PetscErrorCode MFNGetMonitorContext(MFN,void **);
74: SLEPC_EXTERN PetscErrorCode MFNGetIterationNumber(MFN,PetscInt*);
76: SLEPC_EXTERN PetscErrorCode MFNSetErrorIfNotConverged(MFN,PetscBool);
77: SLEPC_EXTERN PetscErrorCode MFNGetErrorIfNotConverged(MFN,PetscBool*);
79: SLEPC_EXTERN PetscErrorCode MFNMonitorDefault(MFN,PetscInt,PetscReal,PetscViewerAndFormat*);
80: SLEPC_EXTERN PetscErrorCode MFNMonitorLGCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscDrawLG*);
81: SLEPC_EXTERN PetscErrorCode MFNMonitorLG(MFN,PetscInt,PetscReal,void*);
83: SLEPC_EXTERN PetscErrorCode MFNSetOptionsPrefix(MFN,const char*);
84: SLEPC_EXTERN PetscErrorCode MFNAppendOptionsPrefix(MFN,const char*);
85: SLEPC_EXTERN PetscErrorCode MFNGetOptionsPrefix(MFN,const char*[]);
87: /*E
88: MFNConvergedReason - reason a matrix function iteration was said to
89: have converged or diverged
91: Level: intermediate
93: .seealso: MFNSolve(), MFNGetConvergedReason(), MFNSetTolerances()
94: E*/
95: typedef enum {/* converged */
96: MFN_CONVERGED_TOL = 1,
97: MFN_CONVERGED_ITS = 2,
98: /* diverged */
99: MFN_DIVERGED_ITS = -1,
100: MFN_DIVERGED_BREAKDOWN = -2,
101: MFN_CONVERGED_ITERATING = 0} MFNConvergedReason;
102: SLEPC_EXTERN const char *const*MFNConvergedReasons;
104: SLEPC_EXTERN PetscErrorCode MFNGetConvergedReason(MFN,MFNConvergedReason *);
106: SLEPC_EXTERN PetscFunctionList MFNList;
107: SLEPC_EXTERN PetscErrorCode MFNRegister(const char[],PetscErrorCode(*)(MFN));
109: SLEPC_EXTERN PetscErrorCode MFNAllocateSolution(MFN,PetscInt);
111: #endif