Lines Matching full:pc

2     Routines to set PC methods and options.
10 Contains the list of registered PC routines
15 PCSetType - Builds `PC` for a particular preconditioner type
20 + pc - the preconditioner context
24 . -pc_type <type> - Sets `PC` type
28 then set the `PC` type from the options database rather than by using
46 PetscErrorCode PCSetType(PC pc, PCType type) in PCSetType() argument
49 PetscErrorCode (*r)(PC); in PCSetType()
52 PetscValidHeaderSpecific(pc, PC_CLASSID, 1); in PCSetType()
55 PetscCall(PetscObjectTypeCompare((PetscObject)pc, type, &match)); in PCSetType()
59 …PetscCheck(r, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_UNKNOWN_TYPE, "Unable to find reques… in PCSetType()
60 /* Destroy the previous private PC context */ in PCSetType()
61 PetscTryTypeMethod(pc, destroy); in PCSetType()
63 PetscCall(PetscFunctionListDestroy(&((PetscObject)pc)->qlist)); in PCSetType()
65 PetscCall(PetscMemzero(pc->ops, sizeof(struct _PCOps))); in PCSetType()
67 pc->modifysubmatrices = NULL; in PCSetType()
68 pc->modifysubmatricesP = NULL; in PCSetType()
70 pc->setupcalled = PETSC_FALSE; in PCSetType()
72 PetscCall(PetscObjectChangeTypeName((PetscObject)pc, type)); in PCSetType()
73 PetscCall((*r)(pc)); in PCSetType()
78 PCGetType - Gets the `PCType` (as a string) from the `PC`
84 . pc - the preconditioner context
91 .seealso: [](ch_ksp), `PC`, `PCType`, `PCSetType()`
93 PetscErrorCode PCGetType(PC pc, PCType *type) in PCGetType() argument
96 PetscValidHeaderSpecific(pc, PC_CLASSID, 1); in PCGetType()
98 *type = ((PetscObject)pc)->type_name; in PCGetType()
102 PETSC_INTERN PetscErrorCode PCGetDefaultType_Private(PC, const char *[]);
105 PCSetFromOptions - Sets `PC` options from the options database.
110 . pc - the preconditioner context
123 .seealso: [](ch_ksp), `PC`, `PCSetType()`, `PCType`, `KSPSetFromOptions()`
125 PetscErrorCode PCSetFromOptions(PC pc) in PCSetFromOptions() argument
132 PetscValidHeaderSpecific(pc, PC_CLASSID, 1); in PCSetFromOptions()
135 if (!((PetscObject)pc)->type_name) { in PCSetFromOptions()
136 PetscCall(PCGetDefaultType_Private(pc, &def)); in PCSetFromOptions()
138 def = ((PetscObject)pc)->type_name; in PCSetFromOptions()
140 PetscObjectOptionsBegin((PetscObject)pc); in PCSetFromOptions()
144 PetscCall(PCSetType(pc, type)); in PCSetFromOptions()
145 } else if (!((PetscObject)pc)->type_name && def) { in PCSetFromOptions()
146 PetscCall(PCSetType(pc, def)); in PCSetFromOptions()
149 PetscCall(PetscObjectTypeCompare((PetscObject)pc, PCNONE, &flg)); in PCSetFromOptions()
152 …) to define preconditioner in nested inner solves", "PCSetUseAmat", pc->useAmat, &pc->useAmat, NUL… in PCSetFromOptions()
154 PetscTryTypeMethod(pc, setfromoptions, PetscOptionsObject); in PCSetFromOptions()
158 PetscCall(PetscObjectProcessOptionsHandlers((PetscObject)pc, PetscOptionsObject)); in PCSetFromOptions()
160 pc->setfromoptionscalled++; in PCSetFromOptions()
170 + pc - the preconditioner context
182 .seealso: [](ch_ksp), `PC`, `DM`, `PCGetDM()`, `KSPSetDM()`, `KSPGetDM()`, `SNESSetDM()`, `TSSetDM(…
184 PetscErrorCode PCSetDM(PC pc, DM dm) in PCSetDM() argument
187 PetscValidHeaderSpecific(pc, PC_CLASSID, 1); in PCSetDM()
189 PetscCall(DMDestroy(&pc->dm)); in PCSetDM()
190 pc->dm = dm; in PCSetDM()
200 . pc - the preconditioner context
207 .seealso: [](ch_ksp), `PC`, `DM`, `PCSetDM()`, `KSPSetDM()`, `KSPGetDM()`
209 PetscErrorCode PCGetDM(PC pc, DM *dm) in PCGetDM() argument
212 PetscValidHeaderSpecific(pc, PC_CLASSID, 1); in PCGetDM()
213 *dm = pc->dm; in PCGetDM()
223 + pc - the `PC` context
233 .seealso: [](ch_ksp), `PC`, `PCGetApplicationContext()`, `KSPSetApplicationContext()`, `KSPGetAppli…
235 PetscErrorCode PCSetApplicationContext(PC pc, PetscCtx ctx) in PCSetApplicationContext() argument
238 PetscValidHeaderSpecific(pc, PC_CLASSID, 1); in PCSetApplicationContext()
239 pc->ctx = ctx; in PCSetApplicationContext()
249 . pc - `PC` context
262 .seealso: [](ch_ksp), `PC`, `PCSetApplicationContext()`, `KSPSetApplicationContext()`, `KSPGetAppli…
264 PetscErrorCode PCGetApplicationContext(PC pc, PetscCtxRt ctx) in PCGetApplicationContext() argument
267 PetscValidHeaderSpecific(pc, PC_CLASSID, 1); in PCGetApplicationContext()
268 *(void **)ctx = pc->ctx; in PCGetApplicationContext()