xref: /petsc/include/petscpc.h (revision c60c7ad4eb3baa38c2a8deee7f23b741b9653612)
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"
6724c02a0fSBarry Smith #define PCCP              "cp"
68628b8437SMatthew Knepley #define PCBFBT            "bfbt"
69519d70e2SJed Brown #define PCLSC             "lsc"
701d6018f0SLisandro Dalcin #define PCPYTHON          "python"
71f91d8e95SBarry Smith #define PCPFMG            "pfmg"
72d851a50bSGlenn Hammond #define PCSYSPFMG         "syspfmg"
73df826632SBarry Smith #define PCREDISTRIBUTE    "redistribute"
74ac793be5SBarry Smith #define PCSVD             "svd"
75ac793be5SBarry Smith #define PCGAMG            "gamg"
76ac793be5SBarry Smith #define PCSACUSP          "sacusp"        /* these four run on NVIDIA GPUs using CUSP */
77bfc29b71SVictor Minden #define PCSACUSPPOLY      "sacusppoly"
788154be41SBarry Smith #define PCBICGSTABCUSP    "bicgstabcusp"
7904b59e88SVictor Minden #define PCAINVCUSP        "ainvcusp"
800c7d97c5SJed Brown #define PCBDDC            "bddc"
813f93e5bdSPeter Brune #define PCKACZMARZ        "kaczmarz"
82123ea438SMatthew Knepley 
83123ea438SMatthew Knepley /* Logging support */
84014dd563SJed Brown PETSC_EXTERN PetscClassId PC_CLASSID;
85123ea438SMatthew Knepley 
863d957683SBarry Smith /*E
873d957683SBarry Smith     PCSide - If the preconditioner is to be applied to the left, right
883d957683SBarry Smith      or symmetrically around the operator.
89d03aef70SBarry Smith 
903d957683SBarry Smith    Level: beginner
9121e95762SBarry Smith 
923d957683SBarry Smith .seealso:
933d957683SBarry Smith E*/
949e568555SJed Brown typedef enum { PC_SIDE_DEFAULT=-1,PC_LEFT,PC_RIGHT,PC_SYMMETRIC} PCSide;
959e568555SJed Brown #define PC_SIDE_MAX (PC_SYMMETRIC + 1)
960910f4e4SJed Brown PETSC_EXTERN const char *const *const PCSides;
9772b7852fSLois Curfman McInnes 
98014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCCreate(MPI_Comm,PC*);
9919fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PCSetType(PC,PCType);
100*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCGetType(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);
11023ee1639SBarry Smith PETSC_EXTERN PetscErrorCode PCSetReusePreconditioner(PC,PetscBool);
111*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCGetReusePreconditioner(PC,PetscBool*);
1124d0a8057SBarry Smith 
11355849f57SBarry Smith #define PC_FILE_CLASSID 1211222
11455849f57SBarry Smith 
1154d0a8057SBarry Smith /*E
1164d0a8057SBarry Smith     PCRichardsonConvergedReason - reason a PCApplyRichardson method terminates
1174d0a8057SBarry Smith 
1184d0a8057SBarry Smith    Level: advanced
1194d0a8057SBarry Smith 
1204d0a8057SBarry Smith    Notes: this must match finclude/petscpc.h and the KSPConvergedReason values in petscksp.h
1214d0a8057SBarry Smith 
1224d0a8057SBarry Smith .seealso: PCApplyRichardson()
1234d0a8057SBarry Smith E*/
1244d0a8057SBarry Smith typedef enum {
1254d0a8057SBarry Smith               PCRICHARDSON_CONVERGED_RTOL               =  2,
1264d0a8057SBarry Smith               PCRICHARDSON_CONVERGED_ATOL               =  3,
1274d0a8057SBarry Smith               PCRICHARDSON_CONVERGED_ITS                =  4,
1284d0a8057SBarry Smith               PCRICHARDSON_DIVERGED_DTOL                = -4} PCRichardsonConvergedReason;
1294d0a8057SBarry Smith 
130014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCApplyRichardson(PC,Vec,Vec,Vec,PetscReal,PetscReal,PetscReal,PetscInt,PetscBool ,PetscInt*,PCRichardsonConvergedReason*);
131014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCApplyRichardsonExists(PC,PetscBool *);
132014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetInitialGuessNonzero(PC,PetscBool);
133*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCGetInitialGuessNonzero(PC,PetscBool*);
13449517cdeSBarry Smith PETSC_EXTERN PetscErrorCode PCSetUseAmat(PC,PetscBool);
13549517cdeSBarry Smith PETSC_EXTERN PetscErrorCode PCGetUseAmat(PC,PetscBool*);
13684cb2905SBarry Smith 
137607a6623SBarry Smith PETSC_EXTERN PetscErrorCode PCRegisterAll(void);
138014dd563SJed Brown PETSC_EXTERN PetscBool PCRegisterAllCalled;
13984cb2905SBarry Smith 
140bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode PCRegister(const char[],PetscErrorCode(*)(PC));
14130de9b25SBarry Smith 
142014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCReset(PC);
143014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCDestroy(PC*);
144014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetFromOptions(PC);
14514c91fddSBarry Smith 
146014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorGetMatrix(PC,Mat*);
147014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetModifySubMatrices(PC,PetscErrorCode(*)(PC,PetscInt,const IS[],const IS[],Mat[],void*),void*);
148014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCModifySubMatrices(PC,PetscInt,const IS[],const IS[],Mat[],void*);
1495b116368SBarry Smith 
15023ee1639SBarry Smith PETSC_EXTERN PetscErrorCode PCSetOperators(PC,Mat,Mat);
15123ee1639SBarry Smith PETSC_EXTERN PetscErrorCode PCGetOperators(PC,Mat*,Mat*);
152014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGetOperatorsSet(PC,PetscBool *,PetscBool *);
1534b0e389bSBarry Smith 
154014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCView(PC,PetscViewer);
15555849f57SBarry Smith PETSC_EXTERN PetscErrorCode PCLoad(PC,PetscViewer);
156ce1779c8SBarry Smith PETSC_STATIC_INLINE PetscErrorCode PCViewFromOptions(PC A,const char prefix[],const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,prefix,name);}
1577bc3d0afSSatish Balay 
158014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetOptionsPrefix(PC,const char[]);
159014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCAppendOptionsPrefix(PC,const char[]);
160014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGetOptionsPrefix(PC,const char*[]);
1618ed539a5SBarry Smith 
162014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCComputeExplicitOperator(PC,Mat*);
16371601f6fSBarry Smith 
164d6913704SBarry Smith /*
165d6913704SBarry Smith       These are used to provide extra scaling of preconditioned
1660f3b3ca1SHong Zhang    operator for time-stepping schemes like in SUNDIALS
167d6913704SBarry Smith */
168014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGetDiagonalScale(PC,PetscBool *);
169014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCDiagonalScaleLeft(PC,Vec,Vec);
170014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCDiagonalScaleRight(PC,Vec,Vec);
171014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetDiagonalScale(PC,Vec);
172d6913704SBarry Smith 
17384cb2905SBarry Smith /* ------------- options specific to particular preconditioners --------- */
174329f5518SBarry Smith 
175baa89ecbSBarry Smith /*E
176baa89ecbSBarry Smith     PCJacobiType - What elements are used to form the Jacobi preconditioner
177baa89ecbSBarry Smith 
178baa89ecbSBarry Smith    Level: intermediate
179baa89ecbSBarry Smith 
180baa89ecbSBarry Smith .seealso:
181baa89ecbSBarry Smith E*/
182baa89ecbSBarry Smith typedef enum { PC_JACOBI_DIAGONAL,PC_JACOBI_ROWMAX,PC_JACOBI_ROWSUM} PCJacobiType;
183baa89ecbSBarry Smith PETSC_EXTERN const char *const PCJacobiTypes[];
184baa89ecbSBarry Smith 
185baa89ecbSBarry Smith PETSC_EXTERN PetscErrorCode PCJacobiSetType(PC,PCJacobiType);
186baa89ecbSBarry Smith PETSC_EXTERN PetscErrorCode PCJacobiGetType(PC,PCJacobiType*);
187baa89ecbSBarry Smith PETSC_EXTERN PetscErrorCode PCJacobiSetUseAbs(PC,PetscBool);
188baa89ecbSBarry Smith PETSC_EXTERN PetscErrorCode PCJacobiGetUseAbs(PC,PetscBool*);
189014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSORSetSymmetric(PC,MatSORType);
190*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCSORGetSymmetric(PC,MatSORType*);
191014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSORSetOmega(PC,PetscReal);
192*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCSORGetOmega(PC,PetscReal*);
193014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSORSetIterations(PC,PetscInt,PetscInt);
194*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCSORGetIterations(PC,PetscInt*,PetscInt*);
195d03aef70SBarry Smith 
196014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCEisenstatSetOmega(PC,PetscReal);
197*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCEisenstatGetOmega(PC,PetscReal*);
198*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCEisenstatSetNoDiagonalScaling(PC,PetscBool);
199*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCEisenstatGetNoDiagonalScaling(PC,PetscBool*);
200421c37bdSBarry Smith 
201014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBJacobiSetTotalBlocks(PC,PetscInt,const PetscInt[]);
202*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCBJacobiGetTotalBlocks(PC,PetscInt*,const PetscInt*[]);
203014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBJacobiSetLocalBlocks(PC,PetscInt,const PetscInt[]);
204*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCBJacobiGetLocalBlocks(PC,PetscInt*,const PetscInt*[]);
2051eb62cbbSBarry Smith 
206014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetApply(PC,PetscErrorCode (*)(PC,Vec,Vec));
207014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetApplyBA(PC,PetscErrorCode (*)(PC,PCSide,Vec,Vec,Vec));
208014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetApplyTranspose(PC,PetscErrorCode (*)(PC,Vec,Vec));
209014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetSetUp(PC,PetscErrorCode (*)(PC));
210014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetApplyRichardson(PC,PetscErrorCode (*)(PC,Vec,Vec,Vec,PetscReal,PetscReal,PetscReal,PetscInt,PetscBool ,PetscInt*,PCRichardsonConvergedReason*));
211014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetView(PC,PetscErrorCode (*)(PC,PetscViewer));
212014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetDestroy(PC,PetscErrorCode (*)(PC));
213014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetContext(PC,void*);
214*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCShellGetContext(PC,void**);
215014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellSetName(PC,const char[]);
216014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCShellGetName(PC,const char*[]);
217aabeff55SBarry Smith 
218014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetZeroPivot(PC,PetscReal);
219d90ac83dSHong Zhang 
220014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetShiftType(PC,MatFactorShiftType);
221014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetShiftAmount(PC,PetscReal);
222d90ac83dSHong Zhang 
223014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetMatSolverPackage(PC,const MatSolverPackage);
224014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorGetMatSolverPackage(PC,const MatSolverPackage*);
225014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetUpMatSolverPackage(PC);
2262401956bSBarry Smith 
227014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetFill(PC,PetscReal);
228014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetColumnPivot(PC,PetscReal);
229014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorReorderForNonzeroDiagonal(PC,PetscReal);
230421c37bdSBarry Smith 
23119fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PCFactorSetMatOrderingType(PC,MatOrderingType);
232014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetReuseOrdering(PC,PetscBool );
233014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetReuseFill(PC,PetscBool );
2348e37d05fSBarry Smith PETSC_EXTERN PetscErrorCode PCFactorSetUseInPlace(PC,PetscBool);
2358e37d05fSBarry Smith PETSC_EXTERN PetscErrorCode PCFactorGetUseInPlace(PC,PetscBool*);
23692e9c092SBarry Smith PETSC_EXTERN PetscErrorCode PCFactorSetAllowDiagonalFill(PC,PetscBool);
23792e9c092SBarry Smith PETSC_EXTERN PetscErrorCode PCFactorGetAllowDiagonalFill(PC,PetscBool*);
238014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetPivotInBlocks(PC,PetscBool);
239f5a88c2aSLois Curfman McInnes 
240014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetLevels(PC,PetscInt);
241*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCFactorGetLevels(PC,PetscInt*);
242014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFactorSetDropTolerance(PC,PetscReal,PetscReal,PetscInt);
243b35a507dSBarry Smith 
244014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMSetLocalSubdomains(PC,PetscInt,IS[],IS[]);
245014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMSetTotalSubdomains(PC,PetscInt,IS[],IS[]);
246014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMSetOverlap(PC,PetscInt);
247d709ea83SDmitry Karpeev PETSC_EXTERN PetscErrorCode PCASMSetDMSubdomains(PC,PetscBool);
248d709ea83SDmitry Karpeev PETSC_EXTERN PetscErrorCode PCASMGetDMSubdomains(PC,PetscBool*);
249014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMSetSortIndices(PC,PetscBool);
250f746d493SDmitry Karpeev 
2513d957683SBarry Smith /*E
2523d957683SBarry Smith     PCASMType - Type of additive Schwarz method to use
2533d957683SBarry Smith 
254feb221f8SDmitry Karpeev $  PC_ASM_BASIC        - Symmetric version where residuals from the ghost points are used
255feb221f8SDmitry Karpeev $                        and computed values in ghost regions are added together.
256feb221f8SDmitry Karpeev $                        Classical standard additive Schwarz.
257feb221f8SDmitry Karpeev $  PC_ASM_RESTRICT     - Residuals from ghost points are used but computed values in ghost
258feb221f8SDmitry Karpeev $                        region are discarded.
259feb221f8SDmitry Karpeev $                        Default.
260feb221f8SDmitry Karpeev $  PC_ASM_INTERPOLATE  - Residuals from ghost points are not used, computed values in ghost
261feb221f8SDmitry Karpeev $                        region are added back in.
262feb221f8SDmitry Karpeev $  PC_ASM_NONE         - Residuals from ghost points are not used, computed ghost values are
263feb221f8SDmitry Karpeev $                        discarded.
264feb221f8SDmitry Karpeev $                        Not very good.
2653d957683SBarry Smith 
2663d957683SBarry Smith    Level: beginner
2673d957683SBarry Smith 
2683d957683SBarry Smith .seealso: PCASMSetType()
2693d957683SBarry Smith E*/
270d252947aSBarry Smith typedef enum {PC_ASM_BASIC = 3,PC_ASM_RESTRICT = 1,PC_ASM_INTERPOLATE = 2,PC_ASM_NONE = 0} PCASMType;
2716a6fc655SJed Brown PETSC_EXTERN const char *const PCASMTypes[];
2729dcbbd2bSBarry Smith 
273014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMSetType(PC,PCASMType);
274*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCASMGetType(PC,PCASMType*);
275014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMCreateSubdomains(Mat,PetscInt,IS*[]);
276014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMDestroySubdomains(PetscInt,IS[],IS[]);
277014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMCreateSubdomains2D(PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt*,IS**,IS**);
278014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMGetLocalSubdomains(PC,PetscInt*,IS*[],IS*[]);
279014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCASMGetLocalSubmatrices(PC,PetscInt*,Mat*[]);
280981c4779SBarry Smith 
2813d957683SBarry Smith /*E
2826a4f0f73SDmitry Karpeev     PCGASMType - Type of generalized additive Schwarz method to use (differs from ASM in allowing multiple processors per subdomain).
283f746d493SDmitry Karpeev 
2846a4f0f73SDmitry Karpeev    Each subdomain has nested inner and outer parts.  The inner subdomains are assumed to form a non-overlapping covering of the computational
2856a4f0f73SDmitry Karpeev    domain, while the outer subdomains contain the inner subdomains and overlap with each other.  This preconditioner will compute
2866a4f0f73SDmitry Karpeev    a subdomain correction over each *outer* subdomain from a residual computed there, but its different variants will differ in
2876a4f0f73SDmitry Karpeev    (a) how the outer subdomain residual is computed, and (b) how the outer subdomain correction is computed.
2886a4f0f73SDmitry Karpeev 
2896a4f0f73SDmitry Karpeev $  PC_GASM_BASIC       - Symmetric version where the full from the outer subdomain is used, and the resulting correction is applied
2906a4f0f73SDmitry Karpeev $                        over the outer subdomains.  As a result, points in the overlap will receive the sum of the corrections
2916a4f0f73SDmitry Karpeev $                        from neighboring subdomains.
292feb221f8SDmitry Karpeev $                        Classical standard additive Schwarz.
2936a4f0f73SDmitry Karpeev $  PC_GASM_RESTRICT    - Residual from the outer subdomain is used but the correction is restricted to the inner subdomain only
2946a4f0f73SDmitry Karpeev $                        (i.e., zeroed out over the overlap portion of the outer subdomain before being applied).  As a result,
2956a4f0f73SDmitry Karpeev $                        each point will receive a correction only from the unique inner subdomain containing it (nonoverlapping covering
2966a4f0f73SDmitry Karpeev $                        assumption).
297feb221f8SDmitry Karpeev $                        Default.
2986a4f0f73SDmitry Karpeev $  PC_GASM_INTERPOLATE - Residual is zeroed out over the overlap portion of the outer subdomain, but the resulting correction is
2996a4f0f73SDmitry Karpeev $                        applied over the outer subdomain. As a result, points in the overlap will receive the sum of the corrections
3006a4f0f73SDmitry Karpeev $                        from neighboring subdomains.
3016a4f0f73SDmitry Karpeev $
3026a4f0f73SDmitry Karpeev $  PC_GASM_NONE        - Residuals and corrections are zeroed out outside the local subdomains.
303feb221f8SDmitry Karpeev $                        Not very good.
304f746d493SDmitry Karpeev 
305f746d493SDmitry Karpeev    Level: beginner
306f746d493SDmitry Karpeev 
307f746d493SDmitry Karpeev .seealso: PCGASMSetType()
308f746d493SDmitry Karpeev E*/
309f746d493SDmitry Karpeev typedef enum {PC_GASM_BASIC = 3,PC_GASM_RESTRICT = 1,PC_GASM_INTERPOLATE = 2,PC_GASM_NONE = 0} PCGASMType;
3106a6fc655SJed Brown PETSC_EXTERN const char *const PCGASMTypes[];
311f746d493SDmitry Karpeev 
312014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMSetSubdomains(PC,PetscInt,IS[],IS[]);
313014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMSetTotalSubdomains(PC,PetscInt,PetscBool);
314014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMSetOverlap(PC,PetscInt);
315d709ea83SDmitry Karpeev PETSC_EXTERN PetscErrorCode PCGASMSetDMSubdomains(PC,PetscBool);
316d709ea83SDmitry Karpeev PETSC_EXTERN PetscErrorCode PCGASMGetDMSubdomains(PC,PetscBool*);
317014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMSetSortIndices(PC,PetscBool );
318f746d493SDmitry Karpeev 
319014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMSetType(PC,PCGASMType);
320014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMCreateLocalSubdomains(Mat,PetscInt,PetscInt,IS*[],IS*[]);
321014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMDestroySubdomains(PetscInt,IS[],IS[]);
322014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMCreateSubdomains2D(PC,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt*,IS**,IS**);
323014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMGetSubdomains(PC,PetscInt*,IS*[],IS*[]);
324014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGASMGetSubmatrices(PC,PetscInt*,Mat*[]);
325f746d493SDmitry Karpeev 
326f746d493SDmitry Karpeev /*E
3273d957683SBarry Smith     PCCompositeType - Determines how two or more preconditioner are composed
3283d957683SBarry Smith 
3293d957683SBarry Smith $  PC_COMPOSITE_ADDITIVE - results from application of all preconditioners are added together
3303d957683SBarry Smith $  PC_COMPOSITE_MULTIPLICATIVE - preconditioners are applied sequentially to the residual freshly
3313d957683SBarry Smith $                                computed after the previous preconditioner application
332ccb205f8SBarry Smith $  PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE - preconditioners are applied sequentially to the residual freshly
333ccb205f8SBarry Smith $                                computed from first preconditioner to last and then back (Use only for symmetric matrices and preconditions)
3343d957683SBarry Smith $  PC_COMPOSITE_SPECIAL - This is very special for a matrix of the form alpha I + R + S
3353d957683SBarry Smith $                         where first preconditioner is built from alpha I + S and second from
3363d957683SBarry Smith $                         alpha I + R
3373d957683SBarry Smith 
3383d957683SBarry Smith    Level: beginner
3393d957683SBarry Smith 
3403d957683SBarry Smith .seealso: PCCompositeSetType()
3413d957683SBarry Smith E*/
3423b224e63SBarry Smith typedef enum {PC_COMPOSITE_ADDITIVE,PC_COMPOSITE_MULTIPLICATIVE,PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE,PC_COMPOSITE_SPECIAL,PC_COMPOSITE_SCHUR} PCCompositeType;
3436a6fc655SJed Brown PETSC_EXTERN const char *const PCCompositeTypes[];
3449dcbbd2bSBarry Smith 
345014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCCompositeSetType(PC,PCCompositeType);
346*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCCompositeGetType(PC,PCCompositeType*);
34719fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode PCCompositeAddPC(PC,PCType);
348014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCCompositeGetPC(PC,PetscInt,PC *);
349014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCCompositeSpecialSetAlpha(PC,PetscScalar);
350981c4779SBarry Smith 
351014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCRedundantSetNumber(PC,PetscInt);
352014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCRedundantSetScatter(PC,VecScatter,VecScatter);
353014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCRedundantGetOperators(PC,Mat*,Mat*);
354da3a660dSBarry Smith 
355014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetEpsilon(PC,double);
356014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetNBSteps(PC,PetscInt);
357014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetMax(PC,PetscInt);
358014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetMaxNew(PC,PetscInt);
359014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetBlockSize(PC,PetscInt);
360014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetCacheSize(PC,PetscInt);
361014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetVerbose(PC,PetscInt);
362014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSPAISetSp(PC,PetscInt);
3633304466cSBarry Smith 
364014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCHYPRESetType(PC,const char[]);
365014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCHYPREGetType(PC,const char*[]);
3663304466cSBarry Smith 
367014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitSetFields(PC,const char[],PetscInt,const PetscInt*,const PetscInt*);
368014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitSetType(PC,PCCompositeType);
369*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCFieldSplitGetType(PC,PCCompositeType*);
370014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitSetBlockSize(PC,PetscInt);
371014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitSetIS(PC,const char[],IS);
372014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitGetIS(PC,const char[],IS*);
3734ab8060aSDmitry Karpeev PETSC_EXTERN PetscErrorCode PCFieldSplitSetDMSplits(PC,PetscBool);
3744ab8060aSDmitry Karpeev PETSC_EXTERN PetscErrorCode PCFieldSplitGetDMSplits(PC,PetscBool*);
375c84da90fSDmitry Karpeev PETSC_EXTERN PetscErrorCode PCFieldSplitSetDiagUseAmat(PC,PetscBool);
376c84da90fSDmitry Karpeev PETSC_EXTERN PetscErrorCode PCFieldSplitGetDiagUseAmat(PC,PetscBool*);
377c84da90fSDmitry Karpeev PETSC_EXTERN PetscErrorCode PCFieldSplitSetOffDiagUseAmat(PC,PetscBool);
378c84da90fSDmitry Karpeev PETSC_EXTERN PetscErrorCode PCFieldSplitGetOffDiagUseAmat(PC,PetscBool*);
379c84da90fSDmitry Karpeev 
380084e4875SJed Brown 
381084e4875SJed Brown /*E
382084e4875SJed Brown     PCFieldSplitSchurPreType - Determines how to precondition Schur complement
383084e4875SJed Brown 
384084e4875SJed Brown     Level: intermediate
385084e4875SJed Brown 
38629f8a81cSJed Brown .seealso: PCFieldSplitSetSchurPre()
387084e4875SJed Brown E*/
3882e71c61dSMatthew G. Knepley typedef enum {PC_FIELDSPLIT_SCHUR_PRE_SELF,PC_FIELDSPLIT_SCHUR_PRE_SELFP,PC_FIELDSPLIT_SCHUR_PRE_A11,PC_FIELDSPLIT_SCHUR_PRE_USER,PC_FIELDSPLIT_SCHUR_PRE_FULL} PCFieldSplitSchurPreType;
389014dd563SJed Brown PETSC_EXTERN const char *const PCFieldSplitSchurPreTypes[];
390084e4875SJed Brown 
391ab1df9f5SJed Brown /*E
392c9c6ffaaSJed Brown     PCFieldSplitSchurFactType - determines which off-diagonal parts of the approximate block factorization to use
393ab1df9f5SJed Brown 
394ab1df9f5SJed Brown     Level: intermediate
395ab1df9f5SJed Brown 
396c9c6ffaaSJed Brown .seealso: PCFieldSplitSetSchurFactType()
397ab1df9f5SJed Brown E*/
398ab1df9f5SJed Brown typedef enum {
399c9c6ffaaSJed Brown   PC_FIELDSPLIT_SCHUR_FACT_DIAG,
400c9c6ffaaSJed Brown   PC_FIELDSPLIT_SCHUR_FACT_LOWER,
401c9c6ffaaSJed Brown   PC_FIELDSPLIT_SCHUR_FACT_UPPER,
402c9c6ffaaSJed Brown   PC_FIELDSPLIT_SCHUR_FACT_FULL
403c9c6ffaaSJed Brown } PCFieldSplitSchurFactType;
404014dd563SJed Brown PETSC_EXTERN const char *const PCFieldSplitSchurFactTypes[];
405ab1df9f5SJed Brown 
40629f8a81cSJed Brown PETSC_EXTERN PETSC_DEPRECATED("Use PCFieldSplitSetSchurPre") PetscErrorCode PCFieldSplitSchurPrecondition(PC,PCFieldSplitSchurPreType,Mat);
40729f8a81cSJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitSetSchurPre(PC,PCFieldSplitSchurPreType,Mat);
40837a82bf0SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitGetSchurPre(PC,PCFieldSplitSchurPreType*,Mat*);
409014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitSetSchurFactType(PC,PCFieldSplitSchurFactType);
410014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCFieldSplitGetSchurBlocks(PC,Mat*,Mat*,Mat*,Mat*);
411470b340bSDmitry Karpeev PETSC_EXTERN PetscErrorCode PCFieldSplitSchurGetS(PC,Mat *S);
412470b340bSDmitry Karpeev PETSC_EXTERN PetscErrorCode PCFieldSplitSchurRestoreS(PC,Mat *S);
4133d30b1ffSBarry Smith 
414014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGalerkinSetRestriction(PC,Mat);
415014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGalerkinSetInterpolation(PC,Mat);
4162a6744ebSBarry Smith 
417014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetCoordinates(PC,PetscInt,PetscInt,PetscReal*);
4182102ba4dSSatish Balay 
419014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCPythonSetType(PC,const char[]);
42067fac13cSBarry Smith 
421014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetDM(PC,DM);
422014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGetDM(PC,DM*);
4236c699258SBarry Smith 
424014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCSetApplicationContext(PC,void*);
425014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGetApplicationContext(PC,void*);
4261b2093e4SBarry Smith 
427014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBiCGStabCUSPSetTolerance(PC,PetscReal);
428014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBiCGStabCUSPSetIterations(PC,PetscInt);
429014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBiCGStabCUSPSetUseVerboseMonitor(PC,PetscBool);
4306c699258SBarry Smith 
431014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCAINVCUSPSetDropTolerance(PC,PetscReal);
432014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCAINVCUSPUseScaling(PC,PetscBool);
433014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCAINVCUSPSetNonzeros(PC,PetscInt);
434014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCAINVCUSPSetLinParameter(PC,PetscInt);
43537f80224SJose E. Roman /*E
43637f80224SJose E. Roman     PCPARMSGlobalType - Determines the global preconditioner method in PARMS
43737f80224SJose E. Roman 
43837f80224SJose E. Roman     Level: intermediate
43937f80224SJose E. Roman 
44037f80224SJose E. Roman .seealso: PCPARMSSetGlobal()
44137f80224SJose E. Roman E*/
44237f80224SJose E. Roman typedef enum {PC_PARMS_GLOBAL_RAS,PC_PARMS_GLOBAL_SCHUR,PC_PARMS_GLOBAL_BJ} PCPARMSGlobalType;
4436a6fc655SJed Brown PETSC_EXTERN const char *const PCPARMSGlobalTypes[];
44437f80224SJose E. Roman /*E
44537f80224SJose E. Roman     PCPARMSLocalType - Determines the local preconditioner method in PARMS
44637f80224SJose E. Roman 
44737f80224SJose E. Roman     Level: intermediate
44837f80224SJose E. Roman 
44937f80224SJose E. Roman .seealso: PCPARMSSetLocal()
45037f80224SJose E. Roman E*/
45137f80224SJose E. Roman typedef enum {PC_PARMS_LOCAL_ILU0,PC_PARMS_LOCAL_ILUK,PC_PARMS_LOCAL_ILUT,PC_PARMS_LOCAL_ARMS} PCPARMSLocalType;
4526a6fc655SJed Brown PETSC_EXTERN const char *const PCPARMSLocalTypes[];
45337f80224SJose E. Roman 
454baa89ecbSBarry Smith PETSC_EXTERN PetscErrorCode PCPARMSSetGlobal(PC,PCPARMSGlobalType);
455baa89ecbSBarry Smith PETSC_EXTERN PetscErrorCode PCPARMSSetLocal(PC,PCPARMSLocalType);
456baa89ecbSBarry Smith PETSC_EXTERN PetscErrorCode PCPARMSSetSolveTolerances(PC,PetscReal,PetscInt);
457baa89ecbSBarry Smith PETSC_EXTERN PetscErrorCode PCPARMSSetSolveRestart(PC,PetscInt);
458baa89ecbSBarry Smith PETSC_EXTERN PetscErrorCode PCPARMSSetNonsymPerm(PC,PetscBool);
459baa89ecbSBarry Smith PETSC_EXTERN PetscErrorCode PCPARMSSetFill(PC,PetscInt,PetscInt,PetscInt);
46037f80224SJose E. Roman 
4615154939eSJed Brown /*E
4625154939eSJed Brown     PCGAMGType - type of generalized algebraic multigrid (PCGAMG) method
4635154939eSJed Brown 
4645154939eSJed Brown     Level: intermediate
4655154939eSJed Brown 
4665154939eSJed Brown .seealso: PCMG, PCSetType(), PCGAMGSetThreshold(), PCGAMGSetThreshold(), PCGAMGSetReuseProl()
4675154939eSJed Brown E*/
468a782d3a5SMark Adams typedef const char *PCGAMGType;
469a782d3a5SMark Adams #define PCGAMGAGG         "agg"
470a782d3a5SMark Adams #define PCGAMGGEO         "geo"
4718e6d0c30SPeter Brune #define PCGAMGCLASSICAL   "classical"
472*c60c7ad4SBarry Smith 
473*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCGAMGSetType( PC,PCGAMGType);
474*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCGAMGGetType( PC,PCGAMGType*);
475014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetProcEqLim(PC,PetscInt);
476014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetRepartitioning(PC,PetscBool);
477014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetUseASMAggs(PC,PetscBool);
478014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetSolverType(PC,char[],PetscInt);
479014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetThreshold(PC,PetscReal);
480014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetCoarseEqLim(PC,PetscInt);
481014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetNlevels(PC,PetscInt);
482baa89ecbSBarry Smith PETSC_EXTERN PetscErrorCode PCGAMGSetNSmooths(PC,PetscInt);
483baa89ecbSBarry Smith PETSC_EXTERN PetscErrorCode PCGAMGSetSymGraph(PC,PetscBool);
484014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetSquareGraph(PC,PetscBool);
485fc897844SJed Brown PETSC_EXTERN PetscErrorCode PCGAMGSetReuseProl(PC,PetscBool);
4863e3471ccSMark Adams PETSC_EXTERN PetscErrorCode PCGAMGFinalizePackage(void);
4873e3471ccSMark Adams PETSC_EXTERN PetscErrorCode PCGAMGInitializePackage(void);
48856de70efSSatish Balay 
4898eab0cc1SPeter Brune typedef const char *PCGAMGClassicalType;
4908eab0cc1SPeter Brune #define PCGAMGCLASSICALDIRECT   "direct"
4918eab0cc1SPeter Brune #define PCGAMGCLASSICALSTANDARD "standard"
4928eab0cc1SPeter Brune PETSC_EXTERN PetscErrorCode PCGAMGClassicalSetType(PC,PCGAMGClassicalType);
493*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCGAMGClassicalGetType(PC,PCGAMGClassicalType*);
4948eab0cc1SPeter Brune 
4950c7d97c5SJed Brown #if defined(PETSC_HAVE_PCBDDC)
496906d46d4SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCSetChangeOfBasisMat(PC,Mat);
497674ae819SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCSetPrimalVerticesLocalIS(PC,IS);
4984fad6a16SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCSetCoarseningRatio(PC,PetscInt);
4992b510759SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCSetLevels(PC,PetscInt);
5000bdf917eSStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCSetNullSpace(PC,MatNullSpace);
501014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBDDCSetDirichletBoundaries(PC,IS);
50282ba6b80SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCSetDirichletBoundariesLocal(PC,IS);
503014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBDDCGetDirichletBoundaries(PC,IS*);
50482ba6b80SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCGetDirichletBoundariesLocal(PC,IS*);
505014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBDDCSetNeumannBoundaries(PC,IS);
50682ba6b80SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCSetNeumannBoundariesLocal(PC,IS);
507014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBDDCGetNeumannBoundaries(PC,IS*);
50882ba6b80SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCGetNeumannBoundariesLocal(PC,IS*);
509014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCBDDCSetDofsSplitting(PC,PetscInt,IS[]);
51063602bcaSStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCSetDofsSplittingLocal(PC,PetscInt,IS[]);
5111a83f524SJed Brown PETSC_EXTERN PetscErrorCode PCBDDCSetLocalAdjacencyGraph(PC,PetscInt,const PetscInt[],const PetscInt[],PetscCopyMode);
5123425bc38SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCCreateFETIDPOperators(PC,Mat*,PC*);
5133425bc38SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCMatFETIDPGetRHS(Mat,Vec,Vec);
5143425bc38SStefano Zampini PETSC_EXTERN PetscErrorCode PCBDDCMatFETIDPGetSolution(Mat,Vec,Vec);
5150c7d97c5SJed Brown #endif
5160c7d97c5SJed Brown 
517b965d45eSStefano Zampini PETSC_EXTERN PetscErrorCode PCISSetUseStiffnessScaling(PC,PetscBool);
518014dd563SJed Brown PETSC_EXTERN PetscErrorCode PCISSetSubdomainScalingFactor(PC,PetscScalar);
51946caae47SJed Brown PETSC_EXTERN PetscErrorCode PCISSetSubdomainDiagonalScaling(PC,Vec);
520d3b1e0e7SMatthew Knepley 
521b4876bcbSBarry Smith /*E
522b4876bcbSBarry Smith     PCMGType - Determines the type of multigrid method that is run.
523b4876bcbSBarry Smith 
524b4876bcbSBarry Smith    Level: beginner
525b4876bcbSBarry Smith 
526b4876bcbSBarry Smith    Values:
527b4876bcbSBarry Smith +  PC_MG_MULTIPLICATIVE (default) - traditional V or W cycle as determined by PCMGSetCycles()
528b4876bcbSBarry Smith .  PC_MG_ADDITIVE - the additive multigrid preconditioner where all levels are
529b4876bcbSBarry Smith                 smoothed before updating the residual. This only uses the
530b4876bcbSBarry Smith                 down smoother, in the preconditioner the upper smoother is ignored
531b4876bcbSBarry Smith .  PC_MG_FULL - same as multiplicative except one also performs grid sequencing,
532b4876bcbSBarry Smith             that is starts on the coarsest grid, performs a cycle, interpolates
533b4876bcbSBarry 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
534b4876bcbSBarry Smith             algorithm supports smoothing on before the restriction on each level in the initial restriction to the coarsest stage. In addition that algorithm
535b4876bcbSBarry Smith             calls the V-cycle only on the coarser level and has a post-smoother instead.
536b4876bcbSBarry Smith -  PC_MG_KASKADE - like full multigrid except one never goes back to a coarser level
537b4876bcbSBarry Smith                from a finer
538b4876bcbSBarry Smith 
539b4876bcbSBarry Smith .seealso: PCMGSetType()
540b4876bcbSBarry Smith 
541b4876bcbSBarry Smith E*/
542b4876bcbSBarry Smith typedef enum { PC_MG_MULTIPLICATIVE,PC_MG_ADDITIVE,PC_MG_FULL,PC_MG_KASKADE } PCMGType;
543b4876bcbSBarry Smith PETSC_EXTERN const char *const PCMGTypes[];
544b4876bcbSBarry Smith #define PC_MG_CASCADE PC_MG_KASKADE;
545b4876bcbSBarry Smith 
546b4876bcbSBarry Smith /*E
547b4876bcbSBarry Smith     PCMGCycleType - Use V-cycle or W-cycle
548b4876bcbSBarry Smith 
549b4876bcbSBarry Smith    Level: beginner
550b4876bcbSBarry Smith 
551b4876bcbSBarry Smith    Values:
552b4876bcbSBarry Smith +  PC_MG_V_CYCLE
553b4876bcbSBarry Smith -  PC_MG_W_CYCLE
554b4876bcbSBarry Smith 
555b4876bcbSBarry Smith .seealso: PCMGSetCycleType()
556b4876bcbSBarry Smith 
557b4876bcbSBarry Smith E*/
558b4876bcbSBarry Smith typedef enum { PC_MG_CYCLE_V = 1,PC_MG_CYCLE_W = 2 } PCMGCycleType;
559b4876bcbSBarry Smith PETSC_EXTERN const char *const PCMGCycleTypes[];
560b4876bcbSBarry Smith 
561b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetType(PC,PCMGType);
562*c60c7ad4SBarry Smith PETSC_EXTERN PetscErrorCode PCMGGetType(PC,PCMGType*);
563b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetLevels(PC,PetscInt,MPI_Comm*);
564b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGGetLevels(PC,PetscInt*);
565b4876bcbSBarry Smith 
566b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetNumberSmoothUp(PC,PetscInt);
567b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetNumberSmoothDown(PC,PetscInt);
568b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetCycleType(PC,PCMGCycleType);
569b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetCycleTypeOnLevel(PC,PetscInt,PCMGCycleType);
570b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetCyclesOnLevel(PC,PetscInt,PetscInt);
571b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGMultiplicativeSetCycles(PC,PetscInt);
572b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetGalerkin(PC,PetscBool);
573b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGGetGalerkin(PC,PetscBool*);
574b4876bcbSBarry Smith 
575b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetRhs(PC,PetscInt,Vec);
576b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetX(PC,PetscInt,Vec);
577b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetR(PC,PetscInt,Vec);
578b4876bcbSBarry Smith 
579b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetRestriction(PC,PetscInt,Mat);
580b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGGetRestriction(PC,PetscInt,Mat*);
581b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetInterpolation(PC,PetscInt,Mat);
582b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGGetInterpolation(PC,PetscInt,Mat*);
583b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetRScale(PC,PetscInt,Vec);
584b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGGetRScale(PC,PetscInt,Vec*);
585b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCMGSetResidual(PC,PetscInt,PetscErrorCode (*)(Mat,Vec,Vec,Vec),Mat);
58654b2cd4bSJed Brown PETSC_EXTERN PetscErrorCode PCMGResidualDefault(Mat,Vec,Vec,Vec);
587b4876bcbSBarry Smith 
588b4876bcbSBarry Smith /*E
589b4876bcbSBarry Smith     PCExoticType - Face based or wirebasket based coarse grid space
590b4876bcbSBarry Smith 
591b4876bcbSBarry Smith    Level: beginner
592b4876bcbSBarry Smith 
593b4876bcbSBarry Smith .seealso: PCExoticSetType(), PCEXOTIC
594b4876bcbSBarry Smith E*/
595b4876bcbSBarry Smith typedef enum { PC_EXOTIC_FACE,PC_EXOTIC_WIREBASKET } PCExoticType;
596b4876bcbSBarry Smith PETSC_EXTERN const char *const PCExoticTypes[];
597b4876bcbSBarry Smith PETSC_EXTERN PetscErrorCode PCExoticSetType(PC,PCExoticType);
598b4876bcbSBarry Smith 
599123ea438SMatthew Knepley #endif /* __PETSCPC_H */
600