xref: /petsc/include/petscksp.h (revision 2eac72db8c540d5ffabaab184fd7e6adb6fae597)
1*2eac72dbSBarry Smith 
2*2eac72dbSBarry Smith #ifndef __KSP_PACKAGE
3*2eac72dbSBarry Smith #define __KSP_PACKAGE
4*2eac72dbSBarry Smith #include "petsc.h"
5*2eac72dbSBarry Smith #include "vec.h"
6*2eac72dbSBarry Smith 
7*2eac72dbSBarry Smith typedef struct _KSP*     KSP;
8*2eac72dbSBarry Smith 
9*2eac72dbSBarry Smith /*  Possible Krylov Space Methods */
10*2eac72dbSBarry Smith typedef enum { KSPRICHARDSON, KSPCHEBYCHEV, KSPCG, KSPGMRES,
11*2eac72dbSBarry Smith                KSPTCQMR, KSPBCGS, KSPCGS, KSPTFQMR, KSPCR, KSPLSQR,
12*2eac72dbSBarry Smith                KSPPREONLY } KSPMETHOD;
13*2eac72dbSBarry Smith 
14*2eac72dbSBarry Smith 
15*2eac72dbSBarry Smith extern int KSPCreate          ANSI_ARGS((KSP *));
16*2eac72dbSBarry Smith extern int KSPSetMethod       ANSI_ARGS((KSP,KSPMETHOD));
17*2eac72dbSBarry Smith extern int KSPSetUp           ANSI_ARGS((KSP));
18*2eac72dbSBarry Smith extern int KSPSolve           ANSI_ARGS((KSP,int *));
19*2eac72dbSBarry Smith extern int KSPDestroy         ANSI_ARGS((KSP));
20*2eac72dbSBarry Smith 
21*2eac72dbSBarry Smith extern int KSPRegisterAll     ANSI_ARGS(());
22*2eac72dbSBarry Smith extern int KSPRegister        ANSI_ARGS((KSPMETHOD,char *,void (*)()));
23*2eac72dbSBarry Smith 
24*2eac72dbSBarry Smith extern int KSPGetMethodName   ANSI_ARGS((KSPMETHOD,char **));
25*2eac72dbSBarry Smith extern int KSPGetWorkCounts   ANSI_ARGS((KSP,int*,int*,int*,int*,int*));
26*2eac72dbSBarry Smith extern int KSPClearWorkCounts ANSI_ARGS((KSP));
27*2eac72dbSBarry Smith 
28*2eac72dbSBarry Smith extern int KSPSetIterations   ANSI_ARGS((KSP,int));
29*2eac72dbSBarry Smith extern int KSPSetRightPreconditioner ANSI_ARGS((KSP));
30*2eac72dbSBarry Smith extern int KSPGetPreconditionerSide ANSI_ARGS((KSP,int *));
31*2eac72dbSBarry Smith extern int KSPGetMethodFromContext  ANSI_ARGS((KSP,KSPMETHOD *));
32*2eac72dbSBarry Smith extern int KSPGetMethodFromCommandLine
33*2eac72dbSBarry Smith                     ANSI_ARGS((int *,char **,int,char *,KSPMETHOD *));
34*2eac72dbSBarry Smith extern int KSPSetRelativeTolerance  ANSI_ARGS((KSP,double));
35*2eac72dbSBarry Smith extern int KSPSetAbsoluteTolerance ANSI_ARGS((KSP,double));
36*2eac72dbSBarry Smith extern int KSPSetDivergenceTolerance  ANSI_ARGS((KSP,double));
37*2eac72dbSBarry Smith extern int KSPSetCalculateResidual ANSI_ARGS((KSP));
38*2eac72dbSBarry Smith extern int KSPSetDoNotCalculateResidual ANSI_ARGS((KSP));
39*2eac72dbSBarry Smith extern int KSPSetUsePreconditionedResidual ANSI_ARGS((KSP));
40*2eac72dbSBarry Smith extern int KSPSetInitialGuessZero ANSI_ARGS((KSP));
41*2eac72dbSBarry Smith extern int KSPSetCalculateEigenvalues ANSI_ARGS((KSP));
42*2eac72dbSBarry Smith extern int KSPSetRhs ANSI_ARGS((KSP,VeVector));
43*2eac72dbSBarry Smith extern int KSPGetRhs ANSI_ARGS((KSP,Vec *));
44*2eac72dbSBarry Smith extern int KSPSetSolution ANSI_ARGS((KSP,Vec));
45*2eac72dbSBarry Smith extern int KSPGetSolution ANSI_ARGS((KSP,Vec *));
46*2eac72dbSBarry Smith extern int KSPSetAmult  ANSI_ARGS((KSP,void (*)(void *,Vec,Vec),void *));
47*2eac72dbSBarry Smith 
48*2eac72dbSBarry Smith extern int KSPGetAmultContext ANSI_ARGS((KSP,void **));
49*2eac72dbSBarry Smith extern int KSPSetAmultTranspose ANSI_ARGS((KSP,void (*)(void *,Vec,Vec)));
50*2eac72dbSBarry Smith extern int KSPSetBinv     ANSI_ARGS((KSP,void(*)(void *,Vec,Vec),void *));
51*2eac72dbSBarry Smith extern int KSPGetBinvContext ANSI_ARGS((KSP,void **));
52*2eac72dbSBarry Smith extern int KSPSetBinvTranspose
53*2eac72dbSBarry Smith                     ANSI_ARGS((KSP,void (*)(void *,Vec,Vec)));
54*2eac72dbSBarry Smith extern int KSPSetMatop
55*2eac72dbSBarry Smith                     ANSI_ARGS((KSP,void (*)(void *,Vec,Vec)));
56*2eac72dbSBarry Smith extern int KSPSetMatopTranspose  ANSI_ARGS((KSP,void (*)(void *,Vec,Vec)));
57*2eac72dbSBarry Smith extern int KSPSetMonitor
58*2eac72dbSBarry Smith                ANSI_ARGS((KSP,void (*)(KSP,int,double, void*), void *));
59*2eac72dbSBarry Smith extern int KSPGetMonitorContext  ANSI_ARGS((KSP,void **));
60*2eac72dbSBarry Smith extern int KSPSetResidualHistory  ANSI_ARGS((KSP, double *,int));
61*2eac72dbSBarry Smith extern int KSPSetConvergenceTest
62*2eac72dbSBarry Smith                ANSI_ARGS((KSP,int (*)(KSP,int,double, void*), void *));
63*2eac72dbSBarry Smith extern int KSPGetConvergenceContext  ANSI_ARGS((KSP,void **));
64*2eac72dbSBarry Smith 
65*2eac72dbSBarry Smith extern int KSPBuildSolution  ANSI_ARGS((KSP, Vec,Vec *));
66*2eac72dbSBarry Smith extern int KSPBuildResidual  ANSI_ARGS((KSP, Vec, Vec,Vec *));
67*2eac72dbSBarry Smith 
68*2eac72dbSBarry Smith extern int KSPRichardsonSetScale  ANSI_ARGS((KSP , double));
69*2eac72dbSBarry Smith extern int KSPChebychevSetEigenvalues  ANSI_ARGS((KSP , double, double));
70*2eac72dbSBarry Smith extern int KSPGMRESSetRestart  ANSI_ARGS((KSP, int));
71*2eac72dbSBarry Smith 
72*2eac72dbSBarry Smith extern int KSPDefaultCGMonitor  ANSI_ARGS((KSP,int,double, void * ));
73*2eac72dbSBarry Smith extern int KSPDefaultCGConverged  ANSI_ARGS((KSP,int,double, void *));
74*2eac72dbSBarry Smith extern int KSPDefaultMonitor    ANSI_ARGS((KSP,int,double, void *));
75*2eac72dbSBarry Smith extern int KSPLineGraphMonitor  ANSI_ARGS((KSP,int,double, void *));
76*2eac72dbSBarry Smith extern int KSPDefaultConverged  ANSI_ARGS((KSP,int,double, void *));
77*2eac72dbSBarry Smith 
78*2eac72dbSBarry Smith #endif
79*2eac72dbSBarry Smith 
80*2eac72dbSBarry Smith 
81