1f26ada1bSBarry Smith /* 2f26ada1bSBarry Smith Defines the interface functions for the Krylov subspace accelerators. 3f26ada1bSBarry Smith */ 40a835dfdSSatish Balay #ifndef __PETSCKSP_H 50a835dfdSSatish Balay #define __PETSCKSP_H 60a835dfdSSatish Balay #include "petscpc.h" 7e9fa29b7SSatish Balay PETSC_EXTERN_CXX_BEGIN 82eac72dbSBarry Smith 97087cfbeSBarry Smith extern PetscErrorCode KSPInitializePackage(const char[]); 101dbb0a54SBarry Smith 1128ce4d24SBarry Smith /*S 1228ce4d24SBarry Smith KSP - Abstract PETSc object that manages all Krylov methods 1328ce4d24SBarry Smith 1428ce4d24SBarry Smith Level: beginner 1528ce4d24SBarry Smith 1628ce4d24SBarry Smith Concepts: Krylov methods 1728ce4d24SBarry Smith 1894b7f48cSBarry Smith .seealso: KSPCreate(), KSPSetType(), KSPType, SNES, TS, PC, KSP 1928ce4d24SBarry Smith S*/ 20e2a1c21fSSatish Balay typedef struct _p_KSP* KSP; 212eac72dbSBarry Smith 2228ce4d24SBarry Smith /*E 2328ce4d24SBarry Smith KSPType - String with the name of a PETSc Krylov method or the creation function 2428ce4d24SBarry Smith with an optional dynamic library name, for example 2528ce4d24SBarry Smith http://www.mcs.anl.gov/petsc/lib.a:mykspcreate() 2628ce4d24SBarry Smith 2728ce4d24SBarry Smith Level: beginner 2828ce4d24SBarry Smith 2928ce4d24SBarry Smith .seealso: KSPSetType(), KSP 3028ce4d24SBarry Smith E*/ 31a313700dSBarry Smith #define KSPType char* 3282bf6240SBarry Smith #define KSPRICHARDSON "richardson" 3382bf6240SBarry Smith #define KSPCHEBYCHEV "chebychev" 3482bf6240SBarry Smith #define KSPCG "cg" 35df2a969aSvictorle #define KSPCGNE "cgne" 36fcae7a14Stmunson #define KSPNASH "nash" 3780e17431SMatthew Knepley #define KSPSTCG "stcg" 388031f4adStmunson #define KSPGLTR "gltr" 3982bf6240SBarry Smith #define KSPGMRES "gmres" 409dcbbd2bSBarry Smith #define KSPFGMRES "fgmres" 419dcbbd2bSBarry Smith #define KSPLGMRES "lgmres" 424f8e6cd9SSatish Balay #define KSPDGMRES "dgmres" 4382bf6240SBarry Smith #define KSPTCQMR "tcqmr" 4482bf6240SBarry Smith #define KSPBCGS "bcgs" 45e1c61ce8SBarry Smith #define KSPIBCGS "ibcgs" 46f0037002Svictorle #define KSPBCGSL "bcgsl" 4782bf6240SBarry Smith #define KSPCGS "cgs" 4882bf6240SBarry Smith #define KSPTFQMR "tfqmr" 4982bf6240SBarry Smith #define KSPCR "cr" 5082bf6240SBarry Smith #define KSPLSQR "lsqr" 5182bf6240SBarry Smith #define KSPPREONLY "preonly" 5282bf6240SBarry Smith #define KSPQCG "qcg" 53c9cf9b11SBarry Smith #define KSPBICG "bicg" 54b4ac9ba4SBarry Smith #define KSPMINRES "minres" 5501c5daebSSatish Balay #define KSPSYMMLQ "symmlq" 5621356919SSatish Balay #define KSPLCD "lcd" 571d6018f0SLisandro Dalcin #define KSPPYTHON "python" 589f6b3dcaSBarry Smith #define KSPBROYDEN "broyden" 5958ad63f4SBarry Smith #define KSPGCR "gcr" 607945016fSBarry Smith #define KSPNGMRES "ngmres" 61bbce1389SJed Brown #define KSPSPECEST "specest" 622eac72dbSBarry Smith 638ba1e511SMatthew Knepley /* Logging support */ 647087cfbeSBarry Smith extern PetscClassId KSP_CLASSID; 658ba1e511SMatthew Knepley 667087cfbeSBarry Smith extern PetscErrorCode KSPCreate(MPI_Comm,KSP *); 677087cfbeSBarry Smith extern PetscErrorCode KSPSetType(KSP,const KSPType); 687087cfbeSBarry Smith extern PetscErrorCode KSPSetUp(KSP); 697087cfbeSBarry Smith extern PetscErrorCode KSPSetUpOnBlocks(KSP); 707087cfbeSBarry Smith extern PetscErrorCode KSPSolve(KSP,Vec,Vec); 717087cfbeSBarry Smith extern PetscErrorCode KSPSolveTranspose(KSP,Vec,Vec); 72a293aec7SJed Brown extern PetscErrorCode KSPReset(KSP); 73fcfd50ebSBarry Smith extern PetscErrorCode KSPDestroy(KSP*); 742eac72dbSBarry Smith 75b0a32e0cSBarry Smith extern PetscFList KSPList; 76ace3abfcSBarry Smith extern PetscBool KSPRegisterAllCalled; 777087cfbeSBarry Smith extern PetscErrorCode KSPRegisterAll(const char[]); 787087cfbeSBarry Smith extern PetscErrorCode KSPRegisterDestroy(void); 797087cfbeSBarry Smith extern PetscErrorCode KSPRegister(const char[],const char[],const char[],PetscErrorCode (*)(KSP)); 8030de9b25SBarry Smith 8130de9b25SBarry Smith /*MC 8230de9b25SBarry Smith KSPRegisterDynamic - Adds a method to the Krylov subspace solver package. 8330de9b25SBarry Smith 8430de9b25SBarry Smith Synopsis: 851890ba74SBarry Smith PetscErrorCode KSPRegisterDynamic(const char *name_solver,const char *path,const char *name_create,PetscErrorCode (*routine_create)(KSP)) 8630de9b25SBarry Smith 8730de9b25SBarry Smith Not Collective 8830de9b25SBarry Smith 8930de9b25SBarry Smith Input Parameters: 9030de9b25SBarry Smith + name_solver - name of a new user-defined solver 9130de9b25SBarry Smith . path - path (either absolute or relative) the library containing this solver 9230de9b25SBarry Smith . name_create - name of routine to create method context 9330de9b25SBarry Smith - routine_create - routine to create method context 9430de9b25SBarry Smith 9530de9b25SBarry Smith Notes: 9630de9b25SBarry Smith KSPRegisterDynamic() may be called multiple times to add several user-defined solvers. 9730de9b25SBarry Smith 9830de9b25SBarry Smith If dynamic libraries are used, then the fourth input argument (routine_create) 9930de9b25SBarry Smith is ignored. 10030de9b25SBarry Smith 10130de9b25SBarry Smith Sample usage: 10230de9b25SBarry Smith .vb 10330de9b25SBarry Smith KSPRegisterDynamic("my_solver",/home/username/my_lib/lib/libO/solaris/mylib.a, 10430de9b25SBarry Smith "MySolverCreate",MySolverCreate); 10530de9b25SBarry Smith .ve 10630de9b25SBarry Smith 10730de9b25SBarry Smith Then, your solver can be chosen with the procedural interface via 10830de9b25SBarry Smith $ KSPSetType(ksp,"my_solver") 10930de9b25SBarry Smith or at runtime via the option 11030de9b25SBarry Smith $ -ksp_type my_solver 11130de9b25SBarry Smith 11230de9b25SBarry Smith Level: advanced 11330de9b25SBarry Smith 114ab901514SBarry Smith Notes: Environmental variables such as ${PETSC_ARCH}, ${PETSC_DIR}, ${PETSC_LIB_DIR}, 11530de9b25SBarry Smith and others of the form ${any_environmental_variable} occuring in pathname will be 11630de9b25SBarry Smith replaced with appropriate values. 11730de9b25SBarry Smith If your function is not being put into a shared library then use KSPRegister() instead 11830de9b25SBarry Smith 11930de9b25SBarry Smith .keywords: KSP, register 12030de9b25SBarry Smith 12130de9b25SBarry Smith .seealso: KSPRegisterAll(), KSPRegisterDestroy() 12230de9b25SBarry Smith 12330de9b25SBarry Smith M*/ 124aa482453SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES) 125f1af5d2fSBarry Smith #define KSPRegisterDynamic(a,b,c,d) KSPRegister(a,b,c,0) 1266df38c32SLois Curfman McInnes #else 127f1af5d2fSBarry Smith #define KSPRegisterDynamic(a,b,c,d) KSPRegister(a,b,c,d) 1286df38c32SLois Curfman McInnes #endif 12982bf6240SBarry Smith 1307087cfbeSBarry Smith extern PetscErrorCode KSPGetType(KSP,const KSPType *); 1317087cfbeSBarry Smith extern PetscErrorCode KSPSetPCSide(KSP,PCSide); 1327087cfbeSBarry Smith extern PetscErrorCode KSPGetPCSide(KSP,PCSide*); 1337087cfbeSBarry Smith extern PetscErrorCode KSPGetTolerances(KSP,PetscReal*,PetscReal*,PetscReal*,PetscInt*); 1347087cfbeSBarry Smith extern PetscErrorCode KSPSetTolerances(KSP,PetscReal,PetscReal,PetscReal,PetscInt); 1357087cfbeSBarry Smith extern PetscErrorCode KSPSetInitialGuessNonzero(KSP,PetscBool ); 1367087cfbeSBarry Smith extern PetscErrorCode KSPGetInitialGuessNonzero(KSP,PetscBool *); 1377087cfbeSBarry Smith extern PetscErrorCode KSPSetInitialGuessKnoll(KSP,PetscBool ); 1387087cfbeSBarry Smith extern PetscErrorCode KSPGetInitialGuessKnoll(KSP,PetscBool *); 1397087cfbeSBarry Smith extern PetscErrorCode KSPSetErrorIfNotConverged(KSP,PetscBool ); 1407087cfbeSBarry Smith extern PetscErrorCode KSPGetErrorIfNotConverged(KSP,PetscBool *); 1417087cfbeSBarry Smith extern PetscErrorCode KSPGetComputeEigenvalues(KSP,PetscBool *); 1427087cfbeSBarry Smith extern PetscErrorCode KSPSetComputeEigenvalues(KSP,PetscBool ); 1437087cfbeSBarry Smith extern PetscErrorCode KSPGetComputeSingularValues(KSP,PetscBool *); 1447087cfbeSBarry Smith extern PetscErrorCode KSPSetComputeSingularValues(KSP,PetscBool ); 1457087cfbeSBarry Smith extern PetscErrorCode KSPGetRhs(KSP,Vec *); 1467087cfbeSBarry Smith extern PetscErrorCode KSPGetSolution(KSP,Vec *); 1477087cfbeSBarry Smith extern PetscErrorCode KSPGetResidualNorm(KSP,PetscReal*); 1487087cfbeSBarry Smith extern PetscErrorCode KSPGetIterationNumber(KSP,PetscInt*); 1497087cfbeSBarry Smith extern PetscErrorCode KSPSetNullSpace(KSP,MatNullSpace); 1507087cfbeSBarry Smith extern PetscErrorCode KSPGetNullSpace(KSP,MatNullSpace*); 1517087cfbeSBarry Smith extern PetscErrorCode KSPGetVecs(KSP,PetscInt,Vec**,PetscInt,Vec**); 1522eac72dbSBarry Smith 1537087cfbeSBarry Smith extern PetscErrorCode KSPSetPC(KSP,PC); 1547087cfbeSBarry Smith extern PetscErrorCode KSPGetPC(KSP,PC*); 155aabeff55SBarry Smith 156c2efdce3SBarry Smith extern PetscErrorCode KSPMonitorSet(KSP,PetscErrorCode (*)(KSP,PetscInt,PetscReal,void*),void *,PetscErrorCode (*)(void**)); 1577087cfbeSBarry Smith extern PetscErrorCode KSPMonitorCancel(KSP); 1587087cfbeSBarry Smith extern PetscErrorCode KSPGetMonitorContext(KSP,void **); 1597087cfbeSBarry Smith extern PetscErrorCode KSPGetResidualHistory(KSP,PetscReal*[],PetscInt *); 1607087cfbeSBarry Smith extern PetscErrorCode KSPSetResidualHistory(KSP,PetscReal[],PetscInt,PetscBool ); 1614b0e389bSBarry Smith 1620e33f6ddSBarry Smith /* not sure where to put this */ 1637087cfbeSBarry Smith extern PetscErrorCode PCKSPGetKSP(PC,KSP*); 1647087cfbeSBarry Smith extern PetscErrorCode PCBJacobiGetSubKSP(PC,PetscInt*,PetscInt*,KSP*[]); 1657087cfbeSBarry Smith extern PetscErrorCode PCASMGetSubKSP(PC,PetscInt*,PetscInt*,KSP*[]); 1667087cfbeSBarry Smith extern PetscErrorCode PCGASMGetSubKSP(PC,PetscInt*,PetscInt*,KSP*[]); 1677087cfbeSBarry Smith extern PetscErrorCode PCFieldSplitGetSubKSP(PC,PetscInt*,KSP*[]); 1682eac72dbSBarry Smith 1697087cfbeSBarry Smith extern PetscErrorCode PCGalerkinGetKSP(PC,KSP *); 1700a71e23eSMatthew Knepley 1717087cfbeSBarry Smith extern PetscErrorCode KSPBuildSolution(KSP,Vec,Vec *); 1727087cfbeSBarry Smith extern PetscErrorCode KSPBuildResidual(KSP,Vec,Vec,Vec *); 1732eac72dbSBarry Smith 1747087cfbeSBarry Smith extern PetscErrorCode KSPRichardsonSetScale(KSP,PetscReal); 1757087cfbeSBarry Smith extern PetscErrorCode KSPRichardsonSetSelfScale(KSP,PetscBool ); 1767087cfbeSBarry Smith extern PetscErrorCode KSPChebychevSetEigenvalues(KSP,PetscReal,PetscReal); 177*59709827SJed Brown extern PetscErrorCode KSPChebychevSetEstimateEigenvalues(KSP,PetscReal,PetscReal,PetscReal,PetscReal); 1787087cfbeSBarry Smith extern PetscErrorCode KSPComputeExtremeSingularValues(KSP,PetscReal*,PetscReal*); 1797087cfbeSBarry Smith extern PetscErrorCode KSPComputeEigenvalues(KSP,PetscInt,PetscReal*,PetscReal*,PetscInt *); 1807087cfbeSBarry Smith extern PetscErrorCode KSPComputeEigenvaluesExplicitly(KSP,PetscInt,PetscReal*,PetscReal*); 1814b0e389bSBarry Smith 1827087cfbeSBarry Smith extern PetscErrorCode KSPGMRESSetRestart(KSP, PetscInt); 1837087cfbeSBarry Smith extern PetscErrorCode KSPGMRESGetRestart(KSP, PetscInt*); 1847087cfbeSBarry Smith extern PetscErrorCode KSPGMRESSetHapTol(KSP,PetscReal); 1859f236934SBarry Smith 1867087cfbeSBarry Smith extern PetscErrorCode KSPGMRESSetPreAllocateVectors(KSP); 1877087cfbeSBarry Smith extern PetscErrorCode KSPGMRESSetOrthogonalization(KSP,PetscErrorCode (*)(KSP,PetscInt)); 1887087cfbeSBarry Smith extern PetscErrorCode KSPGMRESGetOrthogonalization(KSP,PetscErrorCode (**)(KSP,PetscInt)); 1897087cfbeSBarry Smith extern PetscErrorCode KSPGMRESModifiedGramSchmidtOrthogonalization(KSP,PetscInt); 1907087cfbeSBarry Smith extern PetscErrorCode KSPGMRESClassicalGramSchmidtOrthogonalization(KSP,PetscInt); 1911d73ed98SBarry Smith 1927087cfbeSBarry Smith extern PetscErrorCode KSPLGMRESSetAugDim(KSP,PetscInt); 1937087cfbeSBarry Smith extern PetscErrorCode KSPLGMRESSetConstant(KSP); 1941d73ed98SBarry Smith 1957087cfbeSBarry Smith extern PetscErrorCode KSPGCRSetRestart(KSP,PetscInt); 1967087cfbeSBarry Smith extern PetscErrorCode KSPGCRGetRestart(KSP,PetscInt*); 1977087cfbeSBarry Smith extern PetscErrorCode KSPGCRSetModifyPC(KSP,PetscErrorCode (*)(KSP,PetscInt,PetscReal,void*),void*,PetscErrorCode(*)(void*)); 19858ad63f4SBarry Smith 199b49fd9e1SBarry Smith /*E 200b49fd9e1SBarry Smith KSPGMRESCGSRefinementType - How the classical (unmodified) Gram-Schmidt is performed. 201b49fd9e1SBarry Smith 202b49fd9e1SBarry Smith Level: advanced 203b49fd9e1SBarry Smith 204bef9c725SBarry Smith .seealso: KSPGMRESClassicalGramSchmidtOrthogonalization(), KSPGMRESSetOrthogonalization(), KSPGMRESGetOrthogonalization(), 205e928de20SBarry Smith KSPGMRESSetCGSRefinementType(), KSPGMRESGetCGSRefinementType(), KSPGMRESModifiedGramSchmidtOrthogonalization() 206b49fd9e1SBarry Smith 207b49fd9e1SBarry Smith E*/ 20878d1dd23SKris Buschelman typedef enum {KSP_GMRES_CGS_REFINE_NEVER, KSP_GMRES_CGS_REFINE_IFNEEDED, KSP_GMRES_CGS_REFINE_ALWAYS} KSPGMRESCGSRefinementType; 2099dcbbd2bSBarry Smith extern const char *KSPGMRESCGSRefinementTypes[]; 2101f7e983dSSatish Balay /*MC 2118c5b8ba0SBarry Smith KSP_GMRES_CGS_REFINE_NEVER - Just do the classical (unmodified) Gram-Schmidt process 2128c5b8ba0SBarry Smith 2138c5b8ba0SBarry Smith Level: advanced 2148c5b8ba0SBarry Smith 2158c5b8ba0SBarry Smith Note: Possible unstable, but the fastest to compute 2168c5b8ba0SBarry Smith 217bef9c725SBarry Smith .seealso: KSPGMRESClassicalGramSchmidtOrthogonalization(), KSPGMRESSetOrthogonalization(), KSPGMRESGetOrthogonalization(), 218e928de20SBarry Smith KSPGMRESSetCGSRefinementType(), KSPGMRESGetCGSRefinementType(), KSP_GMRES_CGS_REFINE_IFNEEDED, KSP_GMRES_CGS_REFINE_ALWAYS, 2198c5b8ba0SBarry Smith KSPGMRESModifiedGramSchmidtOrthogonalization() 2208c5b8ba0SBarry Smith M*/ 2218c5b8ba0SBarry Smith 2221f7e983dSSatish Balay /*MC 2238c5b8ba0SBarry Smith KSP_GMRES_CGS_REFINE_IFNEEDED - Do the classical (unmodified) Gram-Schmidt process and one step of 2248c5b8ba0SBarry Smith iterative refinement if an estimate of the orthogonality of the resulting vectors indicates 2258c5b8ba0SBarry Smith poor orthogonality. 2268c5b8ba0SBarry Smith 2278c5b8ba0SBarry Smith Level: advanced 2288c5b8ba0SBarry Smith 2298c5b8ba0SBarry Smith Note: This is slower than KSP_GMRES_CGS_REFINE_NEVER because it requires an extra norm computation to 2308c5b8ba0SBarry Smith estimate the orthogonality but is more stable. 2318c5b8ba0SBarry Smith 232bef9c725SBarry Smith .seealso: KSPGMRESClassicalGramSchmidtOrthogonalization(), KSPGMRESSetOrthogonalization(), KSPGMRESGetOrthogonalization(), 233e928de20SBarry Smith KSPGMRESSetCGSRefinementType(), KSPGMRESGetCGSRefinementType(), KSP_GMRES_CGS_REFINE_NEVER, KSP_GMRES_CGS_REFINE_ALWAYS, 2348c5b8ba0SBarry Smith KSPGMRESModifiedGramSchmidtOrthogonalization() 2358c5b8ba0SBarry Smith M*/ 2368c5b8ba0SBarry Smith 2371f7e983dSSatish Balay /*MC 2388c5b8ba0SBarry Smith KSP_GMRES_CGS_REFINE_NEVER - Do two steps of the classical (unmodified) Gram-Schmidt process. 2398c5b8ba0SBarry Smith 2408c5b8ba0SBarry Smith Level: advanced 2418c5b8ba0SBarry Smith 2428c5b8ba0SBarry Smith Note: This is roughly twice the cost of KSP_GMRES_CGS_REFINE_NEVER because it performs the process twice 2438c5b8ba0SBarry Smith but it saves the extra norm calculation needed by KSP_GMRES_CGS_REFINE_IFNEEDED. 2448c5b8ba0SBarry Smith 2458c5b8ba0SBarry Smith You should only use this if you absolutely know that the iterative refinement is needed. 2468c5b8ba0SBarry Smith 247bef9c725SBarry Smith .seealso: KSPGMRESClassicalGramSchmidtOrthogonalization(), KSPGMRESSetOrthogonalization(), KSPGMRESGetOrthogonalization(), 248e928de20SBarry Smith KSPGMRESSetCGSRefinementType(), KSPGMRESGetCGSRefinementType(), KSP_GMRES_CGS_REFINE_IFNEEDED, KSP_GMRES_CGS_REFINE_ALWAYS, 2498c5b8ba0SBarry Smith KSPGMRESModifiedGramSchmidtOrthogonalization() 2508c5b8ba0SBarry Smith M*/ 2518c5b8ba0SBarry Smith 2527087cfbeSBarry Smith extern PetscErrorCode KSPGMRESSetCGSRefinementType(KSP,KSPGMRESCGSRefinementType); 2537087cfbeSBarry Smith extern PetscErrorCode KSPGMRESGetCGSRefinementType(KSP,KSPGMRESCGSRefinementType*); 25408480c60SBarry Smith 2557087cfbeSBarry Smith extern PetscErrorCode KSPFGMRESModifyPCNoChange(KSP,PetscInt,PetscInt,PetscReal,void*); 2567087cfbeSBarry Smith extern PetscErrorCode KSPFGMRESModifyPCKSP(KSP,PetscInt,PetscInt,PetscReal,void*); 2577087cfbeSBarry Smith extern PetscErrorCode KSPFGMRESSetModifyPC(KSP,PetscErrorCode (*)(KSP,PetscInt,PetscInt,PetscReal,void*),void*,PetscErrorCode(*)(void*)); 258c38d4ed2SBarry Smith 2597087cfbeSBarry Smith extern PetscErrorCode KSPQCGSetTrustRegionRadius(KSP,PetscReal); 2607087cfbeSBarry Smith extern PetscErrorCode KSPQCGGetQuadratic(KSP,PetscReal*); 2617087cfbeSBarry Smith extern PetscErrorCode KSPQCGGetTrialStepNorm(KSP,PetscReal*); 262121fd945SKris Buschelman 2637087cfbeSBarry Smith extern PetscErrorCode KSPBCGSLSetXRes(KSP,PetscReal); 2647087cfbeSBarry Smith extern PetscErrorCode KSPBCGSLSetPol(KSP,PetscBool ); 2657087cfbeSBarry Smith extern PetscErrorCode KSPBCGSLSetEll(KSP,PetscInt); 266d9492815SBarry Smith 2677087cfbeSBarry Smith extern PetscErrorCode KSPSetFromOptions(KSP); 2687087cfbeSBarry Smith extern PetscErrorCode KSPAddOptionsChecker(PetscErrorCode (*)(KSP)); 2692eac72dbSBarry Smith 2707087cfbeSBarry Smith extern PetscErrorCode KSPMonitorSingularValue(KSP,PetscInt,PetscReal,void *); 2717087cfbeSBarry Smith extern PetscErrorCode KSPMonitorDefault(KSP,PetscInt,PetscReal,void *); 2727087cfbeSBarry Smith extern PetscErrorCode KSPMonitorDefaultLSQR(KSP,PetscInt,PetscReal,void *); 2737087cfbeSBarry Smith extern PetscErrorCode KSPMonitorRange(KSP,PetscInt,PetscReal,void *); 2747087cfbeSBarry Smith extern PetscErrorCode KSPMonitorTrueResidualNorm(KSP,PetscInt,PetscReal,void *); 2757087cfbeSBarry Smith extern PetscErrorCode KSPMonitorDefaultShort(KSP,PetscInt,PetscReal,void *); 2767087cfbeSBarry Smith extern PetscErrorCode KSPMonitorSolution(KSP,PetscInt,PetscReal,void *); 2777087cfbeSBarry Smith extern PetscErrorCode KSPGMRESMonitorKrylov(KSP,PetscInt,PetscReal,void *); 27884cb2905SBarry Smith 2797087cfbeSBarry Smith extern PetscErrorCode KSPUnwindPreconditioner(KSP,Vec,Vec); 2807087cfbeSBarry Smith extern PetscErrorCode KSPDefaultBuildSolution(KSP,Vec,Vec*); 2817087cfbeSBarry Smith extern PetscErrorCode KSPDefaultBuildResidual(KSP,Vec,Vec,Vec *); 2827087cfbeSBarry Smith extern PetscErrorCode KSPInitialResidual(KSP,Vec,Vec,Vec,Vec,Vec); 283c01c455dSBarry Smith 2847087cfbeSBarry Smith extern PetscErrorCode KSPSetOperators(KSP,Mat,Mat,MatStructure); 2857087cfbeSBarry Smith extern PetscErrorCode KSPGetOperators(KSP,Mat*,Mat*,MatStructure*); 2867087cfbeSBarry Smith extern PetscErrorCode KSPGetOperatorsSet(KSP,PetscBool *,PetscBool *); 2877087cfbeSBarry Smith extern PetscErrorCode KSPSetOptionsPrefix(KSP,const char[]); 2887087cfbeSBarry Smith extern PetscErrorCode KSPAppendOptionsPrefix(KSP,const char[]); 2897087cfbeSBarry Smith extern PetscErrorCode KSPGetOptionsPrefix(KSP,const char*[]); 2901eb62cbbSBarry Smith 2917087cfbeSBarry Smith extern PetscErrorCode KSPSetDiagonalScale(KSP,PetscBool ); 2927087cfbeSBarry Smith extern PetscErrorCode KSPGetDiagonalScale(KSP,PetscBool *); 2937087cfbeSBarry Smith extern PetscErrorCode KSPSetDiagonalScaleFix(KSP,PetscBool ); 2947087cfbeSBarry Smith extern PetscErrorCode KSPGetDiagonalScaleFix(KSP,PetscBool *); 2951f7f0c4fSBarry Smith 2967087cfbeSBarry Smith extern PetscErrorCode KSPView(KSP,PetscViewer); 2971eb62cbbSBarry Smith 2987087cfbeSBarry Smith extern PetscErrorCode KSPLSQRSetStandardErrorVec(KSP,Vec); 2997087cfbeSBarry Smith extern PetscErrorCode KSPLSQRGetStandardErrorVec(KSP,Vec*); 300db9b2ab1SHong Zhang 30183ab6a24SBarry Smith extern PetscErrorCode PCRedundantGetKSP(PC,KSP*); 3025e7ef714SBarry Smith extern PetscErrorCode PCRedistributeGetKSP(PC,KSP*); 30383ab6a24SBarry Smith 30428ce4d24SBarry Smith /*E 3058a4b9c5cSBarry Smith KSPNormType - Norm that is passed in the Krylov convergence 3068a4b9c5cSBarry Smith test routines. 3078a4b9c5cSBarry Smith 3088a4b9c5cSBarry Smith Level: advanced 3098a4b9c5cSBarry Smith 310a3f661c8SBarry Smith Each solver only supports a subset of these and some may support different ones 3111718446fSBarry Smith depending on left or right preconditioning, see KSPSetPCSide() 312a3f661c8SBarry Smith 3138a4b9c5cSBarry Smith Notes: this must match finclude/petscksp.h 3148a4b9c5cSBarry Smith 31594b7f48cSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPSetNormType(), 3161718446fSBarry Smith KSPSetConvergenceTest(), KSPSetPCSide() 3178a4b9c5cSBarry Smith E*/ 3189e568555SJed Brown typedef enum {KSP_NORM_DEFAULT = -1,KSP_NORM_NONE = 0,KSP_NORM_PRECONDITIONED = 1,KSP_NORM_UNPRECONDITIONED = 2,KSP_NORM_NATURAL = 3} KSPNormType; 3199e568555SJed Brown #define KSP_NORM_MAX (KSP_NORM_NATURAL + 1) 3209e568555SJed Brown extern const char *const*const KSPNormTypes; 321a21b2a99SBarry Smith 3221f7e983dSSatish Balay /*MC 3239793b452SBarry Smith KSP_NORM_NONE - Do not compute a norm during the Krylov process. This will 3248c5b8ba0SBarry Smith possibly save some computation but means the convergence test cannot 3258c5b8ba0SBarry Smith be based on a norm of a residual etc. 3268c5b8ba0SBarry Smith 3278c5b8ba0SBarry Smith Level: advanced 3288c5b8ba0SBarry Smith 329085a36d4SBarry Smith Note: Some Krylov methods need to compute a residual norm and then this option is ignored 3308c5b8ba0SBarry Smith 331ce9499c7SBarry Smith .seealso: KSPNormType, KSPSetNormType(), KSP_NORM_PRECONDITIONED, KSP_NORM_UNPRECONDITIONED, KSP_NORM_NATURAL 3328c5b8ba0SBarry Smith M*/ 3338c5b8ba0SBarry Smith 3341f7e983dSSatish Balay /*MC 335ce9499c7SBarry Smith KSP_NORM_PRECONDITIONED - Compute the norm of the preconditioned residual and pass that to the 3368c5b8ba0SBarry Smith convergence test routine. 3378c5b8ba0SBarry Smith 3388c5b8ba0SBarry Smith Level: advanced 3398c5b8ba0SBarry Smith 3409793b452SBarry Smith .seealso: KSPNormType, KSPSetNormType(), KSP_NORM_NONE, KSP_NORM_UNPRECONDITIONED, KSP_NORM_NATURAL, KSPSetConvergenceTest() 3418c5b8ba0SBarry Smith M*/ 3428c5b8ba0SBarry Smith 3431f7e983dSSatish Balay /*MC 344ce9499c7SBarry Smith KSP_NORM_UNPRECONDITIONED - Compute the norm of the true residual (b - A*x) and pass that to the 3458c5b8ba0SBarry Smith convergence test routine. 3468c5b8ba0SBarry Smith 3478c5b8ba0SBarry Smith Level: advanced 3488c5b8ba0SBarry Smith 3499793b452SBarry Smith .seealso: KSPNormType, KSPSetNormType(), KSP_NORM_NONE, KSP_NORM_PRECONDITIONED, KSP_NORM_NATURAL, KSPSetConvergenceTest() 3508c5b8ba0SBarry Smith M*/ 3518c5b8ba0SBarry Smith 3521f7e983dSSatish Balay /*MC 353ce9499c7SBarry Smith KSP_NORM_NATURAL - Compute the 'natural norm' of residual sqrt((b - A*x)*B*(b - A*x)) and pass that to the 354a3f661c8SBarry Smith convergence test routine. This is only supported by KSPCG, KSPCR, KSPCGNE, KSPCGS 3558c5b8ba0SBarry Smith 3568c5b8ba0SBarry Smith Level: advanced 3578c5b8ba0SBarry Smith 3589793b452SBarry Smith .seealso: KSPNormType, KSPSetNormType(), KSP_NORM_NONE, KSP_NORM_PRECONDITIONED, KSP_NORM_UNPRECONDITIONED, KSPSetConvergenceTest() 3598c5b8ba0SBarry Smith M*/ 3608c5b8ba0SBarry Smith 3617087cfbeSBarry Smith extern PetscErrorCode KSPSetNormType(KSP,KSPNormType); 3627087cfbeSBarry Smith extern PetscErrorCode KSPGetNormType(KSP,KSPNormType*); 3639e568555SJed Brown extern PetscErrorCode KSPSetSupportedNorm(KSP ksp,KSPNormType,PCSide,PetscInt); 3647087cfbeSBarry Smith extern PetscErrorCode KSPSetCheckNormIteration(KSP,PetscInt); 3657087cfbeSBarry Smith extern PetscErrorCode KSPSetLagNorm(KSP,PetscBool ); 3668a4b9c5cSBarry Smith 3678a4b9c5cSBarry Smith /*E 36828ce4d24SBarry Smith KSPConvergedReason - reason a Krylov method was said to 36928ce4d24SBarry Smith have converged or diverged 37028ce4d24SBarry Smith 37128ce4d24SBarry Smith Level: beginner 37228ce4d24SBarry Smith 3734d0a8057SBarry Smith Notes: See KSPGetConvergedReason() for explanation of each value 37428ce4d24SBarry Smith 3754d0a8057SBarry Smith Developer notes: this must match finclude/petscksp.h 3764d0a8057SBarry Smith 3774d0a8057SBarry Smith The string versions of these are KSPConvergedReasons; if you change 3784d0a8057SBarry Smith any of the values here also change them that array of names. 37986c02ca4SBarry Smith 380c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPSetTolerances() 38128ce4d24SBarry Smith E*/ 382d15094e1SBarry Smith typedef enum {/* converged */ 3839ecb1286SBarry Smith KSP_CONVERGED_RTOL_NORMAL = 1, 3849ecb1286SBarry Smith KSP_CONVERGED_ATOL_NORMAL = 9, 385d15094e1SBarry Smith KSP_CONVERGED_RTOL = 2, 386d15094e1SBarry Smith KSP_CONVERGED_ATOL = 3, 387b335793eSSatish Balay KSP_CONVERGED_ITS = 4, 3888031f4adStmunson KSP_CONVERGED_CG_NEG_CURVE = 5, 3898031f4adStmunson KSP_CONVERGED_CG_CONSTRAINED = 6, 390329f5518SBarry Smith KSP_CONVERGED_STEP_LENGTH = 7, 391af3d8002SBarry Smith KSP_CONVERGED_HAPPY_BREAKDOWN = 8, 392d15094e1SBarry Smith /* diverged */ 393b3cc6726SBarry Smith KSP_DIVERGED_NULL = -2, 394d15094e1SBarry Smith KSP_DIVERGED_ITS = -3, 395d15094e1SBarry Smith KSP_DIVERGED_DTOL = -4, 396d15094e1SBarry Smith KSP_DIVERGED_BREAKDOWN = -5, 397b4ac9ba4SBarry Smith KSP_DIVERGED_BREAKDOWN_BICG = -6, 398b4ac9ba4SBarry Smith KSP_DIVERGED_NONSYMMETRIC = -7, 399b4ac9ba4SBarry Smith KSP_DIVERGED_INDEFINITE_PC = -8, 4006aee1118SBarry Smith KSP_DIVERGED_NAN = -9, 4016aee1118SBarry Smith KSP_DIVERGED_INDEFINITE_MAT = -10, 402d15094e1SBarry Smith 403d15094e1SBarry Smith KSP_CONVERGED_ITERATING = 0} KSPConvergedReason; 4047935a769SJed Brown extern const char *const*KSPConvergedReasons; 405d15094e1SBarry Smith 406c838673bSBarry Smith /*MC 407c838673bSBarry Smith KSP_CONVERGED_RTOL - norm(r) <= rtol*norm(b) 408c838673bSBarry Smith 409c838673bSBarry Smith Level: beginner 410c838673bSBarry Smith 411c838673bSBarry Smith See KSPNormType and KSPSetNormType() for possible norms that may be used. By default 412c838673bSBarry Smith for left preconditioning it is the 2-norm of the preconditioned residual, and the 413c838673bSBarry Smith 2-norm of the residual for right preconditioning 414c838673bSBarry Smith 415c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 416c838673bSBarry Smith 417c838673bSBarry Smith M*/ 418c838673bSBarry Smith 419c838673bSBarry Smith /*MC 420c838673bSBarry Smith KSP_CONVERGED_ATOL - norm(r) <= atol 421c838673bSBarry Smith 422c838673bSBarry Smith Level: beginner 423c838673bSBarry Smith 424c838673bSBarry Smith See KSPNormType and KSPSetNormType() for possible norms that may be used. By default 425c838673bSBarry Smith for left preconditioning it is the 2-norm of the preconditioned residual, and the 426c838673bSBarry Smith 2-norm of the residual for right preconditioning 427c838673bSBarry Smith 428c838673bSBarry Smith Level: beginner 429c838673bSBarry Smith 430c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 431c838673bSBarry Smith 432c838673bSBarry Smith M*/ 433c838673bSBarry Smith 434c838673bSBarry Smith /*MC 435c838673bSBarry Smith KSP_DIVERGED_DTOL - norm(r) >= dtol*norm(b) 436c838673bSBarry Smith 437c838673bSBarry Smith Level: beginner 438c838673bSBarry Smith 439c838673bSBarry Smith See KSPNormType and KSPSetNormType() for possible norms that may be used. By default 440c838673bSBarry Smith for left preconditioning it is the 2-norm of the preconditioned residual, and the 441c838673bSBarry Smith 2-norm of the residual for right preconditioning 442c838673bSBarry Smith 443c838673bSBarry Smith Level: beginner 444c838673bSBarry Smith 445c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 446c838673bSBarry Smith 447c838673bSBarry Smith M*/ 448c838673bSBarry Smith 449c838673bSBarry Smith /*MC 450c838673bSBarry Smith KSP_DIVERGED_ITS - Ran out of iterations before any convergence criteria was 451c838673bSBarry Smith reached 452c838673bSBarry Smith 453c838673bSBarry Smith Level: beginner 454c838673bSBarry Smith 455c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 456c838673bSBarry Smith 457c838673bSBarry Smith M*/ 458c838673bSBarry Smith 459c838673bSBarry Smith /*MC 4608c9406f6SLisandro Dalcin KSP_CONVERGED_ITS - Used by the KSPPREONLY solver after the single iteration of 4618c9406f6SLisandro Dalcin the preconditioner is applied. Also used when the KSPSkipConverged() convergence 4624d0a8057SBarry Smith test routine is set in KSP. 463c838673bSBarry Smith 464c838673bSBarry Smith 465c838673bSBarry Smith Level: beginner 466c838673bSBarry Smith 467c838673bSBarry Smith 468c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 469c838673bSBarry Smith 470c838673bSBarry Smith M*/ 471c838673bSBarry Smith 472c838673bSBarry Smith /*MC 473c838673bSBarry Smith KSP_DIVERGED_BREAKDOWN - A breakdown in the Krylov method was detected so the 4743014e516SBarry Smith method could not continue to enlarge the Krylov space. Could be due to a singlular matrix or 4753014e516SBarry Smith preconditioner. 476c838673bSBarry Smith 477c838673bSBarry Smith Level: beginner 478c838673bSBarry Smith 479c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 480c838673bSBarry Smith 481c838673bSBarry Smith M*/ 482c838673bSBarry Smith 483c838673bSBarry Smith /*MC 484c838673bSBarry Smith KSP_DIVERGED_BREAKDOWN_BICG - A breakdown in the KSPBICG method was detected so the 485c838673bSBarry Smith method could not continue to enlarge the Krylov space. 486c838673bSBarry Smith 487c838673bSBarry Smith 488c838673bSBarry Smith Level: beginner 489c838673bSBarry Smith 490c838673bSBarry Smith 491c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 492c838673bSBarry Smith 493c838673bSBarry Smith M*/ 494c838673bSBarry Smith 495c838673bSBarry Smith /*MC 496c838673bSBarry Smith KSP_DIVERGED_NONSYMMETRIC - It appears the operator or preconditioner is not 497c838673bSBarry Smith symmetric and this Krylov method (KSPCG, KSPMINRES, KSPCR) requires symmetry 498c838673bSBarry Smith 499c838673bSBarry Smith Level: beginner 500c838673bSBarry Smith 501c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 502c838673bSBarry Smith 503c838673bSBarry Smith M*/ 504c838673bSBarry Smith 505c838673bSBarry Smith /*MC 506c838673bSBarry Smith KSP_DIVERGED_INDEFINITE_PC - It appears the preconditioner is indefinite (has both 507c838673bSBarry Smith positive and negative eigenvalues) and this Krylov method (KSPCG) requires it to 508c838673bSBarry Smith be positive definite 509c838673bSBarry Smith 510c838673bSBarry Smith Level: beginner 511c838673bSBarry Smith 5122401956bSBarry Smith Notes: This can happen with the PCICC preconditioner, use -pc_factor_shift_positive_definite to force 513c838673bSBarry Smith the PCICC preconditioner to generate a positive definite preconditioner 514c838673bSBarry Smith 515c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 516c838673bSBarry Smith 517c838673bSBarry Smith M*/ 518c838673bSBarry Smith 519c838673bSBarry Smith /*MC 520c838673bSBarry Smith KSP_CONVERGED_ITERATING - This flag is returned if you call KSPGetConvergedReason() 521c838673bSBarry Smith while the KSPSolve() is still running. 522c838673bSBarry Smith 523c838673bSBarry Smith Level: beginner 524c838673bSBarry Smith 525c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 526c838673bSBarry Smith 527c838673bSBarry Smith M*/ 528c838673bSBarry Smith 5297087cfbeSBarry Smith extern PetscErrorCode KSPSetConvergenceTest(KSP,PetscErrorCode (*)(KSP,PetscInt,PetscReal,KSPConvergedReason*,void*),void *,PetscErrorCode (*)(void*)); 5307087cfbeSBarry Smith extern PetscErrorCode KSPGetConvergenceContext(KSP,void **); 5317087cfbeSBarry Smith extern PetscErrorCode KSPDefaultConverged(KSP,PetscInt,PetscReal,KSPConvergedReason*,void *); 5327087cfbeSBarry Smith extern PetscErrorCode KSPConvergedLSQR(KSP,PetscInt,PetscReal,KSPConvergedReason*,void *); 5337087cfbeSBarry Smith extern PetscErrorCode KSPDefaultConvergedDestroy(void *); 5347087cfbeSBarry Smith extern PetscErrorCode KSPDefaultConvergedCreate(void **); 5357087cfbeSBarry Smith extern PetscErrorCode KSPDefaultConvergedSetUIRNorm(KSP); 5367087cfbeSBarry Smith extern PetscErrorCode KSPDefaultConvergedSetUMIRNorm(KSP); 5377087cfbeSBarry Smith extern PetscErrorCode KSPSkipConverged(KSP,PetscInt,PetscReal,KSPConvergedReason*,void *); 5387087cfbeSBarry Smith extern PetscErrorCode KSPGetConvergedReason(KSP,KSPConvergedReason *); 539abef13c0SSatish Balay 5407087cfbeSBarry Smith extern PetscErrorCode KSPComputeExplicitOperator(KSP,Mat *); 541d4fbbf0eSBarry Smith 54228ce4d24SBarry Smith /*E 54328ce4d24SBarry Smith KSPCGType - Determines what type of CG to use 54428ce4d24SBarry Smith 54528ce4d24SBarry Smith Level: beginner 54628ce4d24SBarry Smith 54728ce4d24SBarry Smith .seealso: KSPCGSetType() 54828ce4d24SBarry Smith E*/ 5499dcbbd2bSBarry Smith typedef enum {KSP_CG_SYMMETRIC=0,KSP_CG_HERMITIAN=1} KSPCGType; 5509dcbbd2bSBarry Smith extern const char *KSPCGTypes[]; 55128ce4d24SBarry Smith 5527087cfbeSBarry Smith extern PetscErrorCode KSPCGSetType(KSP,KSPCGType); 5537087cfbeSBarry Smith extern PetscErrorCode KSPCGUseSingleReduction(KSP,PetscBool ); 5548031f4adStmunson 5557087cfbeSBarry Smith extern PetscErrorCode KSPNASHSetRadius(KSP,PetscReal); 5567087cfbeSBarry Smith extern PetscErrorCode KSPNASHGetNormD(KSP,PetscReal *); 5577087cfbeSBarry Smith extern PetscErrorCode KSPNASHGetObjFcn(KSP,PetscReal *); 558fcae7a14Stmunson 5597087cfbeSBarry Smith extern PetscErrorCode KSPSTCGSetRadius(KSP,PetscReal); 5607087cfbeSBarry Smith extern PetscErrorCode KSPSTCGGetNormD(KSP,PetscReal *); 5617087cfbeSBarry Smith extern PetscErrorCode KSPSTCGGetObjFcn(KSP,PetscReal *); 562e559a7feSLois Curfman McInnes 5637087cfbeSBarry Smith extern PetscErrorCode KSPGLTRSetRadius(KSP,PetscReal); 5647087cfbeSBarry Smith extern PetscErrorCode KSPGLTRGetNormD(KSP,PetscReal *); 5657087cfbeSBarry Smith extern PetscErrorCode KSPGLTRGetObjFcn(KSP,PetscReal *); 5667087cfbeSBarry Smith extern PetscErrorCode KSPGLTRGetMinEig(KSP,PetscReal *); 5677087cfbeSBarry Smith extern PetscErrorCode KSPGLTRGetLambda(KSP,PetscReal *); 5688031f4adStmunson 5697087cfbeSBarry Smith extern PetscErrorCode KSPPythonSetType(KSP,const char[]); 5701d6018f0SLisandro Dalcin 5717087cfbeSBarry Smith extern PetscErrorCode PCPreSolve(PC,KSP); 5727087cfbeSBarry Smith extern PetscErrorCode PCPostSolve(PC,KSP); 5733369ce9aSBarry Smith 5747087cfbeSBarry Smith extern PetscErrorCode KSPMonitorLGCreate(const char[],const char[],int,int,int,int,PetscDrawLG*); 5757087cfbeSBarry Smith extern PetscErrorCode KSPMonitorLG(KSP,PetscInt,PetscReal,void*); 576fcfd50ebSBarry Smith extern PetscErrorCode KSPMonitorLGDestroy(PetscDrawLG*); 5777087cfbeSBarry Smith extern PetscErrorCode KSPMonitorLGTrueResidualNormCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscDrawLG*); 5787087cfbeSBarry Smith extern PetscErrorCode KSPMonitorLGTrueResidualNorm(KSP,PetscInt,PetscReal,void*); 579fcfd50ebSBarry Smith extern PetscErrorCode KSPMonitorLGTrueResidualNormDestroy(PetscDrawLG*); 5807087cfbeSBarry Smith extern PetscErrorCode KSPMonitorLGRangeCreate(const char[],const char[],int,int,int,int,PetscDrawLG*); 5817087cfbeSBarry Smith extern PetscErrorCode KSPMonitorLGRange(KSP,PetscInt,PetscReal,void*); 582fcfd50ebSBarry Smith extern PetscErrorCode KSPMonitorLGRangeDestroy(PetscDrawLG*); 5832f2e5d10SKris Buschelman 5847087cfbeSBarry Smith extern PetscErrorCode PCShellSetPreSolve(PC,PetscErrorCode (*)(PC,KSP,Vec,Vec)); 5857087cfbeSBarry Smith extern PetscErrorCode PCShellSetPostSolve(PC,PetscErrorCode (*)(PC,KSP,Vec,Vec)); 58603919abeSBarry Smith 587f8a50e2bSBarry Smith /* see src/ksp/ksp/interface/iguess.c */ 588ace3abfcSBarry Smith typedef struct _p_KSPFischerGuess {PetscInt method,curl,maxl,refcnt;PetscBool monitor;Mat mat; KSP ksp;}* KSPFischerGuess; 589f8a50e2bSBarry Smith 5907087cfbeSBarry Smith extern PetscErrorCode KSPFischerGuessCreate(KSP,PetscInt,PetscInt,KSPFischerGuess*); 5917867f5c6SBarry Smith extern PetscErrorCode KSPFischerGuessDestroy(KSPFischerGuess*); 5927087cfbeSBarry Smith extern PetscErrorCode KSPFischerGuessReset(KSPFischerGuess); 5937087cfbeSBarry Smith extern PetscErrorCode KSPFischerGuessUpdate(KSPFischerGuess,Vec); 5947087cfbeSBarry Smith extern PetscErrorCode KSPFischerGuessFormGuess(KSPFischerGuess,Vec,Vec); 5957087cfbeSBarry Smith extern PetscErrorCode KSPFischerGuessSetFromOptions(KSPFischerGuess); 596f8a50e2bSBarry Smith 5977087cfbeSBarry Smith extern PetscErrorCode KSPSetUseFischerGuess(KSP,PetscInt,PetscInt); 5987087cfbeSBarry Smith extern PetscErrorCode KSPSetFischerGuess(KSP,KSPFischerGuess); 5997087cfbeSBarry Smith extern PetscErrorCode KSPGetFischerGuess(KSP,KSPFischerGuess*); 600f8a50e2bSBarry Smith 6017087cfbeSBarry Smith extern PetscErrorCode MatCreateSchurComplement(Mat,Mat,Mat,Mat,Mat,Mat*); 6027087cfbeSBarry Smith extern PetscErrorCode MatSchurComplementGetKSP(Mat,KSP*); 6037087cfbeSBarry Smith extern PetscErrorCode MatSchurComplementUpdate(Mat,Mat,Mat,Mat,Mat,Mat,MatStructure); 6047087cfbeSBarry Smith extern PetscErrorCode MatSchurComplementGetSubmatrices(Mat,Mat*,Mat*,Mat*,Mat*,Mat*); 6057087cfbeSBarry Smith extern PetscErrorCode MatGetSchurComplement(Mat,IS,IS,IS,IS,MatReuse,Mat *,MatReuse,Mat *); 6063f22127dSBarry Smith 607fcfd50ebSBarry Smith extern PetscErrorCode MatGetSchurComplement_Basic(Mat mat,IS isrow0,IS iscol0,IS isrow1,IS iscol1,MatReuse mreuse,Mat *newmat,MatReuse preuse,Mat *newpmat); 608fcfd50ebSBarry Smith 6097087cfbeSBarry Smith extern PetscErrorCode KSPSetDM(KSP,DM); 6107087cfbeSBarry Smith extern PetscErrorCode KSPSetDMActive(KSP,PetscBool ); 6117087cfbeSBarry Smith extern PetscErrorCode KSPGetDM(KSP,DM*); 6127b0dc191SJed Brown extern PetscErrorCode KSPSetApplicationContext(KSP,void*); 6137b0dc191SJed Brown extern PetscErrorCode KSPGetApplicationContext(KSP,void*); 6146c699258SBarry Smith 615e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END 6162eac72dbSBarry Smith #endif 617