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 22*76bdecfbSBarry Smith /*J 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 30*76bdecfbSBarry Smith J*/ 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 156228d79bcSJed Brown extern PetscErrorCode KSPMonitor(KSP,PetscInt,PetscReal); 157c2efdce3SBarry Smith extern PetscErrorCode KSPMonitorSet(KSP,PetscErrorCode (*)(KSP,PetscInt,PetscReal,void*),void *,PetscErrorCode (*)(void**)); 1587087cfbeSBarry Smith extern PetscErrorCode KSPMonitorCancel(KSP); 1597087cfbeSBarry Smith extern PetscErrorCode KSPGetMonitorContext(KSP,void **); 1607087cfbeSBarry Smith extern PetscErrorCode KSPGetResidualHistory(KSP,PetscReal*[],PetscInt *); 1617087cfbeSBarry Smith extern PetscErrorCode KSPSetResidualHistory(KSP,PetscReal[],PetscInt,PetscBool ); 1624b0e389bSBarry Smith 1630e33f6ddSBarry Smith /* not sure where to put this */ 1647087cfbeSBarry Smith extern PetscErrorCode PCKSPGetKSP(PC,KSP*); 1657087cfbeSBarry Smith extern PetscErrorCode PCBJacobiGetSubKSP(PC,PetscInt*,PetscInt*,KSP*[]); 1667087cfbeSBarry Smith extern PetscErrorCode PCASMGetSubKSP(PC,PetscInt*,PetscInt*,KSP*[]); 1677087cfbeSBarry Smith extern PetscErrorCode PCGASMGetSubKSP(PC,PetscInt*,PetscInt*,KSP*[]); 1687087cfbeSBarry Smith extern PetscErrorCode PCFieldSplitGetSubKSP(PC,PetscInt*,KSP*[]); 1692eac72dbSBarry Smith 1707087cfbeSBarry Smith extern PetscErrorCode PCGalerkinGetKSP(PC,KSP *); 1710a71e23eSMatthew Knepley 1727087cfbeSBarry Smith extern PetscErrorCode KSPBuildSolution(KSP,Vec,Vec *); 1737087cfbeSBarry Smith extern PetscErrorCode KSPBuildResidual(KSP,Vec,Vec,Vec *); 1742eac72dbSBarry Smith 1757087cfbeSBarry Smith extern PetscErrorCode KSPRichardsonSetScale(KSP,PetscReal); 1767087cfbeSBarry Smith extern PetscErrorCode KSPRichardsonSetSelfScale(KSP,PetscBool ); 1777087cfbeSBarry Smith extern PetscErrorCode KSPChebychevSetEigenvalues(KSP,PetscReal,PetscReal); 17859709827SJed Brown extern PetscErrorCode KSPChebychevSetEstimateEigenvalues(KSP,PetscReal,PetscReal,PetscReal,PetscReal); 1797087cfbeSBarry Smith extern PetscErrorCode KSPComputeExtremeSingularValues(KSP,PetscReal*,PetscReal*); 1807087cfbeSBarry Smith extern PetscErrorCode KSPComputeEigenvalues(KSP,PetscInt,PetscReal*,PetscReal*,PetscInt *); 1817087cfbeSBarry Smith extern PetscErrorCode KSPComputeEigenvaluesExplicitly(KSP,PetscInt,PetscReal*,PetscReal*); 1824b0e389bSBarry Smith 1837087cfbeSBarry Smith extern PetscErrorCode KSPGMRESSetRestart(KSP, PetscInt); 1847087cfbeSBarry Smith extern PetscErrorCode KSPGMRESGetRestart(KSP, PetscInt*); 1857087cfbeSBarry Smith extern PetscErrorCode KSPGMRESSetHapTol(KSP,PetscReal); 1869f236934SBarry Smith 1877087cfbeSBarry Smith extern PetscErrorCode KSPGMRESSetPreAllocateVectors(KSP); 1887087cfbeSBarry Smith extern PetscErrorCode KSPGMRESSetOrthogonalization(KSP,PetscErrorCode (*)(KSP,PetscInt)); 1897087cfbeSBarry Smith extern PetscErrorCode KSPGMRESGetOrthogonalization(KSP,PetscErrorCode (**)(KSP,PetscInt)); 1907087cfbeSBarry Smith extern PetscErrorCode KSPGMRESModifiedGramSchmidtOrthogonalization(KSP,PetscInt); 1917087cfbeSBarry Smith extern PetscErrorCode KSPGMRESClassicalGramSchmidtOrthogonalization(KSP,PetscInt); 1921d73ed98SBarry Smith 1937087cfbeSBarry Smith extern PetscErrorCode KSPLGMRESSetAugDim(KSP,PetscInt); 1947087cfbeSBarry Smith extern PetscErrorCode KSPLGMRESSetConstant(KSP); 1951d73ed98SBarry Smith 1967087cfbeSBarry Smith extern PetscErrorCode KSPGCRSetRestart(KSP,PetscInt); 1977087cfbeSBarry Smith extern PetscErrorCode KSPGCRGetRestart(KSP,PetscInt*); 1987087cfbeSBarry Smith extern PetscErrorCode KSPGCRSetModifyPC(KSP,PetscErrorCode (*)(KSP,PetscInt,PetscReal,void*),void*,PetscErrorCode(*)(void*)); 19958ad63f4SBarry Smith 200b49fd9e1SBarry Smith /*E 201b49fd9e1SBarry Smith KSPGMRESCGSRefinementType - How the classical (unmodified) Gram-Schmidt is performed. 202b49fd9e1SBarry Smith 203b49fd9e1SBarry Smith Level: advanced 204b49fd9e1SBarry Smith 205bef9c725SBarry Smith .seealso: KSPGMRESClassicalGramSchmidtOrthogonalization(), KSPGMRESSetOrthogonalization(), KSPGMRESGetOrthogonalization(), 206e928de20SBarry Smith KSPGMRESSetCGSRefinementType(), KSPGMRESGetCGSRefinementType(), KSPGMRESModifiedGramSchmidtOrthogonalization() 207b49fd9e1SBarry Smith 208b49fd9e1SBarry Smith E*/ 20978d1dd23SKris Buschelman typedef enum {KSP_GMRES_CGS_REFINE_NEVER, KSP_GMRES_CGS_REFINE_IFNEEDED, KSP_GMRES_CGS_REFINE_ALWAYS} KSPGMRESCGSRefinementType; 2109dcbbd2bSBarry Smith extern const char *KSPGMRESCGSRefinementTypes[]; 2111f7e983dSSatish Balay /*MC 2128c5b8ba0SBarry Smith KSP_GMRES_CGS_REFINE_NEVER - Just do the classical (unmodified) Gram-Schmidt process 2138c5b8ba0SBarry Smith 2148c5b8ba0SBarry Smith Level: advanced 2158c5b8ba0SBarry Smith 2168c5b8ba0SBarry Smith Note: Possible unstable, but the fastest to compute 2178c5b8ba0SBarry Smith 218bef9c725SBarry Smith .seealso: KSPGMRESClassicalGramSchmidtOrthogonalization(), KSPGMRESSetOrthogonalization(), KSPGMRESGetOrthogonalization(), 219e928de20SBarry Smith KSPGMRESSetCGSRefinementType(), KSPGMRESGetCGSRefinementType(), KSP_GMRES_CGS_REFINE_IFNEEDED, KSP_GMRES_CGS_REFINE_ALWAYS, 2208c5b8ba0SBarry Smith KSPGMRESModifiedGramSchmidtOrthogonalization() 2218c5b8ba0SBarry Smith M*/ 2228c5b8ba0SBarry Smith 2231f7e983dSSatish Balay /*MC 2248c5b8ba0SBarry Smith KSP_GMRES_CGS_REFINE_IFNEEDED - Do the classical (unmodified) Gram-Schmidt process and one step of 2258c5b8ba0SBarry Smith iterative refinement if an estimate of the orthogonality of the resulting vectors indicates 2268c5b8ba0SBarry Smith poor orthogonality. 2278c5b8ba0SBarry Smith 2288c5b8ba0SBarry Smith Level: advanced 2298c5b8ba0SBarry Smith 2308c5b8ba0SBarry Smith Note: This is slower than KSP_GMRES_CGS_REFINE_NEVER because it requires an extra norm computation to 2318c5b8ba0SBarry Smith estimate the orthogonality but is more stable. 2328c5b8ba0SBarry Smith 233bef9c725SBarry Smith .seealso: KSPGMRESClassicalGramSchmidtOrthogonalization(), KSPGMRESSetOrthogonalization(), KSPGMRESGetOrthogonalization(), 234e928de20SBarry Smith KSPGMRESSetCGSRefinementType(), KSPGMRESGetCGSRefinementType(), KSP_GMRES_CGS_REFINE_NEVER, KSP_GMRES_CGS_REFINE_ALWAYS, 2358c5b8ba0SBarry Smith KSPGMRESModifiedGramSchmidtOrthogonalization() 2368c5b8ba0SBarry Smith M*/ 2378c5b8ba0SBarry Smith 2381f7e983dSSatish Balay /*MC 2398c5b8ba0SBarry Smith KSP_GMRES_CGS_REFINE_NEVER - Do two steps of the classical (unmodified) Gram-Schmidt process. 2408c5b8ba0SBarry Smith 2418c5b8ba0SBarry Smith Level: advanced 2428c5b8ba0SBarry Smith 2438c5b8ba0SBarry Smith Note: This is roughly twice the cost of KSP_GMRES_CGS_REFINE_NEVER because it performs the process twice 2448c5b8ba0SBarry Smith but it saves the extra norm calculation needed by KSP_GMRES_CGS_REFINE_IFNEEDED. 2458c5b8ba0SBarry Smith 2468c5b8ba0SBarry Smith You should only use this if you absolutely know that the iterative refinement is needed. 2478c5b8ba0SBarry Smith 248bef9c725SBarry Smith .seealso: KSPGMRESClassicalGramSchmidtOrthogonalization(), KSPGMRESSetOrthogonalization(), KSPGMRESGetOrthogonalization(), 249e928de20SBarry Smith KSPGMRESSetCGSRefinementType(), KSPGMRESGetCGSRefinementType(), KSP_GMRES_CGS_REFINE_IFNEEDED, KSP_GMRES_CGS_REFINE_ALWAYS, 2508c5b8ba0SBarry Smith KSPGMRESModifiedGramSchmidtOrthogonalization() 2518c5b8ba0SBarry Smith M*/ 2528c5b8ba0SBarry Smith 2537087cfbeSBarry Smith extern PetscErrorCode KSPGMRESSetCGSRefinementType(KSP,KSPGMRESCGSRefinementType); 2547087cfbeSBarry Smith extern PetscErrorCode KSPGMRESGetCGSRefinementType(KSP,KSPGMRESCGSRefinementType*); 25508480c60SBarry Smith 2567087cfbeSBarry Smith extern PetscErrorCode KSPFGMRESModifyPCNoChange(KSP,PetscInt,PetscInt,PetscReal,void*); 2577087cfbeSBarry Smith extern PetscErrorCode KSPFGMRESModifyPCKSP(KSP,PetscInt,PetscInt,PetscReal,void*); 2587087cfbeSBarry Smith extern PetscErrorCode KSPFGMRESSetModifyPC(KSP,PetscErrorCode (*)(KSP,PetscInt,PetscInt,PetscReal,void*),void*,PetscErrorCode(*)(void*)); 259c38d4ed2SBarry Smith 2607087cfbeSBarry Smith extern PetscErrorCode KSPQCGSetTrustRegionRadius(KSP,PetscReal); 2617087cfbeSBarry Smith extern PetscErrorCode KSPQCGGetQuadratic(KSP,PetscReal*); 2627087cfbeSBarry Smith extern PetscErrorCode KSPQCGGetTrialStepNorm(KSP,PetscReal*); 263121fd945SKris Buschelman 2647087cfbeSBarry Smith extern PetscErrorCode KSPBCGSLSetXRes(KSP,PetscReal); 2657087cfbeSBarry Smith extern PetscErrorCode KSPBCGSLSetPol(KSP,PetscBool ); 2667087cfbeSBarry Smith extern PetscErrorCode KSPBCGSLSetEll(KSP,PetscInt); 267d9492815SBarry Smith 2687087cfbeSBarry Smith extern PetscErrorCode KSPSetFromOptions(KSP); 2697087cfbeSBarry Smith extern PetscErrorCode KSPAddOptionsChecker(PetscErrorCode (*)(KSP)); 2702eac72dbSBarry Smith 2717087cfbeSBarry Smith extern PetscErrorCode KSPMonitorSingularValue(KSP,PetscInt,PetscReal,void *); 2727087cfbeSBarry Smith extern PetscErrorCode KSPMonitorDefault(KSP,PetscInt,PetscReal,void *); 2737087cfbeSBarry Smith extern PetscErrorCode KSPMonitorDefaultLSQR(KSP,PetscInt,PetscReal,void *); 2747087cfbeSBarry Smith extern PetscErrorCode KSPMonitorRange(KSP,PetscInt,PetscReal,void *); 2757087cfbeSBarry Smith extern PetscErrorCode KSPMonitorTrueResidualNorm(KSP,PetscInt,PetscReal,void *); 2767087cfbeSBarry Smith extern PetscErrorCode KSPMonitorDefaultShort(KSP,PetscInt,PetscReal,void *); 2777087cfbeSBarry Smith extern PetscErrorCode KSPMonitorSolution(KSP,PetscInt,PetscReal,void *); 2787087cfbeSBarry Smith extern PetscErrorCode KSPGMRESMonitorKrylov(KSP,PetscInt,PetscReal,void *); 27984cb2905SBarry Smith 2807087cfbeSBarry Smith extern PetscErrorCode KSPUnwindPreconditioner(KSP,Vec,Vec); 2817087cfbeSBarry Smith extern PetscErrorCode KSPDefaultBuildSolution(KSP,Vec,Vec*); 2827087cfbeSBarry Smith extern PetscErrorCode KSPDefaultBuildResidual(KSP,Vec,Vec,Vec *); 2837087cfbeSBarry Smith extern PetscErrorCode KSPInitialResidual(KSP,Vec,Vec,Vec,Vec,Vec); 284c01c455dSBarry Smith 2857087cfbeSBarry Smith extern PetscErrorCode KSPSetOperators(KSP,Mat,Mat,MatStructure); 2867087cfbeSBarry Smith extern PetscErrorCode KSPGetOperators(KSP,Mat*,Mat*,MatStructure*); 2877087cfbeSBarry Smith extern PetscErrorCode KSPGetOperatorsSet(KSP,PetscBool *,PetscBool *); 2887087cfbeSBarry Smith extern PetscErrorCode KSPSetOptionsPrefix(KSP,const char[]); 2897087cfbeSBarry Smith extern PetscErrorCode KSPAppendOptionsPrefix(KSP,const char[]); 2907087cfbeSBarry Smith extern PetscErrorCode KSPGetOptionsPrefix(KSP,const char*[]); 2911eb62cbbSBarry Smith 2927087cfbeSBarry Smith extern PetscErrorCode KSPSetDiagonalScale(KSP,PetscBool ); 2937087cfbeSBarry Smith extern PetscErrorCode KSPGetDiagonalScale(KSP,PetscBool *); 2947087cfbeSBarry Smith extern PetscErrorCode KSPSetDiagonalScaleFix(KSP,PetscBool ); 2957087cfbeSBarry Smith extern PetscErrorCode KSPGetDiagonalScaleFix(KSP,PetscBool *); 2961f7f0c4fSBarry Smith 2977087cfbeSBarry Smith extern PetscErrorCode KSPView(KSP,PetscViewer); 2981eb62cbbSBarry Smith 2997087cfbeSBarry Smith extern PetscErrorCode KSPLSQRSetStandardErrorVec(KSP,Vec); 3007087cfbeSBarry Smith extern PetscErrorCode KSPLSQRGetStandardErrorVec(KSP,Vec*); 301db9b2ab1SHong Zhang 30283ab6a24SBarry Smith extern PetscErrorCode PCRedundantGetKSP(PC,KSP*); 3035e7ef714SBarry Smith extern PetscErrorCode PCRedistributeGetKSP(PC,KSP*); 30483ab6a24SBarry Smith 30528ce4d24SBarry Smith /*E 3068a4b9c5cSBarry Smith KSPNormType - Norm that is passed in the Krylov convergence 3078a4b9c5cSBarry Smith test routines. 3088a4b9c5cSBarry Smith 3098a4b9c5cSBarry Smith Level: advanced 3108a4b9c5cSBarry Smith 311a3f661c8SBarry Smith Each solver only supports a subset of these and some may support different ones 3121718446fSBarry Smith depending on left or right preconditioning, see KSPSetPCSide() 313a3f661c8SBarry Smith 3148a4b9c5cSBarry Smith Notes: this must match finclude/petscksp.h 3158a4b9c5cSBarry Smith 31694b7f48cSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPSetNormType(), 3171718446fSBarry Smith KSPSetConvergenceTest(), KSPSetPCSide() 3188a4b9c5cSBarry Smith E*/ 3199e568555SJed Brown typedef enum {KSP_NORM_DEFAULT = -1,KSP_NORM_NONE = 0,KSP_NORM_PRECONDITIONED = 1,KSP_NORM_UNPRECONDITIONED = 2,KSP_NORM_NATURAL = 3} KSPNormType; 3209e568555SJed Brown #define KSP_NORM_MAX (KSP_NORM_NATURAL + 1) 3219e568555SJed Brown extern const char *const*const KSPNormTypes; 322a21b2a99SBarry Smith 3231f7e983dSSatish Balay /*MC 3249793b452SBarry Smith KSP_NORM_NONE - Do not compute a norm during the Krylov process. This will 3258c5b8ba0SBarry Smith possibly save some computation but means the convergence test cannot 3268c5b8ba0SBarry Smith be based on a norm of a residual etc. 3278c5b8ba0SBarry Smith 3288c5b8ba0SBarry Smith Level: advanced 3298c5b8ba0SBarry Smith 330085a36d4SBarry Smith Note: Some Krylov methods need to compute a residual norm and then this option is ignored 3318c5b8ba0SBarry Smith 332ce9499c7SBarry Smith .seealso: KSPNormType, KSPSetNormType(), KSP_NORM_PRECONDITIONED, KSP_NORM_UNPRECONDITIONED, KSP_NORM_NATURAL 3338c5b8ba0SBarry Smith M*/ 3348c5b8ba0SBarry Smith 3351f7e983dSSatish Balay /*MC 336ce9499c7SBarry Smith KSP_NORM_PRECONDITIONED - Compute the norm of the preconditioned residual and pass that to the 3378c5b8ba0SBarry Smith convergence test routine. 3388c5b8ba0SBarry Smith 3398c5b8ba0SBarry Smith Level: advanced 3408c5b8ba0SBarry Smith 3419793b452SBarry Smith .seealso: KSPNormType, KSPSetNormType(), KSP_NORM_NONE, KSP_NORM_UNPRECONDITIONED, KSP_NORM_NATURAL, KSPSetConvergenceTest() 3428c5b8ba0SBarry Smith M*/ 3438c5b8ba0SBarry Smith 3441f7e983dSSatish Balay /*MC 345ce9499c7SBarry Smith KSP_NORM_UNPRECONDITIONED - Compute the norm of the true residual (b - A*x) and pass that to the 3468c5b8ba0SBarry Smith convergence test routine. 3478c5b8ba0SBarry Smith 3488c5b8ba0SBarry Smith Level: advanced 3498c5b8ba0SBarry Smith 3509793b452SBarry Smith .seealso: KSPNormType, KSPSetNormType(), KSP_NORM_NONE, KSP_NORM_PRECONDITIONED, KSP_NORM_NATURAL, KSPSetConvergenceTest() 3518c5b8ba0SBarry Smith M*/ 3528c5b8ba0SBarry Smith 3531f7e983dSSatish Balay /*MC 354ce9499c7SBarry Smith KSP_NORM_NATURAL - Compute the 'natural norm' of residual sqrt((b - A*x)*B*(b - A*x)) and pass that to the 355a3f661c8SBarry Smith convergence test routine. This is only supported by KSPCG, KSPCR, KSPCGNE, KSPCGS 3568c5b8ba0SBarry Smith 3578c5b8ba0SBarry Smith Level: advanced 3588c5b8ba0SBarry Smith 3599793b452SBarry Smith .seealso: KSPNormType, KSPSetNormType(), KSP_NORM_NONE, KSP_NORM_PRECONDITIONED, KSP_NORM_UNPRECONDITIONED, KSPSetConvergenceTest() 3608c5b8ba0SBarry Smith M*/ 3618c5b8ba0SBarry Smith 3627087cfbeSBarry Smith extern PetscErrorCode KSPSetNormType(KSP,KSPNormType); 3637087cfbeSBarry Smith extern PetscErrorCode KSPGetNormType(KSP,KSPNormType*); 3649e568555SJed Brown extern PetscErrorCode KSPSetSupportedNorm(KSP ksp,KSPNormType,PCSide,PetscInt); 3657087cfbeSBarry Smith extern PetscErrorCode KSPSetCheckNormIteration(KSP,PetscInt); 3667087cfbeSBarry Smith extern PetscErrorCode KSPSetLagNorm(KSP,PetscBool ); 3678a4b9c5cSBarry Smith 3688a4b9c5cSBarry Smith /*E 36928ce4d24SBarry Smith KSPConvergedReason - reason a Krylov method was said to 37028ce4d24SBarry Smith have converged or diverged 37128ce4d24SBarry Smith 37228ce4d24SBarry Smith Level: beginner 37328ce4d24SBarry Smith 3744d0a8057SBarry Smith Notes: See KSPGetConvergedReason() for explanation of each value 37528ce4d24SBarry Smith 3764d0a8057SBarry Smith Developer notes: this must match finclude/petscksp.h 3774d0a8057SBarry Smith 3784d0a8057SBarry Smith The string versions of these are KSPConvergedReasons; if you change 3794d0a8057SBarry Smith any of the values here also change them that array of names. 38086c02ca4SBarry Smith 381c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPSetTolerances() 38228ce4d24SBarry Smith E*/ 383d15094e1SBarry Smith typedef enum {/* converged */ 3849ecb1286SBarry Smith KSP_CONVERGED_RTOL_NORMAL = 1, 3859ecb1286SBarry Smith KSP_CONVERGED_ATOL_NORMAL = 9, 386d15094e1SBarry Smith KSP_CONVERGED_RTOL = 2, 387d15094e1SBarry Smith KSP_CONVERGED_ATOL = 3, 388b335793eSSatish Balay KSP_CONVERGED_ITS = 4, 3898031f4adStmunson KSP_CONVERGED_CG_NEG_CURVE = 5, 3908031f4adStmunson KSP_CONVERGED_CG_CONSTRAINED = 6, 391329f5518SBarry Smith KSP_CONVERGED_STEP_LENGTH = 7, 392af3d8002SBarry Smith KSP_CONVERGED_HAPPY_BREAKDOWN = 8, 393d15094e1SBarry Smith /* diverged */ 394b3cc6726SBarry Smith KSP_DIVERGED_NULL = -2, 395d15094e1SBarry Smith KSP_DIVERGED_ITS = -3, 396d15094e1SBarry Smith KSP_DIVERGED_DTOL = -4, 397d15094e1SBarry Smith KSP_DIVERGED_BREAKDOWN = -5, 398b4ac9ba4SBarry Smith KSP_DIVERGED_BREAKDOWN_BICG = -6, 399b4ac9ba4SBarry Smith KSP_DIVERGED_NONSYMMETRIC = -7, 400b4ac9ba4SBarry Smith KSP_DIVERGED_INDEFINITE_PC = -8, 4016aee1118SBarry Smith KSP_DIVERGED_NAN = -9, 4026aee1118SBarry Smith KSP_DIVERGED_INDEFINITE_MAT = -10, 403d15094e1SBarry Smith 404d15094e1SBarry Smith KSP_CONVERGED_ITERATING = 0} KSPConvergedReason; 4057935a769SJed Brown extern const char *const*KSPConvergedReasons; 406d15094e1SBarry Smith 407c838673bSBarry Smith /*MC 408c838673bSBarry Smith KSP_CONVERGED_RTOL - norm(r) <= rtol*norm(b) 409c838673bSBarry Smith 410c838673bSBarry Smith Level: beginner 411c838673bSBarry Smith 412c838673bSBarry Smith See KSPNormType and KSPSetNormType() for possible norms that may be used. By default 413c838673bSBarry Smith for left preconditioning it is the 2-norm of the preconditioned residual, and the 414c838673bSBarry Smith 2-norm of the residual for right preconditioning 415c838673bSBarry Smith 416c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 417c838673bSBarry Smith 418c838673bSBarry Smith M*/ 419c838673bSBarry Smith 420c838673bSBarry Smith /*MC 421c838673bSBarry Smith KSP_CONVERGED_ATOL - norm(r) <= atol 422c838673bSBarry Smith 423c838673bSBarry Smith Level: beginner 424c838673bSBarry Smith 425c838673bSBarry Smith See KSPNormType and KSPSetNormType() for possible norms that may be used. By default 426c838673bSBarry Smith for left preconditioning it is the 2-norm of the preconditioned residual, and the 427c838673bSBarry Smith 2-norm of the residual for right preconditioning 428c838673bSBarry Smith 429c838673bSBarry Smith Level: beginner 430c838673bSBarry Smith 431c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 432c838673bSBarry Smith 433c838673bSBarry Smith M*/ 434c838673bSBarry Smith 435c838673bSBarry Smith /*MC 436c838673bSBarry Smith KSP_DIVERGED_DTOL - norm(r) >= dtol*norm(b) 437c838673bSBarry Smith 438c838673bSBarry Smith Level: beginner 439c838673bSBarry Smith 440c838673bSBarry Smith See KSPNormType and KSPSetNormType() for possible norms that may be used. By default 441c838673bSBarry Smith for left preconditioning it is the 2-norm of the preconditioned residual, and the 442c838673bSBarry Smith 2-norm of the residual for right preconditioning 443c838673bSBarry Smith 444c838673bSBarry Smith Level: beginner 445c838673bSBarry Smith 446c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 447c838673bSBarry Smith 448c838673bSBarry Smith M*/ 449c838673bSBarry Smith 450c838673bSBarry Smith /*MC 451c838673bSBarry Smith KSP_DIVERGED_ITS - Ran out of iterations before any convergence criteria was 452c838673bSBarry Smith reached 453c838673bSBarry Smith 454c838673bSBarry Smith Level: beginner 455c838673bSBarry Smith 456c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 457c838673bSBarry Smith 458c838673bSBarry Smith M*/ 459c838673bSBarry Smith 460c838673bSBarry Smith /*MC 4618c9406f6SLisandro Dalcin KSP_CONVERGED_ITS - Used by the KSPPREONLY solver after the single iteration of 4628c9406f6SLisandro Dalcin the preconditioner is applied. Also used when the KSPSkipConverged() convergence 4634d0a8057SBarry Smith test routine is set in KSP. 464c838673bSBarry Smith 465c838673bSBarry Smith 466c838673bSBarry Smith Level: beginner 467c838673bSBarry Smith 468c838673bSBarry Smith 469c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 470c838673bSBarry Smith 471c838673bSBarry Smith M*/ 472c838673bSBarry Smith 473c838673bSBarry Smith /*MC 474c838673bSBarry Smith KSP_DIVERGED_BREAKDOWN - A breakdown in the Krylov method was detected so the 4753014e516SBarry Smith method could not continue to enlarge the Krylov space. Could be due to a singlular matrix or 4763014e516SBarry Smith preconditioner. 477c838673bSBarry Smith 478c838673bSBarry Smith Level: beginner 479c838673bSBarry Smith 480c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 481c838673bSBarry Smith 482c838673bSBarry Smith M*/ 483c838673bSBarry Smith 484c838673bSBarry Smith /*MC 485c838673bSBarry Smith KSP_DIVERGED_BREAKDOWN_BICG - A breakdown in the KSPBICG method was detected so the 486c838673bSBarry Smith method could not continue to enlarge the Krylov space. 487c838673bSBarry Smith 488c838673bSBarry Smith 489c838673bSBarry Smith Level: beginner 490c838673bSBarry Smith 491c838673bSBarry Smith 492c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 493c838673bSBarry Smith 494c838673bSBarry Smith M*/ 495c838673bSBarry Smith 496c838673bSBarry Smith /*MC 497c838673bSBarry Smith KSP_DIVERGED_NONSYMMETRIC - It appears the operator or preconditioner is not 498c838673bSBarry Smith symmetric and this Krylov method (KSPCG, KSPMINRES, KSPCR) requires symmetry 499c838673bSBarry Smith 500c838673bSBarry Smith Level: beginner 501c838673bSBarry Smith 502c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 503c838673bSBarry Smith 504c838673bSBarry Smith M*/ 505c838673bSBarry Smith 506c838673bSBarry Smith /*MC 507c838673bSBarry Smith KSP_DIVERGED_INDEFINITE_PC - It appears the preconditioner is indefinite (has both 508c838673bSBarry Smith positive and negative eigenvalues) and this Krylov method (KSPCG) requires it to 509c838673bSBarry Smith be positive definite 510c838673bSBarry Smith 511c838673bSBarry Smith Level: beginner 512c838673bSBarry Smith 5132401956bSBarry Smith Notes: This can happen with the PCICC preconditioner, use -pc_factor_shift_positive_definite to force 514c838673bSBarry Smith the PCICC preconditioner to generate a positive definite preconditioner 515c838673bSBarry Smith 516c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 517c838673bSBarry Smith 518c838673bSBarry Smith M*/ 519c838673bSBarry Smith 520c838673bSBarry Smith /*MC 521c838673bSBarry Smith KSP_CONVERGED_ITERATING - This flag is returned if you call KSPGetConvergedReason() 522c838673bSBarry Smith while the KSPSolve() is still running. 523c838673bSBarry Smith 524c838673bSBarry Smith Level: beginner 525c838673bSBarry Smith 526c838673bSBarry Smith .seealso: KSPSolve(), KSPGetConvergedReason(), KSPConvergedReason, KSPSetTolerances() 527c838673bSBarry Smith 528c838673bSBarry Smith M*/ 529c838673bSBarry Smith 5307087cfbeSBarry Smith extern PetscErrorCode KSPSetConvergenceTest(KSP,PetscErrorCode (*)(KSP,PetscInt,PetscReal,KSPConvergedReason*,void*),void *,PetscErrorCode (*)(void*)); 5317087cfbeSBarry Smith extern PetscErrorCode KSPGetConvergenceContext(KSP,void **); 5327087cfbeSBarry Smith extern PetscErrorCode KSPDefaultConverged(KSP,PetscInt,PetscReal,KSPConvergedReason*,void *); 5337087cfbeSBarry Smith extern PetscErrorCode KSPConvergedLSQR(KSP,PetscInt,PetscReal,KSPConvergedReason*,void *); 5347087cfbeSBarry Smith extern PetscErrorCode KSPDefaultConvergedDestroy(void *); 5357087cfbeSBarry Smith extern PetscErrorCode KSPDefaultConvergedCreate(void **); 5367087cfbeSBarry Smith extern PetscErrorCode KSPDefaultConvergedSetUIRNorm(KSP); 5377087cfbeSBarry Smith extern PetscErrorCode KSPDefaultConvergedSetUMIRNorm(KSP); 5387087cfbeSBarry Smith extern PetscErrorCode KSPSkipConverged(KSP,PetscInt,PetscReal,KSPConvergedReason*,void *); 5397087cfbeSBarry Smith extern PetscErrorCode KSPGetConvergedReason(KSP,KSPConvergedReason *); 540abef13c0SSatish Balay 5417087cfbeSBarry Smith extern PetscErrorCode KSPComputeExplicitOperator(KSP,Mat *); 542d4fbbf0eSBarry Smith 54328ce4d24SBarry Smith /*E 54428ce4d24SBarry Smith KSPCGType - Determines what type of CG to use 54528ce4d24SBarry Smith 54628ce4d24SBarry Smith Level: beginner 54728ce4d24SBarry Smith 54828ce4d24SBarry Smith .seealso: KSPCGSetType() 54928ce4d24SBarry Smith E*/ 5509dcbbd2bSBarry Smith typedef enum {KSP_CG_SYMMETRIC=0,KSP_CG_HERMITIAN=1} KSPCGType; 5519dcbbd2bSBarry Smith extern const char *KSPCGTypes[]; 55228ce4d24SBarry Smith 5537087cfbeSBarry Smith extern PetscErrorCode KSPCGSetType(KSP,KSPCGType); 5547087cfbeSBarry Smith extern PetscErrorCode KSPCGUseSingleReduction(KSP,PetscBool ); 5558031f4adStmunson 5567087cfbeSBarry Smith extern PetscErrorCode KSPNASHSetRadius(KSP,PetscReal); 5577087cfbeSBarry Smith extern PetscErrorCode KSPNASHGetNormD(KSP,PetscReal *); 5587087cfbeSBarry Smith extern PetscErrorCode KSPNASHGetObjFcn(KSP,PetscReal *); 559fcae7a14Stmunson 5607087cfbeSBarry Smith extern PetscErrorCode KSPSTCGSetRadius(KSP,PetscReal); 5617087cfbeSBarry Smith extern PetscErrorCode KSPSTCGGetNormD(KSP,PetscReal *); 5627087cfbeSBarry Smith extern PetscErrorCode KSPSTCGGetObjFcn(KSP,PetscReal *); 563e559a7feSLois Curfman McInnes 5647087cfbeSBarry Smith extern PetscErrorCode KSPGLTRSetRadius(KSP,PetscReal); 5657087cfbeSBarry Smith extern PetscErrorCode KSPGLTRGetNormD(KSP,PetscReal *); 5667087cfbeSBarry Smith extern PetscErrorCode KSPGLTRGetObjFcn(KSP,PetscReal *); 5677087cfbeSBarry Smith extern PetscErrorCode KSPGLTRGetMinEig(KSP,PetscReal *); 5687087cfbeSBarry Smith extern PetscErrorCode KSPGLTRGetLambda(KSP,PetscReal *); 5698031f4adStmunson 5707087cfbeSBarry Smith extern PetscErrorCode KSPPythonSetType(KSP,const char[]); 5711d6018f0SLisandro Dalcin 5727087cfbeSBarry Smith extern PetscErrorCode PCPreSolve(PC,KSP); 5737087cfbeSBarry Smith extern PetscErrorCode PCPostSolve(PC,KSP); 5743369ce9aSBarry Smith 5757087cfbeSBarry Smith extern PetscErrorCode KSPMonitorLGCreate(const char[],const char[],int,int,int,int,PetscDrawLG*); 5767087cfbeSBarry Smith extern PetscErrorCode KSPMonitorLG(KSP,PetscInt,PetscReal,void*); 577fcfd50ebSBarry Smith extern PetscErrorCode KSPMonitorLGDestroy(PetscDrawLG*); 5787087cfbeSBarry Smith extern PetscErrorCode KSPMonitorLGTrueResidualNormCreate(MPI_Comm,const char[],const char[],int,int,int,int,PetscDrawLG*); 5797087cfbeSBarry Smith extern PetscErrorCode KSPMonitorLGTrueResidualNorm(KSP,PetscInt,PetscReal,void*); 580fcfd50ebSBarry Smith extern PetscErrorCode KSPMonitorLGTrueResidualNormDestroy(PetscDrawLG*); 5817087cfbeSBarry Smith extern PetscErrorCode KSPMonitorLGRangeCreate(const char[],const char[],int,int,int,int,PetscDrawLG*); 5827087cfbeSBarry Smith extern PetscErrorCode KSPMonitorLGRange(KSP,PetscInt,PetscReal,void*); 583fcfd50ebSBarry Smith extern PetscErrorCode KSPMonitorLGRangeDestroy(PetscDrawLG*); 5842f2e5d10SKris Buschelman 5857087cfbeSBarry Smith extern PetscErrorCode PCShellSetPreSolve(PC,PetscErrorCode (*)(PC,KSP,Vec,Vec)); 5867087cfbeSBarry Smith extern PetscErrorCode PCShellSetPostSolve(PC,PetscErrorCode (*)(PC,KSP,Vec,Vec)); 58703919abeSBarry Smith 588f8a50e2bSBarry Smith /* see src/ksp/ksp/interface/iguess.c */ 589ace3abfcSBarry Smith typedef struct _p_KSPFischerGuess {PetscInt method,curl,maxl,refcnt;PetscBool monitor;Mat mat; KSP ksp;}* KSPFischerGuess; 590f8a50e2bSBarry Smith 5917087cfbeSBarry Smith extern PetscErrorCode KSPFischerGuessCreate(KSP,PetscInt,PetscInt,KSPFischerGuess*); 5927867f5c6SBarry Smith extern PetscErrorCode KSPFischerGuessDestroy(KSPFischerGuess*); 5937087cfbeSBarry Smith extern PetscErrorCode KSPFischerGuessReset(KSPFischerGuess); 5947087cfbeSBarry Smith extern PetscErrorCode KSPFischerGuessUpdate(KSPFischerGuess,Vec); 5957087cfbeSBarry Smith extern PetscErrorCode KSPFischerGuessFormGuess(KSPFischerGuess,Vec,Vec); 5967087cfbeSBarry Smith extern PetscErrorCode KSPFischerGuessSetFromOptions(KSPFischerGuess); 597f8a50e2bSBarry Smith 5987087cfbeSBarry Smith extern PetscErrorCode KSPSetUseFischerGuess(KSP,PetscInt,PetscInt); 5997087cfbeSBarry Smith extern PetscErrorCode KSPSetFischerGuess(KSP,KSPFischerGuess); 6007087cfbeSBarry Smith extern PetscErrorCode KSPGetFischerGuess(KSP,KSPFischerGuess*); 601f8a50e2bSBarry Smith 6027087cfbeSBarry Smith extern PetscErrorCode MatCreateSchurComplement(Mat,Mat,Mat,Mat,Mat,Mat*); 6037087cfbeSBarry Smith extern PetscErrorCode MatSchurComplementGetKSP(Mat,KSP*); 6047087cfbeSBarry Smith extern PetscErrorCode MatSchurComplementUpdate(Mat,Mat,Mat,Mat,Mat,Mat,MatStructure); 6057087cfbeSBarry Smith extern PetscErrorCode MatSchurComplementGetSubmatrices(Mat,Mat*,Mat*,Mat*,Mat*,Mat*); 6067087cfbeSBarry Smith extern PetscErrorCode MatGetSchurComplement(Mat,IS,IS,IS,IS,MatReuse,Mat *,MatReuse,Mat *); 6073f22127dSBarry Smith 608fcfd50ebSBarry Smith extern PetscErrorCode MatGetSchurComplement_Basic(Mat mat,IS isrow0,IS iscol0,IS isrow1,IS iscol1,MatReuse mreuse,Mat *newmat,MatReuse preuse,Mat *newpmat); 609fcfd50ebSBarry Smith 6107087cfbeSBarry Smith extern PetscErrorCode KSPSetDM(KSP,DM); 6117087cfbeSBarry Smith extern PetscErrorCode KSPSetDMActive(KSP,PetscBool ); 6127087cfbeSBarry Smith extern PetscErrorCode KSPGetDM(KSP,DM*); 6137b0dc191SJed Brown extern PetscErrorCode KSPSetApplicationContext(KSP,void*); 6147b0dc191SJed Brown extern PetscErrorCode KSPGetApplicationContext(KSP,void*); 6156c699258SBarry Smith 616e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END 6172eac72dbSBarry Smith #endif 618