Date: 2022-03-31T15:29:40+00:00

Actual source code: slepcmfn.h
slepc-3.17.0 2022-03-31
Report Typos and Errors

      1: /*
      2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
      4:    Copyright (c) 2002-, 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)") static inline PetscErrorCode MFNReasonView(MFN mfn,PetscViewer v) {return MFNConvergedReasonView(mfn,v);}
     60: PETSC_DEPRECATED_FUNCTION("Use MFNConvergedReasonViewFromOptions() (since version 3.14)") 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*);
     70: SLEPC_EXTERN PetscErrorCode MFNGetIterationNumber(MFN,PetscInt*);

     72: SLEPC_EXTERN PetscErrorCode MFNSetErrorIfNotConverged(MFN,PetscBool);
     73: SLEPC_EXTERN PetscErrorCode MFNGetErrorIfNotConverged(MFN,PetscBool*);

     75: SLEPC_EXTERN PetscErrorCode MFNMonitor(MFN,PetscInt,PetscReal);
     76: SLEPC_EXTERN PetscErrorCode MFNMonitorSet(MFN,PetscErrorCode (*)(MFN,PetscInt,PetscReal,void*),void*,PetscErrorCode (*)(void**));
     77: SLEPC_EXTERN PetscErrorCode MFNMonitorCancel(MFN);
     78: SLEPC_EXTERN PetscErrorCode MFNGetMonitorContext(MFN,void*);

     80: SLEPC_EXTERN PetscErrorCode MFNMonitorSetFromOptions(MFN,const char[],const char[],void*);
     81: SLEPC_EXTERN PetscErrorCode MFNMonitorLGCreate(MPI_Comm,const char[],const char[],const char[],PetscInt,const char*[],int,int,int,int,PetscDrawLG*);
     82: SLEPC_EXTERN PetscErrorCode MFNMonitorDefault(MFN,PetscInt,PetscReal,PetscViewerAndFormat*);
     83: SLEPC_EXTERN PetscErrorCode MFNMonitorDefaultDrawLG(MFN,PetscInt,PetscReal,PetscViewerAndFormat*);
     84: SLEPC_EXTERN PetscErrorCode MFNMonitorDefaultDrawLGCreate(PetscViewer,PetscViewerFormat,void *,PetscViewerAndFormat**);

     86: SLEPC_EXTERN PetscErrorCode MFNSetOptionsPrefix(MFN,const char*);
     87: SLEPC_EXTERN PetscErrorCode MFNAppendOptionsPrefix(MFN,const char*);
     88: SLEPC_EXTERN PetscErrorCode MFNGetOptionsPrefix(MFN,const char*[]);

     90: /*E
     91:     MFNConvergedReason - reason a matrix function iteration was said to
     92:          have converged or diverged

     94:     Level: intermediate

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

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

    109: SLEPC_EXTERN PetscFunctionList MFNList;
    110: SLEPC_EXTERN PetscFunctionList MFNMonitorList;
    111: SLEPC_EXTERN PetscFunctionList MFNMonitorCreateList;
    112: SLEPC_EXTERN PetscFunctionList MFNMonitorDestroyList;
    113: SLEPC_EXTERN PetscErrorCode MFNRegister(const char[],PetscErrorCode(*)(MFN));
    114: SLEPC_EXTERN PetscErrorCode MFNMonitorRegister(const char[],PetscViewerType,PetscViewerFormat,PetscErrorCode(*)(MFN,PetscInt,PetscReal,PetscViewerAndFormat*),PetscErrorCode(*)(PetscViewer,PetscViewerFormat,void*,PetscViewerAndFormat**),PetscErrorCode(*)(PetscViewerAndFormat**));

    116: SLEPC_EXTERN PetscErrorCode MFNAllocateSolution(MFN,PetscInt);

    118: #endif