Actual source code: slepcmfn.h
slepc-3.14.0 2020-09-30
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 MFNConvergedReasonView(MFN,PetscViewer);
58: SLEPC_EXTERN PetscErrorCode MFNConvergedReasonViewFromOptions(MFN);
59: PETSC_DEPRECATED_FUNCTION("Use MFNConvergedReasonView() (since version 3.14)") PETSC_STATIC_INLINE PetscErrorCode MFNReasonView(MFN mfn,PetscViewer v) {return MFNConvergedReasonView(mfn,v);}
60: PETSC_DEPRECATED_FUNCTION("Use MFNConvergedReasonViewFromOptions() (since version 3.14)") PETSC_STATIC_INLINE PetscErrorCode MFNReasonViewFromOptions(MFN mfn) {return MFNConvergedReasonViewFromOptions(mfn);}
62: SLEPC_EXTERN PetscErrorCode MFNSetBV(MFN,BV);
63: SLEPC_EXTERN PetscErrorCode MFNGetBV(MFN,BV*);
64: SLEPC_EXTERN PetscErrorCode MFNSetFN(MFN,FN);
65: SLEPC_EXTERN PetscErrorCode MFNGetFN(MFN,FN*);
66: SLEPC_EXTERN PetscErrorCode MFNSetTolerances(MFN,PetscReal,PetscInt);
67: SLEPC_EXTERN PetscErrorCode MFNGetTolerances(MFN,PetscReal*,PetscInt*);
68: SLEPC_EXTERN PetscErrorCode MFNSetDimensions(MFN,PetscInt);
69: SLEPC_EXTERN PetscErrorCode MFNGetDimensions(MFN,PetscInt*);
71: SLEPC_EXTERN PetscErrorCode MFNMonitor(MFN,PetscInt,PetscReal);
72: SLEPC_EXTERN PetscErrorCode MFNMonitorSet(MFN,PetscErrorCode (*)(MFN,PetscInt,PetscReal,void*),void*,PetscErrorCode (*)(void**));
73: SLEPC_EXTERN PetscErrorCode MFNMonitorSetFromOptions(MFN,const char*,const char*,const char*,PetscErrorCode (*)(MFN,PetscInt,PetscReal,PetscViewerAndFormat*));
74: SLEPC_EXTERN PetscErrorCode MFNMonitorCancel(MFN);
75: SLEPC_EXTERN PetscErrorCode MFNGetMonitorContext(MFN,void **);
76: SLEPC_EXTERN PetscErrorCode MFNGetIterationNumber(MFN,PetscInt*);
78: SLEPC_EXTERN PetscErrorCode MFNSetErrorIfNotConverged(MFN,PetscBool);
79: SLEPC_EXTERN PetscErrorCode MFNGetErrorIfNotConverged(MFN,PetscBool*);
81: SLEPC_EXTERN PetscErrorCode MFNMonitorDefault(MFN,PetscInt,PetscReal,PetscViewerAndFormat*);
82: SLEPC_EXTERN PetscErrorCode MFNMonitorLGCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscDrawLG*);
83: SLEPC_EXTERN PetscErrorCode MFNMonitorLG(MFN,PetscInt,PetscReal,void*);
85: SLEPC_EXTERN PetscErrorCode MFNSetOptionsPrefix(MFN,const char*);
86: SLEPC_EXTERN PetscErrorCode MFNAppendOptionsPrefix(MFN,const char*);
87: SLEPC_EXTERN PetscErrorCode MFNGetOptionsPrefix(MFN,const char*[]);
89: /*E
90: MFNConvergedReason - reason a matrix function iteration was said to
91: have converged or diverged
93: Level: intermediate
95: .seealso: MFNSolve(), MFNGetConvergedReason(), MFNSetTolerances()
96: E*/
97: typedef enum {/* converged */
98: MFN_CONVERGED_TOL = 1,
99: MFN_CONVERGED_ITS = 2,
100: /* diverged */
101: MFN_DIVERGED_ITS = -1,
102: MFN_DIVERGED_BREAKDOWN = -2,
103: MFN_CONVERGED_ITERATING = 0} MFNConvergedReason;
104: SLEPC_EXTERN const char *const*MFNConvergedReasons;
106: SLEPC_EXTERN PetscErrorCode MFNGetConvergedReason(MFN,MFNConvergedReason *);
108: SLEPC_EXTERN PetscFunctionList MFNList;
109: SLEPC_EXTERN PetscErrorCode MFNRegister(const char[],PetscErrorCode(*)(MFN));
111: SLEPC_EXTERN PetscErrorCode MFNAllocateSolution(MFN,PetscInt);
113: #endif