Actual source code: petscpc.h

  1: /*
  2:       Preconditioner module.
  3: */
  4: #pragma once

  6: #include <petscmat.h>
  7: #include <petscdmtypes.h>
  8: #include <petscpctypes.h>

 10: /* SUBMANSEC = PC */

 12: PETSC_EXTERN PetscErrorCode PCInitializePackage(void);
 13: PETSC_EXTERN PetscErrorCode PCFinalizePackage(void);

 15: /*
 16:     PCList contains the list of preconditioners currently registered
 17:    These are added with PCRegister()
 18: */
 19: PETSC_EXTERN PetscFunctionList PCList;

 21: /* Logging support */
 22: PETSC_EXTERN PetscClassId PC_CLASSID;

 24: /* Arrays of names for options in implementation PCs */
 25: PETSC_EXTERN const char *const *const PCSides;
 26: PETSC_EXTERN const char *const        PCJacobiTypes[];
 27: PETSC_EXTERN const char *const        PCASMTypes[];
 28: PETSC_EXTERN const char *const        PCGASMTypes[];
 29: PETSC_EXTERN const char *const        PCCompositeTypes[];
 30: PETSC_EXTERN const char *const        PCFieldSplitSchurPreTypes[];
 31: PETSC_EXTERN const char *const        PCFieldSplitSchurFactTypes[];
 32: PETSC_EXTERN const char *const        PCPARMSGlobalTypes[];
 33: PETSC_EXTERN const char *const        PCPARMSLocalTypes[];
 34: PETSC_EXTERN const char *const        PCMGTypes[];
 35: PETSC_EXTERN const char *const        PCMGCycleTypes[];
 36: PETSC_EXTERN const char *const        PCMGGalerkinTypes[];
 37: PETSC_EXTERN const char *const        PCMGCoarseSpaceTypes[];
 38: PETSC_EXTERN const char *const        PCExoticTypes[];
 39: PETSC_EXTERN const char *const        PCPatchConstructTypes[];
 40: PETSC_EXTERN const char *const        PCDeflationTypes[];
 41: PETSC_EXTERN const char *const *const PCFailedReasons;

 43: PETSC_EXTERN PetscErrorCode PCCreate(MPI_Comm, PC *);
 44: PETSC_EXTERN PetscErrorCode PCSetType(PC, PCType);
 45: PETSC_EXTERN PetscErrorCode PCGetType(PC, PCType *);
 46: PETSC_EXTERN PetscErrorCode PCSetUp(PC);

 48: PETSC_EXTERN PetscErrorCode PCSetKSPNestLevel(PC, PetscInt);
 49: PETSC_EXTERN PetscErrorCode PCGetKSPNestLevel(PC, PetscInt *);

 51: PETSC_EXTERN PetscErrorCode PCSetFailedReason(PC, PCFailedReason);
 52: PETSC_EXTERN PetscErrorCode PCGetFailedReason(PC, PCFailedReason *);
 53: PETSC_DEPRECATED_FUNCTION(3, 11, 0, "PCGetFailedReason()", ) static inline PetscErrorCode PCGetSetUpFailedReason(PC pc, PCFailedReason *reason)
 54: {
 55:   return PCGetFailedReason(pc, reason);
 56: }
 57: PETSC_EXTERN PetscErrorCode PCReduceFailedReason(PC);

 59: PETSC_EXTERN PetscErrorCode PCSetUpOnBlocks(PC);
 60: PETSC_EXTERN PetscErrorCode PCApply(PC, Vec, Vec);
 61: PETSC_EXTERN PetscErrorCode PCMatApply(PC, Mat, Mat);
 62: PETSC_EXTERN PetscErrorCode PCApplySymmetricLeft(PC, Vec, Vec);
 63: PETSC_EXTERN PetscErrorCode PCApplySymmetricRight(PC, Vec, Vec);
 64: PETSC_EXTERN PetscErrorCode PCApplyBAorAB(PC, PCSide, Vec, Vec, Vec);
 65: PETSC_EXTERN PetscErrorCode PCApplyTranspose(PC, Vec, Vec);
 66: PETSC_EXTERN PetscErrorCode PCApplyTransposeExists(PC, PetscBool *);
 67: PETSC_EXTERN PetscErrorCode PCApplyBAorABTranspose(PC, PCSide, Vec, Vec, Vec);
 68: PETSC_EXTERN PetscErrorCode PCSetReusePreconditioner(PC, PetscBool);
 69: PETSC_EXTERN PetscErrorCode PCGetReusePreconditioner(PC, PetscBool *);
 70: PETSC_EXTERN PetscErrorCode PCSetErrorIfFailure(PC, PetscBool);

 72: #define PC_FILE_CLASSID 1211222

 74: PETSC_EXTERN PetscErrorCode PCApplyRichardson(PC, Vec, Vec, Vec, PetscReal, PetscReal, PetscReal, PetscInt, PetscBool, PetscInt *, PCRichardsonConvergedReason *);
 75: PETSC_EXTERN PetscErrorCode PCApplyRichardsonExists(PC, PetscBool *);
 76: PETSC_EXTERN PetscErrorCode PCSetUseAmat(PC, PetscBool);
 77: PETSC_EXTERN PetscErrorCode PCGetUseAmat(PC, PetscBool *);

 79: PETSC_EXTERN PetscErrorCode PCRegister(const char[], PetscErrorCode (*)(PC));

 81: PETSC_EXTERN PetscErrorCode PCReset(PC);
 82: PETSC_EXTERN PetscErrorCode PCDestroy(PC *);
 83: PETSC_EXTERN PetscErrorCode PCSetFromOptions(PC);

 85: PETSC_EXTERN PetscErrorCode PCFactorGetMatrix(PC, Mat *);
 86: PETSC_EXTERN PetscErrorCode PCSetModifySubMatrices(PC, PetscErrorCode (*)(PC, PetscInt, const IS[], const IS[], Mat[], void *), void *);
 87: PETSC_EXTERN PetscErrorCode PCModifySubMatrices(PC, PetscInt, const IS[], const IS[], Mat[], void *);

 89: PETSC_EXTERN PetscErrorCode PCSetOperators(PC, Mat, Mat);
 90: PETSC_EXTERN PetscErrorCode PCGetOperators(PC, Mat *, Mat *);
 91: PETSC_EXTERN PetscErrorCode PCGetOperatorsSet(PC, PetscBool *, PetscBool *);

 93: PETSC_EXTERN PetscErrorCode PCView(PC, PetscViewer);
 94: PETSC_EXTERN PetscErrorCode PCLoad(PC, PetscViewer);
 95: PETSC_EXTERN PetscErrorCode PCViewFromOptions(PC, PetscObject, const char[]);

 97: PETSC_EXTERN PetscErrorCode PCSetOptionsPrefix(PC, const char[]);
 98: PETSC_EXTERN PetscErrorCode PCAppendOptionsPrefix(PC, const char[]);
 99: PETSC_EXTERN PetscErrorCode PCGetOptionsPrefix(PC, const char *[]);

101: PETSC_EXTERN PetscErrorCode PCComputeOperator(PC, MatType, Mat *);
102: PETSC_DEPRECATED_FUNCTION(3, 12, 0, "PCComputeOperator()", ) static inline PetscErrorCode PCComputeExplicitOperator(PC A, Mat *B)
103: {
104:   return PCComputeOperator(A, PETSC_NULLPTR, B);
105: }

107: /*
108:       These are used to provide extra scaling of preconditioned
109:    operator for time-stepping schemes like in SUNDIALS
110: */
111: PETSC_EXTERN PetscErrorCode PCGetDiagonalScale(PC, PetscBool *);
112: PETSC_EXTERN PetscErrorCode PCDiagonalScaleLeft(PC, Vec, Vec);
113: PETSC_EXTERN PetscErrorCode PCDiagonalScaleRight(PC, Vec, Vec);
114: PETSC_EXTERN PetscErrorCode PCSetDiagonalScale(PC, Vec);

116: PETSC_EXTERN PetscErrorCode PCSetDM(PC, DM);
117: PETSC_EXTERN PetscErrorCode PCGetDM(PC, DM *);

119: PETSC_EXTERN PetscErrorCode PCGetInterpolations(PC, PetscInt *, Mat *[]);
120: PETSC_EXTERN PetscErrorCode PCGetCoarseOperators(PC pc, PetscInt *, Mat *[]);

122: PETSC_EXTERN PetscErrorCode PCSetCoordinates(PC, PetscInt, PetscInt, PetscReal[]);

124: PETSC_EXTERN PetscErrorCode PCSetApplicationContext(PC, void *);
125: PETSC_EXTERN PetscErrorCode PCGetApplicationContext(PC, void *);

127: /* ------------- options specific to particular preconditioners --------- */

129: PETSC_EXTERN PetscErrorCode PCJacobiSetType(PC, PCJacobiType);
130: PETSC_EXTERN PetscErrorCode PCJacobiGetType(PC, PCJacobiType *);
131: PETSC_EXTERN PetscErrorCode PCJacobiSetUseAbs(PC, PetscBool);
132: PETSC_EXTERN PetscErrorCode PCJacobiGetUseAbs(PC, PetscBool *);
133: PETSC_EXTERN PetscErrorCode PCJacobiSetFixDiagonal(PC, PetscBool);
134: PETSC_EXTERN PetscErrorCode PCJacobiGetFixDiagonal(PC, PetscBool *);
135: PETSC_EXTERN PetscErrorCode PCJacobiGetDiagonal(PC pc, Vec, Vec);
136: PETSC_EXTERN PetscErrorCode PCJacobiSetRowl1Scale(PC, PetscReal);
137: PETSC_EXTERN PetscErrorCode PCJacobiGetRowl1Scale(PC, PetscReal *);
138: PETSC_EXTERN PetscErrorCode PCSORSetSymmetric(PC, MatSORType);
139: PETSC_EXTERN PetscErrorCode PCSORGetSymmetric(PC, MatSORType *);
140: PETSC_EXTERN PetscErrorCode PCSORSetOmega(PC, PetscReal);
141: PETSC_EXTERN PetscErrorCode PCSORGetOmega(PC, PetscReal *);
142: PETSC_EXTERN PetscErrorCode PCSORSetIterations(PC, PetscInt, PetscInt);
143: PETSC_EXTERN PetscErrorCode PCSORGetIterations(PC, PetscInt *, PetscInt *);

145: PETSC_EXTERN PetscErrorCode PCEisenstatSetOmega(PC, PetscReal);
146: PETSC_EXTERN PetscErrorCode PCEisenstatGetOmega(PC, PetscReal *);
147: PETSC_EXTERN PetscErrorCode PCEisenstatSetNoDiagonalScaling(PC, PetscBool);
148: PETSC_EXTERN PetscErrorCode PCEisenstatGetNoDiagonalScaling(PC, PetscBool *);

150: PETSC_EXTERN PetscErrorCode PCBJacobiSetTotalBlocks(PC, PetscInt, const PetscInt[]);
151: PETSC_EXTERN PetscErrorCode PCBJacobiGetTotalBlocks(PC, PetscInt *, const PetscInt *[]);
152: PETSC_EXTERN PetscErrorCode PCBJacobiSetLocalBlocks(PC, PetscInt, const PetscInt[]);
153: PETSC_EXTERN PetscErrorCode PCBJacobiGetLocalBlocks(PC, PetscInt *, const PetscInt *[]);

155: PETSC_EXTERN PetscErrorCode PCShellSetApply(PC, PetscErrorCode (*)(PC, Vec, Vec));
156: PETSC_EXTERN PetscErrorCode PCShellSetMatApply(PC, PetscErrorCode (*)(PC, Mat, Mat));
157: PETSC_EXTERN PetscErrorCode PCShellSetApplySymmetricLeft(PC, PetscErrorCode (*)(PC, Vec, Vec));
158: PETSC_EXTERN PetscErrorCode PCShellSetApplySymmetricRight(PC, PetscErrorCode (*)(PC, Vec, Vec));
159: PETSC_EXTERN PetscErrorCode PCShellSetApplyBA(PC, PetscErrorCode (*)(PC, PCSide, Vec, Vec, Vec));
160: PETSC_EXTERN PetscErrorCode PCShellSetApplyTranspose(PC, PetscErrorCode (*)(PC, Vec, Vec));
161: PETSC_EXTERN PetscErrorCode PCShellSetSetUp(PC, PetscErrorCode (*)(PC));
162: PETSC_EXTERN PetscErrorCode PCShellSetApplyRichardson(PC, PetscErrorCode (*)(PC, Vec, Vec, Vec, PetscReal, PetscReal, PetscReal, PetscInt, PetscBool, PetscInt *, PCRichardsonConvergedReason *));
163: PETSC_EXTERN PetscErrorCode PCShellSetView(PC, PetscErrorCode (*)(PC, PetscViewer));
164: PETSC_EXTERN PetscErrorCode PCShellSetDestroy(PC, PetscErrorCode (*)(PC));
165: PETSC_EXTERN PetscErrorCode PCShellSetContext(PC, void *);
166: PETSC_EXTERN PetscErrorCode PCShellGetContext(PC, void *);
167: PETSC_EXTERN PetscErrorCode PCShellSetName(PC, const char[]);
168: PETSC_EXTERN PetscErrorCode PCShellGetName(PC, const char *[]);

170: PETSC_EXTERN PetscErrorCode PCFactorSetZeroPivot(PC, PetscReal);

172: PETSC_EXTERN PetscErrorCode PCFactorSetShiftType(PC, MatFactorShiftType);
173: PETSC_EXTERN PetscErrorCode PCFactorSetShiftAmount(PC, PetscReal);

175: PETSC_EXTERN PetscErrorCode PCFactorSetMatSolverType(PC, MatSolverType);
176: PETSC_EXTERN PetscErrorCode PCFactorGetMatSolverType(PC, MatSolverType *);
177: PETSC_EXTERN PetscErrorCode PCFactorSetUpMatSolverType(PC);
178: PETSC_DEPRECATED_FUNCTION(3, 9, 0, "PCFactorSetMatSolverType()", ) static inline PetscErrorCode PCFactorSetMatSolverPackage(PC pc, MatSolverType stype)
179: {
180:   return PCFactorSetMatSolverType(pc, stype);
181: }
182: PETSC_DEPRECATED_FUNCTION(3, 9, 0, "PCFactorGetMatSolverType()", ) static inline PetscErrorCode PCFactorGetMatSolverPackage(PC pc, MatSolverType *stype)
183: {
184:   return PCFactorGetMatSolverType(pc, stype);
185: }
186: PETSC_DEPRECATED_FUNCTION(3, 9, 0, "PCFactorSetUpMatSolverType()", ) static inline PetscErrorCode PCFactorSetUpMatSolverPackage(PC pc)
187: {
188:   return PCFactorSetUpMatSolverType(pc);
189: }

191: PETSC_EXTERN PetscErrorCode PCFactorSetFill(PC, PetscReal);
192: PETSC_EXTERN PetscErrorCode PCFactorSetColumnPivot(PC, PetscReal);
193: PETSC_EXTERN PetscErrorCode PCFactorReorderForNonzeroDiagonal(PC, PetscReal);

195: PETSC_EXTERN PetscErrorCode PCFactorSetMatOrderingType(PC, MatOrderingType);
196: PETSC_EXTERN PetscErrorCode PCFactorSetReuseOrdering(PC, PetscBool);
197: PETSC_EXTERN PetscErrorCode PCFactorSetReuseFill(PC, PetscBool);
198: PETSC_EXTERN PetscErrorCode PCFactorSetUseInPlace(PC, PetscBool);
199: PETSC_EXTERN PetscErrorCode PCFactorGetUseInPlace(PC, PetscBool *);
200: PETSC_EXTERN PetscErrorCode PCFactorSetAllowDiagonalFill(PC, PetscBool);
201: PETSC_EXTERN PetscErrorCode PCFactorGetAllowDiagonalFill(PC, PetscBool *);
202: PETSC_EXTERN PetscErrorCode PCFactorSetPivotInBlocks(PC, PetscBool);

204: PETSC_EXTERN PetscErrorCode PCFactorSetLevels(PC, PetscInt);
205: PETSC_EXTERN PetscErrorCode PCFactorGetLevels(PC, PetscInt *);
206: PETSC_EXTERN PetscErrorCode PCFactorSetDropTolerance(PC, PetscReal, PetscReal, PetscInt);
207: PETSC_EXTERN PetscErrorCode PCFactorGetZeroPivot(PC, PetscReal *);
208: PETSC_EXTERN PetscErrorCode PCFactorGetShiftAmount(PC, PetscReal *);
209: PETSC_EXTERN PetscErrorCode PCFactorGetShiftType(PC, MatFactorShiftType *);

211: PETSC_EXTERN PetscErrorCode PCASMSetLocalSubdomains(PC, PetscInt, IS[], IS[]);
212: PETSC_EXTERN PetscErrorCode PCASMSetTotalSubdomains(PC, PetscInt, IS[], IS[]);
213: PETSC_EXTERN PetscErrorCode PCASMSetOverlap(PC, PetscInt);
214: PETSC_EXTERN PetscErrorCode PCASMSetDMSubdomains(PC, PetscBool);
215: PETSC_EXTERN PetscErrorCode PCASMGetDMSubdomains(PC, PetscBool *);
216: PETSC_EXTERN PetscErrorCode PCASMSetSortIndices(PC, PetscBool);

218: PETSC_EXTERN PetscErrorCode PCASMSetType(PC, PCASMType);
219: PETSC_EXTERN PetscErrorCode PCASMGetType(PC, PCASMType *);
220: PETSC_EXTERN PetscErrorCode PCASMSetLocalType(PC, PCCompositeType);
221: PETSC_EXTERN PetscErrorCode PCASMGetLocalType(PC, PCCompositeType *);
222: PETSC_EXTERN PetscErrorCode PCASMCreateSubdomains(Mat, PetscInt, IS *[]);
223: PETSC_EXTERN PetscErrorCode PCASMDestroySubdomains(PetscInt, IS[], IS[]);
224: PETSC_EXTERN PetscErrorCode PCASMCreateSubdomains2D(PetscInt, PetscInt, PetscInt, PetscInt, PetscInt, PetscInt, PetscInt *, IS **, IS **);
225: PETSC_EXTERN PetscErrorCode PCASMGetLocalSubdomains(PC, PetscInt *, IS *[], IS *[]);
226: PETSC_EXTERN PetscErrorCode PCASMGetLocalSubmatrices(PC, PetscInt *, Mat *[]);
227: PETSC_EXTERN PetscErrorCode PCASMGetSubMatType(PC, MatType *);
228: PETSC_EXTERN PetscErrorCode PCASMSetSubMatType(PC, MatType);

230: PETSC_EXTERN PetscErrorCode PCGASMSetTotalSubdomains(PC, PetscInt);
231: PETSC_EXTERN PetscErrorCode PCGASMSetSubdomains(PC, PetscInt, IS[], IS[]);
232: PETSC_EXTERN PetscErrorCode PCGASMSetOverlap(PC, PetscInt);
233: PETSC_EXTERN PetscErrorCode PCGASMSetUseDMSubdomains(PC, PetscBool);
234: PETSC_EXTERN PetscErrorCode PCGASMGetUseDMSubdomains(PC, PetscBool *);
235: PETSC_EXTERN PetscErrorCode PCGASMSetSortIndices(PC, PetscBool);

237: PETSC_EXTERN PetscErrorCode PCGASMSetType(PC, PCGASMType);
238: PETSC_EXTERN PetscErrorCode PCGASMCreateSubdomains(Mat, PetscInt, PetscInt *, IS *[]);
239: PETSC_EXTERN PetscErrorCode PCGASMDestroySubdomains(PetscInt, IS *[], IS *[]);
240: PETSC_EXTERN PetscErrorCode PCGASMCreateSubdomains2D(PC, PetscInt, PetscInt, PetscInt, PetscInt, PetscInt, PetscInt, PetscInt *, IS **, IS **);
241: PETSC_EXTERN PetscErrorCode PCGASMGetSubdomains(PC, PetscInt *, IS *[], IS *[]);
242: PETSC_EXTERN PetscErrorCode PCGASMGetSubmatrices(PC, PetscInt *, Mat *[]);

244: PETSC_EXTERN PetscErrorCode PCCompositeSetType(PC, PCCompositeType);
245: PETSC_EXTERN PetscErrorCode PCCompositeGetType(PC, PCCompositeType *);
246: PETSC_EXTERN PetscErrorCode PCCompositeAddPCType(PC, PCType);
247: PETSC_EXTERN PetscErrorCode PCCompositeAddPC(PC, PC);
248: PETSC_EXTERN PetscErrorCode PCCompositeGetNumberPC(PC, PetscInt *);
249: PETSC_EXTERN PetscErrorCode PCCompositeGetPC(PC, PetscInt, PC *);
250: PETSC_EXTERN PetscErrorCode PCCompositeSpecialSetAlpha(PC, PetscScalar);
251: PETSC_EXTERN PetscErrorCode PCCompositeSpecialSetAlphaMat(PC, Mat);

253: PETSC_EXTERN PetscErrorCode PCRedundantSetNumber(PC, PetscInt);
254: PETSC_EXTERN PetscErrorCode PCRedundantSetScatter(PC, VecScatter, VecScatter);
255: PETSC_EXTERN PetscErrorCode PCRedundantGetOperators(PC, Mat *, Mat *);

257: PETSC_EXTERN PetscErrorCode PCSPAISetEpsilon(PC, PetscReal);
258: PETSC_EXTERN PetscErrorCode PCSPAISetNBSteps(PC, PetscInt);
259: PETSC_EXTERN PetscErrorCode PCSPAISetMax(PC, PetscInt);
260: PETSC_EXTERN PetscErrorCode PCSPAISetMaxNew(PC, PetscInt);
261: PETSC_EXTERN PetscErrorCode PCSPAISetBlockSize(PC, PetscInt);
262: PETSC_EXTERN PetscErrorCode PCSPAISetCacheSize(PC, PetscInt);
263: PETSC_EXTERN PetscErrorCode PCSPAISetVerbose(PC, PetscInt);
264: PETSC_EXTERN PetscErrorCode PCSPAISetSp(PC, PetscInt);

266: PETSC_EXTERN PetscErrorCode PCHYPRESetType(PC, const char[]);
267: PETSC_EXTERN PetscErrorCode PCHYPREGetType(PC, const char *[]);
268: PETSC_EXTERN PetscErrorCode PCHYPRESetDiscreteGradient(PC, Mat);
269: PETSC_EXTERN PetscErrorCode PCHYPRESetDiscreteCurl(PC, Mat);
270: PETSC_EXTERN PetscErrorCode PCHYPRESetInterpolations(PC, PetscInt, Mat, Mat[], Mat, Mat[]);
271: PETSC_EXTERN PetscErrorCode PCHYPRESetEdgeConstantVectors(PC, Vec, Vec, Vec);
272: PETSC_EXTERN PetscErrorCode PCHYPREAMSSetInteriorNodes(PC, Vec);
273: PETSC_EXTERN PetscErrorCode PCHYPRESetAlphaPoissonMatrix(PC, Mat);
274: PETSC_EXTERN PetscErrorCode PCHYPRESetBetaPoissonMatrix(PC, Mat);

276: PETSC_EXTERN PetscErrorCode PCFieldSplitSetFields(PC, const char[], PetscInt, const PetscInt *, const PetscInt *);
277: PETSC_EXTERN PetscErrorCode PCFieldSplitSetType(PC, PCCompositeType);
278: PETSC_EXTERN PetscErrorCode PCFieldSplitGetType(PC, PCCompositeType *);
279: PETSC_EXTERN PetscErrorCode PCFieldSplitSetBlockSize(PC, PetscInt);
280: PETSC_EXTERN PetscErrorCode PCFieldSplitSetIS(PC, const char[], IS);
281: PETSC_EXTERN PetscErrorCode PCFieldSplitGetIS(PC, const char[], IS *);
282: PETSC_EXTERN PetscErrorCode PCFieldSplitGetISByIndex(PC, PetscInt, IS *);
283: PETSC_EXTERN PetscErrorCode PCFieldSplitRestrictIS(PC, IS);
284: PETSC_EXTERN PetscErrorCode PCFieldSplitSetDMSplits(PC, PetscBool);
285: PETSC_EXTERN PetscErrorCode PCFieldSplitGetDMSplits(PC, PetscBool *);
286: PETSC_EXTERN PetscErrorCode PCFieldSplitSetDiagUseAmat(PC, PetscBool);
287: PETSC_EXTERN PetscErrorCode PCFieldSplitGetDiagUseAmat(PC, PetscBool *);
288: PETSC_EXTERN PetscErrorCode PCFieldSplitSetOffDiagUseAmat(PC, PetscBool);
289: PETSC_EXTERN PetscErrorCode PCFieldSplitGetOffDiagUseAmat(PC, PetscBool *);

291: PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 5, 0, "PCFieldSplitSetSchurPre()", ) PetscErrorCode PCFieldSplitSchurPrecondition(PC, PCFieldSplitSchurPreType, Mat);
292: PETSC_EXTERN PetscErrorCode PCFieldSplitSetSchurPre(PC, PCFieldSplitSchurPreType, Mat);
293: PETSC_EXTERN PetscErrorCode PCFieldSplitGetSchurPre(PC, PCFieldSplitSchurPreType *, Mat *);
294: PETSC_EXTERN PetscErrorCode PCFieldSplitSetSchurFactType(PC, PCFieldSplitSchurFactType);
295: PETSC_EXTERN PetscErrorCode PCFieldSplitSetSchurScale(PC, PetscScalar);
296: PETSC_EXTERN PetscErrorCode PCFieldSplitGetSchurBlocks(PC, Mat *, Mat *, Mat *, Mat *);
297: PETSC_EXTERN PetscErrorCode PCFieldSplitSchurGetS(PC, Mat *S);
298: PETSC_EXTERN PetscErrorCode PCFieldSplitSchurRestoreS(PC, Mat *S);
299: PETSC_EXTERN PetscErrorCode PCFieldSplitGetDetectSaddlePoint(PC, PetscBool *);
300: PETSC_EXTERN PetscErrorCode PCFieldSplitSetDetectSaddlePoint(PC, PetscBool);
301: PETSC_EXTERN PetscErrorCode PCFieldSplitSetGKBTol(PC, PetscReal);
302: PETSC_EXTERN PetscErrorCode PCFieldSplitSetGKBNu(PC, PetscReal);
303: PETSC_EXTERN PetscErrorCode PCFieldSplitSetGKBMaxit(PC, PetscInt);
304: PETSC_EXTERN PetscErrorCode PCFieldSplitSetGKBDelay(PC, PetscInt);

306: PETSC_EXTERN PetscErrorCode PCGalerkinSetRestriction(PC, Mat);
307: PETSC_EXTERN PetscErrorCode PCGalerkinSetInterpolation(PC, Mat);
308: PETSC_EXTERN PetscErrorCode PCGalerkinSetComputeSubmatrix(PC, PetscErrorCode (*)(PC, Mat, Mat, Mat *, void *), void *);

310: PETSC_EXTERN PetscErrorCode PCPythonSetType(PC, const char[]);
311: PETSC_EXTERN PetscErrorCode PCPythonGetType(PC, const char *[]);

313: PETSC_EXTERN PetscErrorCode PCPARMSSetGlobal(PC, PCPARMSGlobalType);
314: PETSC_EXTERN PetscErrorCode PCPARMSSetLocal(PC, PCPARMSLocalType);
315: PETSC_EXTERN PetscErrorCode PCPARMSSetSolveTolerances(PC, PetscReal, PetscInt);
316: PETSC_EXTERN PetscErrorCode PCPARMSSetSolveRestart(PC, PetscInt);
317: PETSC_EXTERN PetscErrorCode PCPARMSSetNonsymPerm(PC, PetscBool);
318: PETSC_EXTERN PetscErrorCode PCPARMSSetFill(PC, PetscInt, PetscInt, PetscInt);

320: PETSC_EXTERN PetscErrorCode PCGAMGSetType(PC, PCGAMGType);
321: PETSC_EXTERN PetscErrorCode PCGAMGGetType(PC, PCGAMGType *);
322: PETSC_EXTERN PetscErrorCode PCGAMGSetProcEqLim(PC, PetscInt);

324: PETSC_EXTERN PetscErrorCode PCGAMGSetRepartition(PC, PetscBool);
325: PETSC_EXTERN PetscErrorCode PCGAMGSetUseSAEstEig(PC, PetscBool);
326: PETSC_EXTERN PetscErrorCode PCGAMGSetRecomputeEstEig(PC, PetscBool);
327: PETSC_EXTERN PetscErrorCode PCGAMGSetEigenvalues(PC, PetscReal, PetscReal);
328: PETSC_EXTERN PetscErrorCode PCGAMGASMSetUseAggs(PC, PetscBool);
329: PETSC_EXTERN PetscErrorCode PCGAMGSetParallelCoarseGridSolve(PC, PetscBool);
330: PETSC_EXTERN PetscErrorCode PCGAMGSetCpuPinCoarseGrids(PC, PetscBool);
331: PETSC_EXTERN PetscErrorCode PCGAMGSetCoarseGridLayoutType(PC, PCGAMGLayoutType);
332: PETSC_EXTERN PetscErrorCode PCGAMGSetThreshold(PC, PetscReal[], PetscInt);
333: PETSC_EXTERN PetscErrorCode PCGAMGSetRankReductionFactors(PC, PetscInt[], PetscInt);
334: PETSC_EXTERN PetscErrorCode PCGAMGSetThresholdScale(PC, PetscReal);
335: PETSC_EXTERN PetscErrorCode PCGAMGSetCoarseEqLim(PC, PetscInt);
336: PETSC_EXTERN PetscErrorCode PCGAMGSetNlevels(PC, PetscInt);
337: PETSC_EXTERN PetscErrorCode PCGAMGSetNSmooths(PC, PetscInt);
338: PETSC_EXTERN PetscErrorCode PCGAMGSetAggressiveLevels(PC, PetscInt);
339: PETSC_EXTERN PetscErrorCode PCGAMGSetReuseInterpolation(PC, PetscBool);
340: PETSC_EXTERN PetscErrorCode PCGAMGFinalizePackage(void);
341: PETSC_EXTERN PetscErrorCode PCGAMGInitializePackage(void);
342: PETSC_EXTERN PetscErrorCode PCGAMGRegister(PCGAMGType, PetscErrorCode (*)(PC));
343: PETSC_EXTERN PetscErrorCode PCGAMGCreateGraph(PC, Mat, Mat *);
344: PETSC_EXTERN PetscErrorCode PCGAMGSetAggressiveSquareGraph(PC, PetscBool);
345: PETSC_EXTERN PetscErrorCode PCGAMGMISkSetMinDegreeOrdering(PC, PetscBool);
346: PETSC_EXTERN PetscErrorCode PCGAMGMISkSetAggressive(PC, PetscInt);
347: PETSC_EXTERN PetscErrorCode PCGAMGASMSetHEM(PC, PetscInt);
348: PETSC_EXTERN PetscErrorCode PCGAMGSetLowMemoryFilter(PC, PetscBool);
349: PETSC_EXTERN PetscErrorCode PCGAMGSetGraphSymmetrize(PC, PetscBool);
350: PETSC_EXTERN PetscErrorCode PCGAMGSetInjectionIndex(PC, PetscInt, PetscInt[]);

352: PETSC_EXTERN PetscErrorCode PCGAMGClassicalSetType(PC, PCGAMGClassicalType);
353: PETSC_EXTERN PetscErrorCode PCGAMGClassicalGetType(PC, PCGAMGClassicalType *);

355: PETSC_EXTERN PetscErrorCode PCBDDCSetDiscreteGradient(PC, Mat, PetscInt, PetscInt, PetscBool, PetscBool);
356: PETSC_EXTERN PetscErrorCode PCBDDCSetDivergenceMat(PC, Mat, PetscBool, IS);
357: PETSC_EXTERN PetscErrorCode PCBDDCSetChangeOfBasisMat(PC, Mat, PetscBool);
358: PETSC_EXTERN PetscErrorCode PCBDDCSetPrimalVerticesIS(PC, IS);
359: PETSC_EXTERN PetscErrorCode PCBDDCSetPrimalVerticesLocalIS(PC, IS);
360: PETSC_EXTERN PetscErrorCode PCBDDCGetPrimalVerticesIS(PC, IS *);
361: PETSC_EXTERN PetscErrorCode PCBDDCGetPrimalVerticesLocalIS(PC, IS *);
362: PETSC_EXTERN PetscErrorCode PCBDDCSetCoarseningRatio(PC, PetscInt);
363: PETSC_EXTERN PetscErrorCode PCBDDCSetLevels(PC, PetscInt);
364: PETSC_EXTERN PetscErrorCode PCBDDCSetDirichletBoundaries(PC, IS);
365: PETSC_EXTERN PetscErrorCode PCBDDCSetDirichletBoundariesLocal(PC, IS);
366: PETSC_EXTERN PetscErrorCode PCBDDCGetDirichletBoundaries(PC, IS *);
367: PETSC_EXTERN PetscErrorCode PCBDDCGetDirichletBoundariesLocal(PC, IS *);
368: PETSC_EXTERN PetscErrorCode PCBDDCSetInterfaceExtType(PC, PCBDDCInterfaceExtType);
369: PETSC_EXTERN PetscErrorCode PCBDDCSetNeumannBoundaries(PC, IS);
370: PETSC_EXTERN PetscErrorCode PCBDDCSetNeumannBoundariesLocal(PC, IS);
371: PETSC_EXTERN PetscErrorCode PCBDDCGetNeumannBoundaries(PC, IS *);
372: PETSC_EXTERN PetscErrorCode PCBDDCGetNeumannBoundariesLocal(PC, IS *);
373: PETSC_EXTERN PetscErrorCode PCBDDCSetDofsSplitting(PC, PetscInt, IS[]);
374: PETSC_EXTERN PetscErrorCode PCBDDCSetDofsSplittingLocal(PC, PetscInt, IS[]);
375: PETSC_EXTERN PetscErrorCode PCBDDCSetLocalAdjacencyGraph(PC, PetscInt, const PetscInt[], const PetscInt[], PetscCopyMode);
376: PETSC_EXTERN PetscErrorCode PCBDDCCreateFETIDPOperators(PC, PetscBool, const char *, Mat *, PC *);
377: PETSC_EXTERN PetscErrorCode PCBDDCMatFETIDPGetRHS(Mat, Vec, Vec);
378: PETSC_EXTERN PetscErrorCode PCBDDCMatFETIDPGetSolution(Mat, Vec, Vec);
379: PETSC_EXTERN PetscErrorCode PCBDDCFinalizePackage(void);
380: PETSC_EXTERN PetscErrorCode PCBDDCInitializePackage(void);

382: PETSC_EXTERN PetscErrorCode PCISInitialize(PC);
383: PETSC_EXTERN PetscErrorCode PCISSetUp(PC, PetscBool, PetscBool);
384: PETSC_EXTERN PetscErrorCode PCISSetUseStiffnessScaling(PC, PetscBool);
385: PETSC_EXTERN PetscErrorCode PCISSetSubdomainScalingFactor(PC, PetscScalar);
386: PETSC_EXTERN PetscErrorCode PCISSetSubdomainDiagonalScaling(PC, Vec);
387: PETSC_EXTERN PetscErrorCode PCISScatterArrayNToVecB(PC, PetscScalar *, Vec, InsertMode, ScatterMode);
388: PETSC_EXTERN PetscErrorCode PCISApplySchur(PC, Vec, Vec, Vec, Vec, Vec);
389: PETSC_EXTERN PetscErrorCode PCISApplyInvSchur(PC, Vec, Vec, Vec, Vec);
390: PETSC_EXTERN PetscErrorCode PCISReset(PC);

392: PETSC_EXTERN PetscInt       PetscMGLevelId;
393: PETSC_EXTERN PetscErrorCode PCMGSetType(PC, PCMGType);
394: PETSC_EXTERN PetscErrorCode PCMGGetType(PC, PCMGType *);
395: PETSC_EXTERN PetscErrorCode PCMGSetLevels(PC, PetscInt, MPI_Comm *);
396: PETSC_EXTERN PetscErrorCode PCMGGetLevels(PC, PetscInt *);

398: PETSC_EXTERN PetscErrorCode PCMGSetDistinctSmoothUp(PC);
399: PETSC_EXTERN PetscErrorCode PCMGSetNumberSmooth(PC, PetscInt);
400: PETSC_EXTERN PetscErrorCode PCMGSetCycleType(PC, PCMGCycleType);
401: PETSC_EXTERN PetscErrorCode PCMGSetCycleTypeOnLevel(PC, PetscInt, PCMGCycleType);
402: PETSC_DEPRECATED_FUNCTION(3, 5, 0, "PCMGSetCycleTypeOnLevel()", ) static inline PetscErrorCode PCMGSetCyclesOnLevel(PC pc, PetscInt l, PetscInt t)
403: {
404:   return PCMGSetCycleTypeOnLevel(pc, l, (PCMGCycleType)t);
405: }
406: PETSC_EXTERN PetscErrorCode PCMGMultiplicativeSetCycles(PC, PetscInt);
407: PETSC_EXTERN PetscErrorCode PCMGSetGalerkin(PC, PCMGGalerkinType);
408: PETSC_EXTERN PetscErrorCode PCMGGetGalerkin(PC, PCMGGalerkinType *);
409: PETSC_EXTERN PetscErrorCode PCMGSetAdaptCoarseSpaceType(PC, PCMGCoarseSpaceType);
410: PETSC_EXTERN PetscErrorCode PCMGGetAdaptCoarseSpaceType(PC, PCMGCoarseSpaceType *);
411: PETSC_EXTERN PetscErrorCode PCMGSetAdaptCR(PC, PetscBool);
412: PETSC_EXTERN PetscErrorCode PCMGGetAdaptCR(PC, PetscBool *);
413: /* MATT: Remove? */
414: PETSC_EXTERN PetscErrorCode PCMGSetAdaptInterpolation(PC, PetscBool);
415: PETSC_EXTERN PetscErrorCode PCMGGetAdaptInterpolation(PC, PetscBool *);

417: PETSC_EXTERN PetscErrorCode PCMGSetRhs(PC, PetscInt, Vec);
418: PETSC_EXTERN PetscErrorCode PCMGSetX(PC, PetscInt, Vec);
419: PETSC_EXTERN PetscErrorCode PCMGSetR(PC, PetscInt, Vec);

421: PETSC_EXTERN PetscErrorCode PCMGSetRestriction(PC, PetscInt, Mat);
422: PETSC_EXTERN PetscErrorCode PCMGGetRestriction(PC, PetscInt, Mat *);
423: PETSC_EXTERN PetscErrorCode PCMGSetInjection(PC, PetscInt, Mat);
424: PETSC_EXTERN PetscErrorCode PCMGGetInjection(PC, PetscInt, Mat *);
425: PETSC_EXTERN PetscErrorCode PCMGSetInterpolation(PC, PetscInt, Mat);
426: PETSC_EXTERN PetscErrorCode PCMGSetOperators(PC, PetscInt, Mat, Mat);
427: PETSC_EXTERN PetscErrorCode PCMGGetInterpolation(PC, PetscInt, Mat *);
428: PETSC_EXTERN PetscErrorCode PCMGSetRScale(PC, PetscInt, Vec);
429: PETSC_EXTERN PetscErrorCode PCMGGetRScale(PC, PetscInt, Vec *);
430: PETSC_EXTERN PetscErrorCode PCMGSetResidual(PC, PetscInt, PetscErrorCode (*)(Mat, Vec, Vec, Vec), Mat);
431: PETSC_EXTERN PetscErrorCode PCMGSetResidualTranspose(PC, PetscInt, PetscErrorCode (*)(Mat, Vec, Vec, Vec), Mat);
432: PETSC_EXTERN PetscErrorCode PCMGResidualDefault(Mat, Vec, Vec, Vec);
433: PETSC_EXTERN PetscErrorCode PCMGResidualTransposeDefault(Mat, Vec, Vec, Vec);
434: PETSC_EXTERN PetscErrorCode PCMGMatResidualDefault(Mat, Mat, Mat, Mat);
435: PETSC_EXTERN PetscErrorCode PCMGMatResidualTransposeDefault(Mat, Mat, Mat, Mat);
436: PETSC_EXTERN PetscErrorCode PCMGGalerkinSetMatProductAlgorithm(PC, const char[]);
437: PETSC_EXTERN PetscErrorCode PCMGGalerkinGetMatProductAlgorithm(PC, const char *[]);
438: PETSC_EXTERN PetscErrorCode PCMGGetGridComplexity(PC, PetscReal *, PetscReal *);

440: PETSC_EXTERN PetscErrorCode PCHMGSetReuseInterpolation(PC, PetscBool);
441: PETSC_EXTERN PetscErrorCode PCHMGSetUseSubspaceCoarsening(PC, PetscBool);
442: PETSC_EXTERN PetscErrorCode PCHMGSetInnerPCType(PC, PCType);
443: PETSC_EXTERN PetscErrorCode PCHMGSetCoarseningComponent(PC, PetscInt);
444: PETSC_EXTERN PetscErrorCode PCHMGUseMatMAIJ(PC, PetscBool);

446: PETSC_EXTERN PetscErrorCode PCTelescopeGetSubcommType(PC, PetscSubcommType *);
447: PETSC_EXTERN PetscErrorCode PCTelescopeSetSubcommType(PC, PetscSubcommType);
448: PETSC_EXTERN PetscErrorCode PCTelescopeGetReductionFactor(PC, PetscInt *);
449: PETSC_EXTERN PetscErrorCode PCTelescopeSetReductionFactor(PC, PetscInt);
450: PETSC_EXTERN PetscErrorCode PCTelescopeGetIgnoreDM(PC, PetscBool *);
451: PETSC_EXTERN PetscErrorCode PCTelescopeSetIgnoreDM(PC, PetscBool);
452: PETSC_EXTERN PetscErrorCode PCTelescopeGetUseCoarseDM(PC, PetscBool *);
453: PETSC_EXTERN PetscErrorCode PCTelescopeSetUseCoarseDM(PC, PetscBool);
454: PETSC_EXTERN PetscErrorCode PCTelescopeGetIgnoreKSPComputeOperators(PC, PetscBool *);
455: PETSC_EXTERN PetscErrorCode PCTelescopeSetIgnoreKSPComputeOperators(PC, PetscBool);
456: PETSC_EXTERN PetscErrorCode PCTelescopeGetDM(PC, DM *);

458: PETSC_EXTERN PetscErrorCode PCPatchSetSaveOperators(PC, PetscBool);
459: PETSC_EXTERN PetscErrorCode PCPatchGetSaveOperators(PC, PetscBool *);
460: PETSC_EXTERN PetscErrorCode PCPatchSetPrecomputeElementTensors(PC, PetscBool);
461: PETSC_EXTERN PetscErrorCode PCPatchGetPrecomputeElementTensors(PC, PetscBool *);
462: PETSC_EXTERN PetscErrorCode PCPatchSetPartitionOfUnity(PC, PetscBool);
463: PETSC_EXTERN PetscErrorCode PCPatchGetPartitionOfUnity(PC, PetscBool *);
464: PETSC_EXTERN PetscErrorCode PCPatchSetSubMatType(PC, MatType);
465: PETSC_EXTERN PetscErrorCode PCPatchGetSubMatType(PC, MatType *);
466: PETSC_EXTERN PetscErrorCode PCPatchSetCellNumbering(PC, PetscSection);
467: PETSC_EXTERN PetscErrorCode PCPatchGetCellNumbering(PC, PetscSection *);
468: PETSC_EXTERN PetscErrorCode PCPatchSetConstructType(PC, PCPatchConstructType, PetscErrorCode (*)(PC, PetscInt *, IS **, IS *, void *), void *);
469: PETSC_EXTERN PetscErrorCode PCPatchGetConstructType(PC, PCPatchConstructType *, PetscErrorCode (**)(PC, PetscInt *, IS **, IS *, void *), void **);
470: PETSC_EXTERN PetscErrorCode PCPatchSetDiscretisationInfo(PC, PetscInt, DM *, PetscInt *, PetscInt *, const PetscInt **, const PetscInt *, PetscInt, const PetscInt *, PetscInt, const PetscInt *);
471: PETSC_EXTERN PetscErrorCode PCPatchSetComputeOperator(PC, PetscErrorCode (*)(PC, PetscInt, Vec, Mat, IS, PetscInt, const PetscInt *, const PetscInt *, void *), void *);
472: PETSC_EXTERN PetscErrorCode PCPatchSetComputeFunction(PC pc, PetscErrorCode (*func)(PC, PetscInt, Vec, Vec, IS, PetscInt, const PetscInt *, const PetscInt *, void *), void *ctx);
473: PETSC_EXTERN PetscErrorCode PCPatchSetComputeOperatorInteriorFacets(PC, PetscErrorCode (*)(PC, PetscInt, Vec, Mat, IS, PetscInt, const PetscInt *, const PetscInt *, void *), void *);
474: PETSC_EXTERN PetscErrorCode PCPatchSetComputeFunctionInteriorFacets(PC pc, PetscErrorCode (*func)(PC, PetscInt, Vec, Vec, IS, PetscInt, const PetscInt *, const PetscInt *, void *), void *ctx);

476: PETSC_EXTERN PetscErrorCode PCLMVMSetMatLMVM(PC, Mat);
477: PETSC_EXTERN PetscErrorCode PCLMVMGetMatLMVM(PC, Mat *);
478: PETSC_EXTERN PetscErrorCode PCLMVMSetIS(PC, IS);
479: PETSC_EXTERN PetscErrorCode PCLMVMClearIS(PC);
480: PETSC_EXTERN PetscErrorCode PCLMVMSetUpdateVec(PC, Vec);

482: PETSC_EXTERN PetscErrorCode PCExoticSetType(PC, PCExoticType);

484: PETSC_EXTERN PetscErrorCode PCDeflationSetInitOnly(PC, PetscBool);
485: PETSC_EXTERN PetscErrorCode PCDeflationSetLevels(PC, PetscInt);
486: PETSC_EXTERN PetscErrorCode PCDeflationSetReductionFactor(PC, PetscInt);
487: PETSC_EXTERN PetscErrorCode PCDeflationSetCorrectionFactor(PC, PetscScalar);
488: PETSC_EXTERN PetscErrorCode PCDeflationSetSpaceToCompute(PC, PCDeflationSpaceType, PetscInt);
489: PETSC_EXTERN PetscErrorCode PCDeflationSetSpace(PC, Mat, PetscBool);
490: PETSC_EXTERN PetscErrorCode PCDeflationSetProjectionNullSpaceMat(PC, Mat);
491: PETSC_EXTERN PetscErrorCode PCDeflationSetCoarseMat(PC, Mat);
492: PETSC_EXTERN PetscErrorCode PCDeflationGetPC(PC, PC *);

494: PETSC_EXTERN PetscErrorCode PCHPDDMSetAuxiliaryMat(PC, IS, Mat, PetscErrorCode (*)(Mat, PetscReal, Vec, Vec, PetscReal, IS, void *), void *);
495: PETSC_EXTERN PetscErrorCode PCHPDDMSetRHSMat(PC, Mat);
496: PETSC_EXTERN PetscErrorCode PCHPDDMHasNeumannMat(PC, PetscBool);
497: PETSC_EXTERN PetscErrorCode PCHPDDMSetCoarseCorrectionType(PC, PCHPDDMCoarseCorrectionType);
498: PETSC_EXTERN PetscErrorCode PCHPDDMGetCoarseCorrectionType(PC, PCHPDDMCoarseCorrectionType *);
499: PETSC_EXTERN PetscErrorCode PCHPDDMSetSTShareSubKSP(PC, PetscBool);
500: PETSC_EXTERN PetscErrorCode PCHPDDMGetSTShareSubKSP(PC, PetscBool *);
501: PETSC_EXTERN PetscErrorCode PCHPDDMSetDeflationMat(PC, IS, Mat);
502: PETSC_EXTERN PetscErrorCode PCHPDDMFinalizePackage(void);
503: PETSC_EXTERN PetscErrorCode PCHPDDMInitializePackage(void);
504: PETSC_EXTERN PetscErrorCode PCHPDDMGetComplexities(PC, PetscReal *, PetscReal *);

506: PETSC_EXTERN PetscErrorCode PCAmgXGetResources(PC, void *);

508: PETSC_EXTERN PetscErrorCode PCMatSetApplyOperation(PC, MatOperation);
509: PETSC_EXTERN PetscErrorCode PCMatGetApplyOperation(PC, MatOperation *);