Actual source code: slepcmfn.h
slepc-3.10.1 2018-10-23
Report Typos and Errors

      1: /*
      2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
      4:    Copyright (c) 2002-2018, 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: PETSC_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: PETSC_EXTERN PetscClassId MFN_CLASSID;

     44: PETSC_EXTERN PetscErrorCode MFNCreate(MPI_Comm,MFN *);
     45: PETSC_EXTERN PetscErrorCode MFNDestroy(MFN*);
     46: PETSC_EXTERN PetscErrorCode MFNReset(MFN);
     47: PETSC_EXTERN PetscErrorCode MFNSetType(MFN,MFNType);
     48: PETSC_EXTERN PetscErrorCode MFNGetType(MFN,MFNType*);
     49: PETSC_EXTERN PetscErrorCode MFNSetOperator(MFN,Mat);
     50: PETSC_EXTERN PetscErrorCode MFNGetOperator(MFN,Mat*);
     51: PETSC_EXTERN PetscErrorCode MFNSetFromOptions(MFN);
     52: PETSC_EXTERN PetscErrorCode MFNSetUp(MFN);
     53: PETSC_EXTERN PetscErrorCode MFNSolve(MFN,Vec,Vec);
     54: PETSC_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: PETSC_EXTERN PetscErrorCode MFNReasonView(MFN,PetscViewer);
     57: PETSC_EXTERN PetscErrorCode MFNReasonViewFromOptions(MFN);

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

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

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

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

     82: PETSC_EXTERN PetscErrorCode MFNSetOptionsPrefix(MFN,const char*);
     83: PETSC_EXTERN PetscErrorCode MFNAppendOptionsPrefix(MFN,const char*);
     84: PETSC_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: PETSC_EXTERN const char *const*MFNConvergedReasons;

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

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

    108: PETSC_EXTERN PetscErrorCode MFNAllocateSolution(MFN,PetscInt);

    110: #endif