Actual source code: slepcmfn.h

slepc-3.11.0 2019-03-29
Report Typos and Errors
  1: /*
  2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  4:    Copyright (c) 2002-2019, 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: */

 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 MFNView(MFN,PetscViewer);
 55: PETSC_STATIC_INLINE PetscErrorCode MFNViewFromOptions(MFN mfn,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)mfn,obj,name);}
 56: SLEPC_EXTERN PetscErrorCode MFNReasonView(MFN,PetscViewer);
 57: SLEPC_EXTERN PetscErrorCode MFNReasonViewFromOptions(MFN);

 59: SLEPC_EXTERN PetscErrorCode MFNSetBV(MFN,BV);
 60: SLEPC_EXTERN PetscErrorCode MFNGetBV(MFN,BV*);
 61: SLEPC_EXTERN PetscErrorCode MFNSetFN(MFN,FN);
 62: SLEPC_EXTERN PetscErrorCode MFNGetFN(MFN,FN*);
 63: SLEPC_EXTERN PetscErrorCode MFNSetTolerances(MFN,PetscReal,PetscInt);
 64: SLEPC_EXTERN PetscErrorCode MFNGetTolerances(MFN,PetscReal*,PetscInt*);
 65: SLEPC_EXTERN PetscErrorCode MFNSetDimensions(MFN,PetscInt);
 66: SLEPC_EXTERN PetscErrorCode MFNGetDimensions(MFN,PetscInt*);

 68: SLEPC_EXTERN PetscErrorCode MFNMonitor(MFN,PetscInt,PetscReal);
 69: SLEPC_EXTERN PetscErrorCode MFNMonitorSet(MFN,PetscErrorCode (*)(MFN,PetscInt,PetscReal,void*),void*,PetscErrorCode (*)(void**));
 70: SLEPC_EXTERN PetscErrorCode MFNMonitorSetFromOptions(MFN,const char*,const char*,const char*,PetscErrorCode (*)(MFN,PetscInt,PetscReal,PetscViewerAndFormat*));
 71: SLEPC_EXTERN PetscErrorCode MFNMonitorCancel(MFN);
 72: SLEPC_EXTERN PetscErrorCode MFNGetMonitorContext(MFN,void **);
 73: SLEPC_EXTERN PetscErrorCode MFNGetIterationNumber(MFN,PetscInt*);

 75: SLEPC_EXTERN PetscErrorCode MFNSetErrorIfNotConverged(MFN,PetscBool);
 76: SLEPC_EXTERN PetscErrorCode MFNGetErrorIfNotConverged(MFN,PetscBool*);

 78: SLEPC_EXTERN PetscErrorCode MFNMonitorDefault(MFN,PetscInt,PetscReal,PetscViewerAndFormat*);
 79: SLEPC_EXTERN PetscErrorCode MFNMonitorLGCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscDrawLG*);
 80: SLEPC_EXTERN PetscErrorCode MFNMonitorLG(MFN,PetscInt,PetscReal,void*);

 82: SLEPC_EXTERN PetscErrorCode MFNSetOptionsPrefix(MFN,const char*);
 83: SLEPC_EXTERN PetscErrorCode MFNAppendOptionsPrefix(MFN,const char*);
 84: SLEPC_EXTERN PetscErrorCode MFNGetOptionsPrefix(MFN,const char*[]);

 86: /*E
 87:     MFNConvergedReason - reason a matrix function iteration was said to
 88:          have converged or diverged

 90:     Level: intermediate

 92: .seealso: MFNSolve(), MFNGetConvergedReason(), MFNSetTolerances()
 93: E*/
 94: typedef enum {/* converged */
 95:               MFN_CONVERGED_TOL                =  1,
 96:               MFN_CONVERGED_ITS                =  2,
 97:               /* diverged */
 98:               MFN_DIVERGED_ITS                 = -1,
 99:               MFN_DIVERGED_BREAKDOWN           = -2,
100:               MFN_CONVERGED_ITERATING          =  0} MFNConvergedReason;
101: SLEPC_EXTERN const char *const*MFNConvergedReasons;

103: SLEPC_EXTERN PetscErrorCode MFNGetConvergedReason(MFN,MFNConvergedReason *);

105: SLEPC_EXTERN PetscFunctionList MFNList;
106: SLEPC_EXTERN PetscErrorCode MFNRegister(const char[],PetscErrorCode(*)(MFN));

108: SLEPC_EXTERN PetscErrorCode MFNAllocateSolution(MFN,PetscInt);

110: #endif