Actual source code: slepcmfn.h

slepc-3.7.1 2016-05-27
Report Typos and Errors
  1: /*
  2:    User interface for the SLEPC matrix function object.

  4:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  5:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  6:    Copyright (c) 2002-2016, Universitat Politecnica de Valencia, Spain

  8:    This file is part of SLEPc.

 10:    SLEPc is free software: you can redistribute it and/or modify it under  the
 11:    terms of version 3 of the GNU Lesser General Public License as published by
 12:    the Free Software Foundation.

 14:    SLEPc  is  distributed in the hope that it will be useful, but WITHOUT  ANY
 15:    WARRANTY;  without even the implied warranty of MERCHANTABILITY or  FITNESS
 16:    FOR  A  PARTICULAR PURPOSE. See the GNU Lesser General Public  License  for
 17:    more details.

 19:    You  should have received a copy of the GNU Lesser General  Public  License
 20:    along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
 21:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 22: */

 26: #include <slepcbv.h>
 27: #include <slepcfn.h>

 29: PETSC_EXTERN PetscErrorCode MFNInitializePackage(void);

 31: /*S
 32:     MFN - SLEPc object that encapsulates functionality for matrix functions.

 34:     Level: beginner

 36: .seealso:  MFNCreate()
 37: S*/
 38: typedef struct _p_MFN* MFN;

 40: /*J
 41:     MFNType - String with the name of a method for computing matrix functions.

 43:     Level: beginner

 45: .seealso: MFNSetType(), MFN
 46: J*/
 47: typedef const char* MFNType;
 48: #define MFNKRYLOV   "krylov"
 49: #define MFNEXPOKIT  "expokit"

 51: /* Logging support */
 52: PETSC_EXTERN PetscClassId MFN_CLASSID;

 54: PETSC_EXTERN PetscErrorCode MFNCreate(MPI_Comm,MFN *);
 55: PETSC_EXTERN PetscErrorCode MFNDestroy(MFN*);
 56: PETSC_EXTERN PetscErrorCode MFNReset(MFN);
 57: PETSC_EXTERN PetscErrorCode MFNSetType(MFN,MFNType);
 58: PETSC_EXTERN PetscErrorCode MFNGetType(MFN,MFNType*);
 59: PETSC_EXTERN PetscErrorCode MFNSetOperator(MFN,Mat);
 60: PETSC_EXTERN PetscErrorCode MFNGetOperator(MFN,Mat*);
 61: PETSC_EXTERN PetscErrorCode MFNSetFromOptions(MFN);
 62: PETSC_EXTERN PetscErrorCode MFNSetUp(MFN);
 63: PETSC_EXTERN PetscErrorCode MFNSolve(MFN,Vec,Vec);
 64: PETSC_EXTERN PetscErrorCode MFNView(MFN,PetscViewer);
 65: PETSC_STATIC_INLINE PetscErrorCode MFNViewFromOptions(MFN mfn,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)mfn,obj,name);}
 66: PETSC_EXTERN PetscErrorCode MFNReasonView(MFN,PetscViewer);
 67: PETSC_EXTERN PetscErrorCode MFNReasonViewFromOptions(MFN);

 69: PETSC_EXTERN PetscErrorCode MFNSetBV(MFN,BV);
 70: PETSC_EXTERN PetscErrorCode MFNGetBV(MFN,BV*);
 71: PETSC_EXTERN PetscErrorCode MFNSetFN(MFN,FN);
 72: PETSC_EXTERN PetscErrorCode MFNGetFN(MFN,FN*);
 73: PETSC_EXTERN PetscErrorCode MFNSetTolerances(MFN,PetscReal,PetscInt);
 74: PETSC_EXTERN PetscErrorCode MFNGetTolerances(MFN,PetscReal*,PetscInt*);
 75: PETSC_EXTERN PetscErrorCode MFNSetDimensions(MFN,PetscInt);
 76: PETSC_EXTERN PetscErrorCode MFNGetDimensions(MFN,PetscInt*);

 78: PETSC_EXTERN PetscErrorCode MFNMonitor(MFN,PetscInt,PetscReal);
 79: PETSC_EXTERN PetscErrorCode MFNMonitorSet(MFN,PetscErrorCode (*)(MFN,PetscInt,PetscReal,void*),void*,PetscErrorCode (*)(void**));
 80: PETSC_EXTERN PetscErrorCode MFNMonitorSetFromOptions(MFN,const char*,const char*,const char*,PetscErrorCode (*)(MFN,PetscInt,PetscReal,PetscViewerAndFormat*));
 81: PETSC_EXTERN PetscErrorCode MFNMonitorCancel(MFN);
 82: PETSC_EXTERN PetscErrorCode MFNGetMonitorContext(MFN,void **);
 83: PETSC_EXTERN PetscErrorCode MFNGetIterationNumber(MFN,PetscInt*);

 85: PETSC_EXTERN PetscErrorCode MFNSetErrorIfNotConverged(MFN,PetscBool);
 86: PETSC_EXTERN PetscErrorCode MFNGetErrorIfNotConverged(MFN,PetscBool*);

 88: PETSC_EXTERN PetscErrorCode MFNMonitorDefault(MFN,PetscInt,PetscReal,PetscViewerAndFormat*);
 89: PETSC_EXTERN PetscErrorCode MFNMonitorLGCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscDrawLG*);
 90: PETSC_EXTERN PetscErrorCode MFNMonitorLG(MFN,PetscInt,PetscReal,void*);

 92: PETSC_EXTERN PetscErrorCode MFNSetOptionsPrefix(MFN,const char*);
 93: PETSC_EXTERN PetscErrorCode MFNAppendOptionsPrefix(MFN,const char*);
 94: PETSC_EXTERN PetscErrorCode MFNGetOptionsPrefix(MFN,const char*[]);

 96: /*E
 97:     MFNConvergedReason - reason a matrix function iteration was said to
 98:          have converged or diverged

100:     Level: intermediate

102: .seealso: MFNSolve(), MFNGetConvergedReason(), MFNSetTolerances()
103: E*/
104: typedef enum {/* converged */
105:               MFN_CONVERGED_TOL                =  2,
106:               MFN_CONVERGED_ITS                =  3,
107:               /* diverged */
108:               MFN_DIVERGED_ITS                 = -3,
109:               MFN_DIVERGED_BREAKDOWN           = -4,
110:               MFN_CONVERGED_ITERATING          =  0} MFNConvergedReason;
111: PETSC_EXTERN const char *const*MFNConvergedReasons;

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

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

118: PETSC_EXTERN PetscErrorCode MFNAllocateSolution(MFN,PetscInt);

120: #endif