xref: /petsc/include/petscksp.h (revision ae622e999178ba9cee9f6e732bdcd43d1968db77)
1*ae622e99SLois Curfman McInnes /* $Id: ksp.h,v 1.18 1995/06/18 16:26:06 bsmith Exp curfman $ */
22eac72dbSBarry Smith 
32eac72dbSBarry Smith #ifndef __KSP_PACKAGE
42eac72dbSBarry Smith #define __KSP_PACKAGE
52eac72dbSBarry Smith #include "petsc.h"
62eac72dbSBarry Smith #include "vec.h"
7aabeff55SBarry Smith #include "mat.h"
8aabeff55SBarry Smith #include "pc.h"
92eac72dbSBarry Smith 
109e25ed09SBarry Smith #define KSP_COOKIE  PETSC_COOKIE+8
11f0479e8cSBarry Smith 
122eac72dbSBarry Smith typedef struct _KSP*     KSP;
132eac72dbSBarry Smith 
142eac72dbSBarry Smith /*  Possible Krylov Space Methods */
152eac72dbSBarry Smith typedef enum { KSPRICHARDSON, KSPCHEBYCHEV, KSPCG, KSPGMRES,
162eac72dbSBarry Smith                KSPTCQMR, KSPBCGS, KSPCGS, KSPTFQMR, KSPCR, KSPLSQR,
17f8936d11SLois Curfman McInnes                KSPPREONLY } KSPMethod;
182eac72dbSBarry Smith 
196b5873e3SBarry Smith extern int KSPCreate(MPI_Comm,KSP *);
20f8936d11SLois Curfman McInnes extern int KSPSetMethod(KSP,KSPMethod);
218ed539a5SBarry Smith extern int KSPSetUp(KSP);
228ed539a5SBarry Smith extern int KSPSolve(KSP,int *);
238ed539a5SBarry Smith extern int KSPDestroy(KSP);
242eac72dbSBarry Smith 
258ed539a5SBarry Smith extern int KSPRegisterAll();
26d6dfbf8fSBarry Smith extern int KSPRegisterDestroy();
27f8936d11SLois Curfman McInnes extern int KSPRegister(KSPMethod,char *,int (*)(KSP));
282eac72dbSBarry Smith 
29f8936d11SLois Curfman McInnes extern int KSPGetMethodName(KSPMethod,char **);
300de89847SLois Curfman McInnes extern int KSPSetMaxIterations(KSP,int);
318ed539a5SBarry Smith extern int KSPSetRightPreconditioner(KSP);
328ed539a5SBarry Smith extern int KSPGetPreconditionerSide(KSP,int *);
33f8936d11SLois Curfman McInnes extern int KSPGetMethodFromContext(KSP,KSPMethod *);
348ed539a5SBarry Smith extern int KSPSetRelativeTolerance(KSP,double);
358ed539a5SBarry Smith extern int KSPSetAbsoluteTolerance(KSP,double);
368ed539a5SBarry Smith extern int KSPSetDivergenceTolerance(KSP,double);
37*ae622e99SLois Curfman McInnes extern int KSPGetTolerances(KSP,double*,double*,double*,int*);
38f8936d11SLois Curfman McInnes extern int KSPSetCalculateResidual(KSP,PetscTruth);
398ed539a5SBarry Smith extern int KSPSetUsePreconditionedResidual(KSP);
40c39b5c85SLois Curfman McInnes extern int KSPSetInitialGuessNonzero(KSP);
418ed539a5SBarry Smith extern int KSPSetCalculateEigenvalues(KSP);
428ed539a5SBarry Smith extern int KSPSetRhs(KSP,Vec);
438ed539a5SBarry Smith extern int KSPGetRhs(KSP,Vec *);
448ed539a5SBarry Smith extern int KSPSetSolution(KSP,Vec);
458ed539a5SBarry Smith extern int KSPGetSolution(KSP,Vec *);
462eac72dbSBarry Smith 
47aabeff55SBarry Smith extern int KSPSetBinv(KSP,PC);
48aabeff55SBarry Smith extern int KSPGetBinv(KSP,PC*);
49aabeff55SBarry Smith 
508ed539a5SBarry Smith extern int KSPSetMonitor(KSP,int (*)(KSP,int,double, void*), void *);
518ed539a5SBarry Smith extern int KSPGetMonitorContext(KSP,void **);
528ed539a5SBarry Smith extern int KSPSetResidualHistory(KSP, double *,int);
538ed539a5SBarry Smith extern int KSPSetConvergenceTest(KSP,int (*)(KSP,int,double, void*), void *);
548ed539a5SBarry Smith extern int KSPGetConvergenceContext(KSP,void **);
552eac72dbSBarry Smith 
568ed539a5SBarry Smith extern int KSPBuildSolution(KSP, Vec,Vec *);
578ed539a5SBarry Smith extern int KSPBuildResidual(KSP, Vec, Vec,Vec *);
582eac72dbSBarry Smith 
598ed539a5SBarry Smith extern int KSPRichardsonSetScale(KSP , double);
608ed539a5SBarry Smith extern int KSPChebychevSetEigenvalues(KSP , double, double);
618ed539a5SBarry Smith extern int KSPCGGetEigenvalues(KSP, int n,double*,double*);
628ed539a5SBarry Smith extern int KSPGMRESSetRestart(KSP, int);
63441f95eaSBarry Smith extern int KSPGMRESSetUseUnmodifiedGrammSchmidt(KSP);
648ed539a5SBarry Smith extern int KSPSetFromOptions(KSP);
652eac72dbSBarry Smith 
668ed539a5SBarry Smith extern int KSPDefaultCGMonitor(KSP,int,double, void * );
678ed539a5SBarry Smith extern int KSPDefaultCGConverged(KSP,int,double, void *);
688ed539a5SBarry Smith extern int KSPDefaultMonitor(KSP,int,double, void *);
698c48e012SBarry Smith extern int KSPDefaultSMonitor(KSP,int,double, void *);
708ed539a5SBarry Smith extern int KSPDefaultConverged(KSP,int,double, void *);
712eac72dbSBarry Smith 
728ed539a5SBarry Smith extern int KSPPrintHelp(KSP);
738ed539a5SBarry Smith 
741eb62cbbSBarry Smith extern int KSPSetOptionsPrefix(KSP,char*);
751eb62cbbSBarry Smith 
768ed539a5SBarry Smith extern int KSPView(KSP,Viewer);
771eb62cbbSBarry Smith 
781eb62cbbSBarry Smith #if defined(__DRAW_PACKAGE)
791eb62cbbSBarry Smith extern int KSPLGMonitorCreate(char*,char*,int,int,int,int,DrawLGCtx*);
801eb62cbbSBarry Smith extern int KSPLGMonitor(KSP,int,double,void*);
811eb62cbbSBarry Smith extern int KSPLGMonitorDestroy(DrawLGCtx);
821eb62cbbSBarry Smith #endif
831eb62cbbSBarry Smith 
842eac72dbSBarry Smith #endif
852eac72dbSBarry Smith 
862eac72dbSBarry Smith 
87