1d03aef70SBarry Smith /* 237f753daSBarry Smith Preconditioner module. 3d03aef70SBarry Smith */ 40a835dfdSSatish Balay #if !defined(__PETSCPC_H) 50a835dfdSSatish Balay #define __PETSCPC_H 61e25c274SJed Brown #include <petscmat.h> 71e25c274SJed Brown #include <petscdmtypes.h> 8d03aef70SBarry Smith 9607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PCInitializePackage(void); 101dbb0a54SBarry Smith 11eec0b4cfSBarry Smith /* 12eec0b4cfSBarry Smith PCList contains the list of preconditioners currently registered 13bdf89e91SBarry Smith These are added with PCRegister() 14eec0b4cfSBarry Smith */ 15140e18c1SBarry Smith PETSC_EXTERN PetscFunctionList PCList; 1682bf6240SBarry Smith 173d957683SBarry Smith /*S 188f6c3df8SBarry Smith PC - Abstract PETSc object that manages all preconditioners including direct solvers such as PCLU 193d957683SBarry Smith 203d957683SBarry Smith Level: beginner 213d957683SBarry Smith 223d957683SBarry Smith Concepts: preconditioners 233d957683SBarry Smith 241a480d89SAdministrator .seealso: PCCreate(), PCSetType(), PCType (for list of available types) 253d957683SBarry Smith S*/ 263d957683SBarry Smith typedef struct _p_PC* PC; 273d957683SBarry Smith 2876bdecfbSBarry Smith /*J 298f6c3df8SBarry Smith PCType - String with the name of a PETSc preconditioner method. 303d957683SBarry Smith 313d957683SBarry Smith Level: beginner 323d957683SBarry Smith 331a480d89SAdministrator Notes: Click on the links below to see details on a particular solver 341a480d89SAdministrator 358f6c3df8SBarry Smith PCRegister() is used to register preconditioners that are then accessible via PCSetType() 368f6c3df8SBarry Smith 378f6c3df8SBarry Smith .seealso: PCSetType(), PC, PCCreate(), PCRegister(), PCSetFromOptions() 3876bdecfbSBarry Smith J*/ 3919fd82e9SBarry Smith typedef const char* PCType; 4082bf6240SBarry Smith #define PCNONE "none" 4182bf6240SBarry Smith #define PCJACOBI "jacobi" 4282bf6240SBarry Smith #define PCSOR "sor" 4382bf6240SBarry Smith #define PCLU "lu" 4482bf6240SBarry Smith #define PCSHELL "shell" 4582bf6240SBarry Smith #define PCBJACOBI "bjacobi" 4682bf6240SBarry Smith #define PCMG "mg" 4782bf6240SBarry Smith #define PCEISENSTAT "eisenstat" 4882bf6240SBarry Smith #define PCILU "ilu" 4982bf6240SBarry Smith #define PCICC "icc" 5082bf6240SBarry Smith #define PCASM "asm" 51ab3e923fSDmitry Karpeev #define PCGASM "gasm" 5294b7f48cSBarry Smith #define PCKSP "ksp" 5382bf6240SBarry Smith #define PCCOMPOSITE "composite" 54421c37bdSBarry Smith #define PCREDUNDANT "redundant" 5527b520f0SBarry Smith #define PCSPAI "spai" 56186905e3SBarry Smith #define PCNN "nn" 574bbc92c1SBarry Smith #define PCCHOLESKY "cholesky" 583a7fca6bSBarry Smith #define PCPBJACOBI "pbjacobi" 597f5ff6fdSBarry Smith #define PCMAT "mat" 60c4888f26SBarry Smith #define PCHYPRE "hypre" 6137f80224SJose E. Roman #define PCPARMS "parms" 620971522cSBarry Smith #define PCFIELDSPLIT "fieldsplit" 63be16f70fSSatish Balay #define PCTFS "tfs" 645582bec1SHong Zhang #define PCML "ml" 652a6744ebSBarry Smith #define PCGALERKIN "galerkin" 667233f9f0SBarry Smith #define PCEXOTIC "exotic" 67bad7cb1dSBarry Smith #define PCHMPI "hmpi" 68f4b8409dSBarry Smith #define PCASA "asa" 6924c02a0fSBarry Smith #define PCCP "cp" 70628b8437SMatthew Knepley #define PCBFBT "bfbt" 71519d70e2SJed Brown #define PCLSC "lsc" 721d6018f0SLisandro Dalcin #define PCPYTHON "python" 73f91d8e95SBarry Smith #define PCPFMG "pfmg" 74d851a50bSGlenn Hammond #define PCSYSPFMG "syspfmg" 75df826632SBarry Smith #define PCREDISTRIBUTE "redistribute" 76ac793be5SBarry Smith #define PCSVD "svd" 77ac793be5SBarry Smith #define PCGAMG "gamg" 78ac793be5SBarry Smith #define PCSACUSP "sacusp" /* these four run on NVIDIA GPUs using CUSP */ 79bfc29b71SVictor Minden #define PCSACUSPPOLY "sacusppoly" 808154be41SBarry Smith #define PCBICGSTABCUSP "bicgstabcusp" 8104b59e88SVictor Minden #define PCAINVCUSP "ainvcusp" 820c7d97c5SJed Brown #define PCBDDC "bddc" 83123ea438SMatthew Knepley 84123ea438SMatthew Knepley /* Logging support */ 85014dd563SJed Brown PETSC_EXTERN PetscClassId PC_CLASSID; 86123ea438SMatthew Knepley 873d957683SBarry Smith /*E 883d957683SBarry Smith PCSide - If the preconditioner is to be applied to the left, right 893d957683SBarry Smith or symmetrically around the operator. 90d03aef70SBarry Smith 913d957683SBarry Smith Level: beginner 9221e95762SBarry Smith 933d957683SBarry Smith .seealso: 943d957683SBarry Smith E*/ 959e568555SJed Brown typedef enum { PC_SIDE_DEFAULT=-1,PC_LEFT,PC_RIGHT,PC_SYMMETRIC} PCSide; 969e568555SJed Brown #define PC_SIDE_MAX (PC_SYMMETRIC + 1) 970910f4e4SJed Brown PETSC_EXTERN const char *const *const PCSides; 9872b7852fSLois Curfman McInnes 99014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCCreate(MPI_Comm,PC*); 10019fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PCSetType(PC,PCType); 101014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetUp(PC); 102014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetUpOnBlocks(PC); 103014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCApply(PC,Vec,Vec); 104014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCApplySymmetricLeft(PC,Vec,Vec); 105014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCApplySymmetricRight(PC,Vec,Vec); 106014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCApplyBAorAB(PC,PCSide,Vec,Vec,Vec); 107014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCApplyTranspose(PC,Vec,Vec); 108014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCApplyTransposeExists(PC,PetscBool *); 109014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCApplyBAorABTranspose(PC,PCSide,Vec,Vec,Vec); 1104d0a8057SBarry Smith 11155849f57SBarry Smith #define PC_FILE_CLASSID 1211222 11255849f57SBarry Smith 1134d0a8057SBarry Smith /*E 1144d0a8057SBarry Smith PCRichardsonConvergedReason - reason a PCApplyRichardson method terminates 1154d0a8057SBarry Smith 1164d0a8057SBarry Smith Level: advanced 1174d0a8057SBarry Smith 1184d0a8057SBarry Smith Notes: this must match finclude/petscpc.h and the KSPConvergedReason values in petscksp.h 1194d0a8057SBarry Smith 1204d0a8057SBarry Smith .seealso: PCApplyRichardson() 1214d0a8057SBarry Smith E*/ 1224d0a8057SBarry Smith typedef enum { 1234d0a8057SBarry Smith PCRICHARDSON_CONVERGED_RTOL = 2, 1244d0a8057SBarry Smith PCRICHARDSON_CONVERGED_ATOL = 3, 1254d0a8057SBarry Smith PCRICHARDSON_CONVERGED_ITS = 4, 1264d0a8057SBarry Smith PCRICHARDSON_DIVERGED_DTOL = -4} PCRichardsonConvergedReason; 1274d0a8057SBarry Smith 128014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCApplyRichardson(PC,Vec,Vec,Vec,PetscReal,PetscReal,PetscReal,PetscInt,PetscBool ,PetscInt*,PCRichardsonConvergedReason*); 129014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCApplyRichardsonExists(PC,PetscBool *); 130014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetInitialGuessNonzero(PC,PetscBool ); 13149517cdeSBarry Smith PETSC_EXTERN PetscErrorCode PCSetUseAmat(PC,PetscBool); 13249517cdeSBarry Smith PETSC_EXTERN PetscErrorCode PCGetUseAmat(PC,PetscBool*); 13384cb2905SBarry Smith 134607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PCRegisterAll(void); 135014dd563SJed Brown PETSC_EXTERN PetscBool PCRegisterAllCalled; 13684cb2905SBarry Smith 137bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode PCRegister(const char[],PetscErrorCode(*)(PC)); 13830de9b25SBarry Smith 139014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCReset(PC); 140014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCDestroy(PC*); 141014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetFromOptions(PC); 14219fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PCGetType(PC,PCType*); 14314c91fddSBarry Smith 144014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorGetMatrix(PC,Mat*); 145014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetModifySubMatrices(PC,PetscErrorCode(*)(PC,PetscInt,const IS[],const IS[],Mat[],void*),void*); 146014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCModifySubMatrices(PC,PetscInt,const IS[],const IS[],Mat[],void*); 1475b116368SBarry Smith 148014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetOperators(PC,Mat,Mat,MatStructure); 149014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGetOperators(PC,Mat*,Mat*,MatStructure*); 150014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGetOperatorsSet(PC,PetscBool *,PetscBool *); 1514b0e389bSBarry Smith 152014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCView(PC,PetscViewer); 15355849f57SBarry Smith PETSC_EXTERN PetscErrorCode PCLoad(PC,PetscViewer); 1547bc3d0afSSatish Balay 155014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetOptionsPrefix(PC,const char[]); 156014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCAppendOptionsPrefix(PC,const char[]); 157014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGetOptionsPrefix(PC,const char*[]); 1588ed539a5SBarry Smith 159014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCComputeExplicitOperator(PC,Mat*); 16071601f6fSBarry Smith 161d6913704SBarry Smith /* 162d6913704SBarry Smith These are used to provide extra scaling of preconditioned 1630f3b3ca1SHong Zhang operator for time-stepping schemes like in SUNDIALS 164d6913704SBarry Smith */ 165014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGetDiagonalScale(PC,PetscBool *); 166014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCDiagonalScaleLeft(PC,Vec,Vec); 167014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCDiagonalScaleRight(PC,Vec,Vec); 168014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetDiagonalScale(PC,Vec); 169d6913704SBarry Smith 17084cb2905SBarry Smith /* ------------- options specific to particular preconditioners --------- */ 171329f5518SBarry Smith 172014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCJacobiSetUseRowMax(PC); 173014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCJacobiSetUseRowSum(PC); 174014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCJacobiSetUseAbs(PC); 175014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSORSetSymmetric(PC,MatSORType); 176014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSORSetOmega(PC,PetscReal); 177014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSORSetIterations(PC,PetscInt,PetscInt); 178d03aef70SBarry Smith 179014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCEisenstatSetOmega(PC,PetscReal); 180014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCEisenstatNoDiagonalScaling(PC); 181421c37bdSBarry Smith 182014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBJacobiSetTotalBlocks(PC,PetscInt,const PetscInt[]); 183014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBJacobiSetLocalBlocks(PC,PetscInt,const PetscInt[]); 1841eb62cbbSBarry Smith 185014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetApply(PC,PetscErrorCode (*)(PC,Vec,Vec)); 186014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetApplyBA(PC,PetscErrorCode (*)(PC,PCSide,Vec,Vec,Vec)); 187014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetApplyTranspose(PC,PetscErrorCode (*)(PC,Vec,Vec)); 188014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetSetUp(PC,PetscErrorCode (*)(PC)); 189014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetApplyRichardson(PC,PetscErrorCode (*)(PC,Vec,Vec,Vec,PetscReal,PetscReal,PetscReal,PetscInt,PetscBool ,PetscInt*,PCRichardsonConvergedReason*)); 190014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetView(PC,PetscErrorCode (*)(PC,PetscViewer)); 191014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetDestroy(PC,PetscErrorCode (*)(PC)); 192014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellGetContext(PC,void**); 193014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetContext(PC,void*); 194014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetName(PC,const char[]); 195014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellGetName(PC,const char*[]); 196aabeff55SBarry Smith 197014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetZeroPivot(PC,PetscReal); 198d90ac83dSHong Zhang 199014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetShiftType(PC,MatFactorShiftType); 200014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetShiftAmount(PC,PetscReal); 201d90ac83dSHong Zhang 202014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetMatSolverPackage(PC,const MatSolverPackage); 203014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorGetMatSolverPackage(PC,const MatSolverPackage*); 204014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetUpMatSolverPackage(PC); 2052401956bSBarry Smith 206014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetFill(PC,PetscReal); 207014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetColumnPivot(PC,PetscReal); 208014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorReorderForNonzeroDiagonal(PC,PetscReal); 209421c37bdSBarry Smith 21019fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PCFactorSetMatOrderingType(PC,MatOrderingType); 211014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetReuseOrdering(PC,PetscBool ); 212014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetReuseFill(PC,PetscBool ); 213014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetUseInPlace(PC); 214014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetAllowDiagonalFill(PC); 215014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetPivotInBlocks(PC,PetscBool ); 216f5a88c2aSLois Curfman McInnes 2172591b318SToby Isaac PETSC_EXTERN PetscErrorCode PCFactorGetLevels(PC,PetscInt*); 218014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetLevels(PC,PetscInt); 219014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetDropTolerance(PC,PetscReal,PetscReal,PetscInt); 220b35a507dSBarry Smith 221014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMSetLocalSubdomains(PC,PetscInt,IS[],IS[]); 222014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMSetTotalSubdomains(PC,PetscInt,IS[],IS[]); 223014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMSetOverlap(PC,PetscInt); 224d709ea83SDmitry Karpeev PETSC_EXTERN PetscErrorCode PCASMSetDMSubdomains(PC,PetscBool); 225d709ea83SDmitry Karpeev PETSC_EXTERN PetscErrorCode PCASMGetDMSubdomains(PC,PetscBool*); 226014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMSetSortIndices(PC,PetscBool ); 227f746d493SDmitry Karpeev 2283d957683SBarry Smith /*E 2293d957683SBarry Smith PCASMType - Type of additive Schwarz method to use 2303d957683SBarry Smith 231feb221f8SDmitry Karpeev $ PC_ASM_BASIC - Symmetric version where residuals from the ghost points are used 232feb221f8SDmitry Karpeev $ and computed values in ghost regions are added together. 233feb221f8SDmitry Karpeev $ Classical standard additive Schwarz. 234feb221f8SDmitry Karpeev $ PC_ASM_RESTRICT - Residuals from ghost points are used but computed values in ghost 235feb221f8SDmitry Karpeev $ region are discarded. 236feb221f8SDmitry Karpeev $ Default. 237feb221f8SDmitry Karpeev $ PC_ASM_INTERPOLATE - Residuals from ghost points are not used, computed values in ghost 238feb221f8SDmitry Karpeev $ region are added back in. 239feb221f8SDmitry Karpeev $ PC_ASM_NONE - Residuals from ghost points are not used, computed ghost values are 240feb221f8SDmitry Karpeev $ discarded. 241feb221f8SDmitry Karpeev $ Not very good. 2423d957683SBarry Smith 2433d957683SBarry Smith Level: beginner 2443d957683SBarry Smith 2453d957683SBarry Smith .seealso: PCASMSetType() 2463d957683SBarry Smith E*/ 247d252947aSBarry Smith typedef enum {PC_ASM_BASIC = 3,PC_ASM_RESTRICT = 1,PC_ASM_INTERPOLATE = 2,PC_ASM_NONE = 0} PCASMType; 2486a6fc655SJed Brown PETSC_EXTERN const char *const PCASMTypes[]; 2499dcbbd2bSBarry Smith 250014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMSetType(PC,PCASMType); 251014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMCreateSubdomains(Mat,PetscInt,IS*[]); 252014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMDestroySubdomains(PetscInt,IS[],IS[]); 253014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMCreateSubdomains2D(PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt*,IS**,IS**); 254014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMGetLocalSubdomains(PC,PetscInt*,IS*[],IS*[]); 255014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMGetLocalSubmatrices(PC,PetscInt*,Mat*[]); 256981c4779SBarry Smith 2573d957683SBarry Smith /*E 2586a4f0f73SDmitry Karpeev PCGASMType - Type of generalized additive Schwarz method to use (differs from ASM in allowing multiple processors per subdomain). 259f746d493SDmitry Karpeev 2606a4f0f73SDmitry Karpeev Each subdomain has nested inner and outer parts. The inner subdomains are assumed to form a non-overlapping covering of the computational 2616a4f0f73SDmitry Karpeev domain, while the outer subdomains contain the inner subdomains and overlap with each other. This preconditioner will compute 2626a4f0f73SDmitry Karpeev a subdomain correction over each *outer* subdomain from a residual computed there, but its different variants will differ in 2636a4f0f73SDmitry Karpeev (a) how the outer subdomain residual is computed, and (b) how the outer subdomain correction is computed. 2646a4f0f73SDmitry Karpeev 2656a4f0f73SDmitry Karpeev $ PC_GASM_BASIC - Symmetric version where the full from the outer subdomain is used, and the resulting correction is applied 2666a4f0f73SDmitry Karpeev $ over the outer subdomains. As a result, points in the overlap will receive the sum of the corrections 2676a4f0f73SDmitry Karpeev $ from neighboring subdomains. 268feb221f8SDmitry Karpeev $ Classical standard additive Schwarz. 2696a4f0f73SDmitry Karpeev $ PC_GASM_RESTRICT - Residual from the outer subdomain is used but the correction is restricted to the inner subdomain only 2706a4f0f73SDmitry Karpeev $ (i.e., zeroed out over the overlap portion of the outer subdomain before being applied). As a result, 2716a4f0f73SDmitry Karpeev $ each point will receive a correction only from the unique inner subdomain containing it (nonoverlapping covering 2726a4f0f73SDmitry Karpeev $ assumption). 273feb221f8SDmitry Karpeev $ Default. 2746a4f0f73SDmitry Karpeev $ PC_GASM_INTERPOLATE - Residual is zeroed out over the overlap portion of the outer subdomain, but the resulting correction is 2756a4f0f73SDmitry Karpeev $ applied over the outer subdomain. As a result, points in the overlap will receive the sum of the corrections 2766a4f0f73SDmitry Karpeev $ from neighboring subdomains. 2776a4f0f73SDmitry Karpeev $ 2786a4f0f73SDmitry Karpeev $ PC_GASM_NONE - Residuals and corrections are zeroed out outside the local subdomains. 279feb221f8SDmitry Karpeev $ Not very good. 280f746d493SDmitry Karpeev 281f746d493SDmitry Karpeev Level: beginner 282f746d493SDmitry Karpeev 283f746d493SDmitry Karpeev .seealso: PCGASMSetType() 284f746d493SDmitry Karpeev E*/ 285f746d493SDmitry Karpeev typedef enum {PC_GASM_BASIC = 3,PC_GASM_RESTRICT = 1,PC_GASM_INTERPOLATE = 2,PC_GASM_NONE = 0} PCGASMType; 2866a6fc655SJed Brown PETSC_EXTERN const char *const PCGASMTypes[]; 287f746d493SDmitry Karpeev 288014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMSetSubdomains(PC,PetscInt,IS[],IS[]); 289014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMSetTotalSubdomains(PC,PetscInt,PetscBool); 290014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMSetOverlap(PC,PetscInt); 291d709ea83SDmitry Karpeev PETSC_EXTERN PetscErrorCode PCGASMSetDMSubdomains(PC,PetscBool); 292d709ea83SDmitry Karpeev PETSC_EXTERN PetscErrorCode PCGASMGetDMSubdomains(PC,PetscBool*); 293014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMSetSortIndices(PC,PetscBool ); 294f746d493SDmitry Karpeev 295014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMSetType(PC,PCGASMType); 296014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMCreateLocalSubdomains(Mat,PetscInt,PetscInt,IS*[],IS*[]); 297014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMDestroySubdomains(PetscInt,IS[],IS[]); 298014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMCreateSubdomains2D(PC,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt*,IS**,IS**); 299014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMGetSubdomains(PC,PetscInt*,IS*[],IS*[]); 300014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMGetSubmatrices(PC,PetscInt*,Mat*[]); 301f746d493SDmitry Karpeev 302f746d493SDmitry Karpeev /*E 3033d957683SBarry Smith PCCompositeType - Determines how two or more preconditioner are composed 3043d957683SBarry Smith 3053d957683SBarry Smith $ PC_COMPOSITE_ADDITIVE - results from application of all preconditioners are added together 3063d957683SBarry Smith $ PC_COMPOSITE_MULTIPLICATIVE - preconditioners are applied sequentially to the residual freshly 3073d957683SBarry Smith $ computed after the previous preconditioner application 308ccb205f8SBarry Smith $ PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE - preconditioners are applied sequentially to the residual freshly 309ccb205f8SBarry Smith $ computed from first preconditioner to last and then back (Use only for symmetric matrices and preconditions) 3103d957683SBarry Smith $ PC_COMPOSITE_SPECIAL - This is very special for a matrix of the form alpha I + R + S 3113d957683SBarry Smith $ where first preconditioner is built from alpha I + S and second from 3123d957683SBarry Smith $ alpha I + R 3133d957683SBarry Smith 3143d957683SBarry Smith Level: beginner 3153d957683SBarry Smith 3163d957683SBarry Smith .seealso: PCCompositeSetType() 3173d957683SBarry Smith E*/ 3183b224e63SBarry Smith typedef enum {PC_COMPOSITE_ADDITIVE,PC_COMPOSITE_MULTIPLICATIVE,PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE,PC_COMPOSITE_SPECIAL,PC_COMPOSITE_SCHUR} PCCompositeType; 3196a6fc655SJed Brown PETSC_EXTERN const char *const PCCompositeTypes[]; 3209dcbbd2bSBarry Smith 321014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCCompositeSetType(PC,PCCompositeType); 32219fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PCCompositeAddPC(PC,PCType); 323014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCCompositeGetPC(PC,PetscInt,PC *); 324014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCCompositeSpecialSetAlpha(PC,PetscScalar); 325981c4779SBarry Smith 326014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCRedundantSetNumber(PC,PetscInt); 327014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCRedundantSetScatter(PC,VecScatter,VecScatter); 328014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCRedundantGetOperators(PC,Mat*,Mat*); 329da3a660dSBarry Smith 330014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetEpsilon(PC,double); 331014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetNBSteps(PC,PetscInt); 332014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetMax(PC,PetscInt); 333014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetMaxNew(PC,PetscInt); 334014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetBlockSize(PC,PetscInt); 335014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetCacheSize(PC,PetscInt); 336014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetVerbose(PC,PetscInt); 337014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetSp(PC,PetscInt); 3383304466cSBarry Smith 339014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCHYPRESetType(PC,const char[]); 340014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCHYPREGetType(PC,const char*[]); 341014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBJacobiGetLocalBlocks(PC,PetscInt*,const PetscInt*[]); 342014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBJacobiGetTotalBlocks(PC,PetscInt*,const PetscInt*[]); 3433304466cSBarry Smith 344014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitSetFields(PC,const char[],PetscInt,const PetscInt*,const PetscInt*); 345014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitGetType(PC,PCCompositeType*); 346014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitSetType(PC,PCCompositeType); 347014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitSetBlockSize(PC,PetscInt); 348014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitSetIS(PC,const char[],IS); 349014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitGetIS(PC,const char[],IS*); 3504ab8060aSDmitry Karpeev PETSC_EXTERN PetscErrorCode PCFieldSplitSetDMSplits(PC,PetscBool); 3514ab8060aSDmitry Karpeev PETSC_EXTERN PetscErrorCode PCFieldSplitGetDMSplits(PC,PetscBool*); 352084e4875SJed Brown 353084e4875SJed Brown /*E 354084e4875SJed Brown PCFieldSplitSchurPreType - Determines how to precondition Schur complement 355084e4875SJed Brown 356084e4875SJed Brown Level: intermediate 357084e4875SJed Brown 358084e4875SJed Brown .seealso: PCFieldSplitSchurPrecondition() 359084e4875SJed Brown E*/ 360e87fab1bSBarry Smith typedef enum {PC_FIELDSPLIT_SCHUR_PRE_SELF,PC_FIELDSPLIT_SCHUR_PRE_A11,PC_FIELDSPLIT_SCHUR_PRE_USER} PCFieldSplitSchurPreType; 361014dd563SJed Brown PETSC_EXTERN const char *const PCFieldSplitSchurPreTypes[]; 362084e4875SJed Brown 363ab1df9f5SJed Brown /*E 364c9c6ffaaSJed Brown PCFieldSplitSchurFactType - determines which off-diagonal parts of the approximate block factorization to use 365ab1df9f5SJed Brown 366ab1df9f5SJed Brown Level: intermediate 367ab1df9f5SJed Brown 368c9c6ffaaSJed Brown .seealso: PCFieldSplitSetSchurFactType() 369ab1df9f5SJed Brown E*/ 370ab1df9f5SJed Brown typedef enum { 371c9c6ffaaSJed Brown PC_FIELDSPLIT_SCHUR_FACT_DIAG, 372c9c6ffaaSJed Brown PC_FIELDSPLIT_SCHUR_FACT_LOWER, 373c9c6ffaaSJed Brown PC_FIELDSPLIT_SCHUR_FACT_UPPER, 374c9c6ffaaSJed Brown PC_FIELDSPLIT_SCHUR_FACT_FULL 375c9c6ffaaSJed Brown } PCFieldSplitSchurFactType; 376014dd563SJed Brown PETSC_EXTERN const char *const PCFieldSplitSchurFactTypes[]; 377ab1df9f5SJed Brown 378014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitSchurPrecondition(PC,PCFieldSplitSchurPreType,Mat); 379014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitSetSchurFactType(PC,PCFieldSplitSchurFactType); 380014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitGetSchurBlocks(PC,Mat*,Mat*,Mat*,Mat*); 3813d30b1ffSBarry Smith 382014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGalerkinSetRestriction(PC,Mat); 383014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGalerkinSetInterpolation(PC,Mat); 3842a6744ebSBarry Smith 385014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetCoordinates(PC,PetscInt,PetscInt,PetscReal*); 386014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSASetVectors(PC,PetscInt,PetscReal *); 3872102ba4dSSatish Balay 388014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCPythonSetType(PC,const char[]); 38967fac13cSBarry Smith 390014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetDM(PC,DM); 391014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGetDM(PC,DM*); 3926c699258SBarry Smith 393014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetApplicationContext(PC,void*); 394014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGetApplicationContext(PC,void*); 3951b2093e4SBarry Smith 396014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBiCGStabCUSPSetTolerance(PC,PetscReal); 397014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBiCGStabCUSPSetIterations(PC,PetscInt); 398014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBiCGStabCUSPSetUseVerboseMonitor(PC,PetscBool); 3996c699258SBarry Smith 400014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCAINVCUSPSetDropTolerance(PC,PetscReal); 401014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCAINVCUSPUseScaling(PC,PetscBool); 402014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCAINVCUSPSetNonzeros(PC,PetscInt); 403014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCAINVCUSPSetLinParameter(PC,PetscInt); 40437f80224SJose E. Roman /*E 40537f80224SJose E. Roman PCPARMSGlobalType - Determines the global preconditioner method in PARMS 40637f80224SJose E. Roman 40737f80224SJose E. Roman Level: intermediate 40837f80224SJose E. Roman 40937f80224SJose E. Roman .seealso: PCPARMSSetGlobal() 41037f80224SJose E. Roman E*/ 41137f80224SJose E. Roman typedef enum {PC_PARMS_GLOBAL_RAS,PC_PARMS_GLOBAL_SCHUR,PC_PARMS_GLOBAL_BJ} PCPARMSGlobalType; 4126a6fc655SJed Brown PETSC_EXTERN const char *const PCPARMSGlobalTypes[]; 41337f80224SJose E. Roman /*E 41437f80224SJose E. Roman PCPARMSLocalType - Determines the local preconditioner method in PARMS 41537f80224SJose E. Roman 41637f80224SJose E. Roman Level: intermediate 41737f80224SJose E. Roman 41837f80224SJose E. Roman .seealso: PCPARMSSetLocal() 41937f80224SJose E. Roman E*/ 42037f80224SJose E. Roman typedef enum {PC_PARMS_LOCAL_ILU0,PC_PARMS_LOCAL_ILUK,PC_PARMS_LOCAL_ILUT,PC_PARMS_LOCAL_ARMS} PCPARMSLocalType; 4216a6fc655SJed Brown PETSC_EXTERN const char *const PCPARMSLocalTypes[]; 42237f80224SJose E. Roman 423014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCPARMSSetGlobal(PC pc,PCPARMSGlobalType type); 424014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCPARMSSetLocal(PC pc,PCPARMSLocalType type); 425014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCPARMSSetSolveTolerances(PC pc,PetscReal tol,PetscInt maxits); 426014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCPARMSSetSolveRestart(PC pc,PetscInt restart); 427014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCPARMSSetNonsymPerm(PC pc,PetscBool nonsym); 428014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCPARMSSetFill(PC pc,PetscInt lfil0,PetscInt lfil1,PetscInt lfil2); 42937f80224SJose E. Roman 4305154939eSJed Brown /*E 4315154939eSJed Brown PCGAMGType - type of generalized algebraic multigrid (PCGAMG) method 4325154939eSJed Brown 4335154939eSJed Brown Level: intermediate 4345154939eSJed Brown 4355154939eSJed Brown .seealso: PCMG, PCSetType(), PCGAMGSetThreshold(), PCGAMGSetThreshold(), PCGAMGSetReuseProl() 4365154939eSJed Brown E*/ 437a782d3a5SMark Adams typedef const char *PCGAMGType; 438a782d3a5SMark Adams #define PCGAMGAGG "agg" 439a782d3a5SMark Adams #define PCGAMGGEO "geo" 4408e6d0c30SPeter Brune #define PCGAMGCLASSICAL "classical" 441014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetProcEqLim(PC,PetscInt); 442014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetRepartitioning(PC,PetscBool); 443014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetUseASMAggs(PC,PetscBool); 444014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetSolverType(PC,char[],PetscInt); 445014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetThreshold(PC,PetscReal); 446014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetCoarseEqLim(PC,PetscInt); 447014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetNlevels(PC,PetscInt); 44819fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PCGAMGSetType( PC,PCGAMGType ); 449014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetNSmooths(PC pc, PetscInt n); 450014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetSymGraph(PC pc, PetscBool n); 451014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetSquareGraph(PC,PetscBool); 452fc897844SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetReuseProl(PC,PetscBool); 4533e3471ccSMark Adams PETSC_EXTERN PetscErrorCode PCGAMGFinalizePackage(void); 4543e3471ccSMark Adams PETSC_EXTERN PetscErrorCode PCGAMGInitializePackage(void); 45556de70efSSatish Balay 456*8eab0cc1SPeter Brune typedef const char *PCGAMGClassicalType; 457*8eab0cc1SPeter Brune #define PCGAMGCLASSICALDIRECT "direct" 458*8eab0cc1SPeter Brune #define PCGAMGCLASSICALSTANDARD "standard" 459*8eab0cc1SPeter Brune PETSC_EXTERN PetscErrorCode PCGAMGClassicalSetType(PC,PCGAMGClassicalType); 460*8eab0cc1SPeter Brune 4610c7d97c5SJed Brown #if defined(PETSC_HAVE_PCBDDC) 462674ae819SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCSetPrimalVerticesLocalIS(PC,IS); 4634fad6a16SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCSetCoarseningRatio(PC,PetscInt); 4642b510759SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCSetLevels(PC,PetscInt); 4650bdf917eSStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCSetNullSpace(PC,MatNullSpace); 466014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBDDCSetDirichletBoundaries(PC,IS); 467014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBDDCGetDirichletBoundaries(PC,IS*); 468014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBDDCSetNeumannBoundaries(PC,IS); 469014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBDDCGetNeumannBoundaries(PC,IS*); 470014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBDDCSetDofsSplitting(PC,PetscInt,IS[]); 4711a83f524SJed Brown PETSC_EXTERN PetscErrorCode PCBDDCSetLocalAdjacencyGraph(PC,PetscInt,const PetscInt[],const PetscInt[],PetscCopyMode); 4723425bc38SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCCreateFETIDPOperators(PC,Mat*,PC*); 4733425bc38SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCMatFETIDPGetRHS(Mat,Vec,Vec); 4743425bc38SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCMatFETIDPGetSolution(Mat,Vec,Vec); 4750c7d97c5SJed Brown #endif 4760c7d97c5SJed Brown 477b965d45eSStefano Zampini PETSC_EXTERN PetscErrorCode PCISSetUseStiffnessScaling(PC,PetscBool); 478014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCISSetSubdomainScalingFactor(PC,PetscScalar); 47946caae47SJed Brown PETSC_EXTERN PetscErrorCode PCISSetSubdomainDiagonalScaling(PC,Vec); 480d3b1e0e7SMatthew Knepley 481b4876bcbSBarry Smith /*E 482b4876bcbSBarry Smith PCMGType - Determines the type of multigrid method that is run. 483b4876bcbSBarry Smith 484b4876bcbSBarry Smith Level: beginner 485b4876bcbSBarry Smith 486b4876bcbSBarry Smith Values: 487b4876bcbSBarry Smith + PC_MG_MULTIPLICATIVE (default) - traditional V or W cycle as determined by PCMGSetCycles() 488b4876bcbSBarry Smith . PC_MG_ADDITIVE - the additive multigrid preconditioner where all levels are 489b4876bcbSBarry Smith smoothed before updating the residual. This only uses the 490b4876bcbSBarry Smith down smoother, in the preconditioner the upper smoother is ignored 491b4876bcbSBarry Smith . PC_MG_FULL - same as multiplicative except one also performs grid sequencing, 492b4876bcbSBarry Smith that is starts on the coarsest grid, performs a cycle, interpolates 493b4876bcbSBarry Smith to the next, performs a cycle etc. This is much like the F-cycle presented in "Multigrid" by Trottenberg, Oosterlee, Schuller page 49, but that 494b4876bcbSBarry Smith algorithm supports smoothing on before the restriction on each level in the initial restriction to the coarsest stage. In addition that algorithm 495b4876bcbSBarry Smith calls the V-cycle only on the coarser level and has a post-smoother instead. 496b4876bcbSBarry Smith - PC_MG_KASKADE - like full multigrid except one never goes back to a coarser level 497b4876bcbSBarry Smith from a finer 498b4876bcbSBarry Smith 499b4876bcbSBarry Smith .seealso: PCMGSetType() 500b4876bcbSBarry Smith 501b4876bcbSBarry Smith E*/ 502b4876bcbSBarry Smith typedef enum { PC_MG_MULTIPLICATIVE,PC_MG_ADDITIVE,PC_MG_FULL,PC_MG_KASKADE } PCMGType; 503b4876bcbSBarry Smith PETSC_EXTERN const char *const PCMGTypes[]; 504b4876bcbSBarry Smith #define PC_MG_CASCADE PC_MG_KASKADE; 505b4876bcbSBarry Smith 506b4876bcbSBarry Smith /*E 507b4876bcbSBarry Smith PCMGCycleType - Use V-cycle or W-cycle 508b4876bcbSBarry Smith 509b4876bcbSBarry Smith Level: beginner 510b4876bcbSBarry Smith 511b4876bcbSBarry Smith Values: 512b4876bcbSBarry Smith + PC_MG_V_CYCLE 513b4876bcbSBarry Smith - PC_MG_W_CYCLE 514b4876bcbSBarry Smith 515b4876bcbSBarry Smith .seealso: PCMGSetCycleType() 516b4876bcbSBarry Smith 517b4876bcbSBarry Smith E*/ 518b4876bcbSBarry Smith typedef enum { PC_MG_CYCLE_V = 1,PC_MG_CYCLE_W = 2 } PCMGCycleType; 519b4876bcbSBarry Smith PETSC_EXTERN const char *const PCMGCycleTypes[]; 520b4876bcbSBarry Smith 521b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetType(PC,PCMGType); 522b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetLevels(PC,PetscInt,MPI_Comm*); 523b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGGetLevels(PC,PetscInt*); 524b4876bcbSBarry Smith 525b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetNumberSmoothUp(PC,PetscInt); 526b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetNumberSmoothDown(PC,PetscInt); 527b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetCycleType(PC,PCMGCycleType); 528b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetCycleTypeOnLevel(PC,PetscInt,PCMGCycleType); 529b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetCyclesOnLevel(PC,PetscInt,PetscInt); 530b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGMultiplicativeSetCycles(PC,PetscInt); 531b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetGalerkin(PC,PetscBool); 532b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGGetGalerkin(PC,PetscBool*); 533b4876bcbSBarry Smith 534b4876bcbSBarry Smith 535b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetRhs(PC,PetscInt,Vec); 536b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetX(PC,PetscInt,Vec); 537b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetR(PC,PetscInt,Vec); 538b4876bcbSBarry Smith 539b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetRestriction(PC,PetscInt,Mat); 540b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGGetRestriction(PC,PetscInt,Mat*); 541b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetInterpolation(PC,PetscInt,Mat); 542b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGGetInterpolation(PC,PetscInt,Mat*); 543b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetRScale(PC,PetscInt,Vec); 544b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGGetRScale(PC,PetscInt,Vec*); 545b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetResidual(PC,PetscInt,PetscErrorCode (*)(Mat,Vec,Vec,Vec),Mat); 54654b2cd4bSJed Brown PETSC_EXTERN PetscErrorCode PCMGResidualDefault(Mat,Vec,Vec,Vec); 547b4876bcbSBarry Smith 548b4876bcbSBarry Smith /*E 549b4876bcbSBarry Smith PCExoticType - Face based or wirebasket based coarse grid space 550b4876bcbSBarry Smith 551b4876bcbSBarry Smith Level: beginner 552b4876bcbSBarry Smith 553b4876bcbSBarry Smith .seealso: PCExoticSetType(), PCEXOTIC 554b4876bcbSBarry Smith E*/ 555b4876bcbSBarry Smith typedef enum { PC_EXOTIC_FACE,PC_EXOTIC_WIREBASKET } PCExoticType; 556b4876bcbSBarry Smith PETSC_EXTERN const char *const PCExoticTypes[]; 557b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCExoticSetType(PC,PCExoticType); 558b4876bcbSBarry Smith 559123ea438SMatthew Knepley #endif /* __PETSCPC_H */ 560