Actual source code: slepcmfn.h

slepc-3.6.3 2016-03-29
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-2015, 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"

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

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

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

 77: PETSC_EXTERN PetscErrorCode MFNMonitor(MFN,PetscInt,PetscReal);
 78: PETSC_EXTERN PetscErrorCode MFNMonitorSet(MFN,PetscErrorCode (*)(MFN,PetscInt,PetscReal,void*),void*,PetscErrorCode (*)(void**));
 79: PETSC_EXTERN PetscErrorCode MFNMonitorCancel(MFN);
 80: PETSC_EXTERN PetscErrorCode MFNGetMonitorContext(MFN,void **);
 81: PETSC_EXTERN PetscErrorCode MFNGetIterationNumber(MFN,PetscInt*);

 83: PETSC_EXTERN PetscErrorCode MFNSetErrorIfNotConverged(MFN,PetscBool);
 84: PETSC_EXTERN PetscErrorCode MFNGetErrorIfNotConverged(MFN,PetscBool*);

 86: PETSC_EXTERN PetscErrorCode MFNMonitorDefault(MFN,PetscInt,PetscReal,void*);
 87: PETSC_EXTERN PetscErrorCode MFNMonitorLG(MFN,PetscInt,PetscReal,void*);

 89: PETSC_EXTERN PetscErrorCode MFNSetOptionsPrefix(MFN,const char*);
 90: PETSC_EXTERN PetscErrorCode MFNAppendOptionsPrefix(MFN,const char*);
 91: PETSC_EXTERN PetscErrorCode MFNGetOptionsPrefix(MFN,const char*[]);

 93: /*E
 94:     MFNConvergedReason - reason a matrix function iteration was said to
 95:          have converged or diverged

 97:     Level: intermediate

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

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

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

114: PETSC_EXTERN PetscErrorCode MFNAllocateSolution(MFN,PetscInt);

116: #endif