Actual source code: pcmat.c
petsc-3.13.6 2020-09-29
2: #include <petsc/private/pcimpl.h>
4: static PetscErrorCode PCApply_Mat(PC pc,Vec x,Vec y)
5: {
9: MatMult(pc->pmat,x,y);
10: return(0);
11: }
13: static PetscErrorCode PCApplyTranspose_Mat(PC pc,Vec x,Vec y)
14: {
18: MatMultTranspose(pc->pmat,x,y);
19: return(0);
20: }
22: static PetscErrorCode PCDestroy_Mat(PC pc)
23: {
25: return(0);
26: }
28: /*MC
29: PCMAT - A preconditioner obtained by multiplying by the preconditioner matrix supplied
30: in PCSetOperators() or KSPSetOperators()
32: Notes:
33: This one is a little strange. One rarely has an explict matrix that approximates the
34: inverse of the matrix they wish to solve for.
36: Level: intermediate
38: .seealso: PCCreate(), PCSetType(), PCType (for list of available types), PC,
39: PCSHELL
41: M*/
43: PETSC_EXTERN PetscErrorCode PCCreate_Mat(PC pc)
44: {
46: pc->ops->apply = PCApply_Mat;
47: pc->ops->applytranspose = PCApplyTranspose_Mat;
48: pc->ops->setup = 0;
49: pc->ops->destroy = PCDestroy_Mat;
50: pc->ops->setfromoptions = 0;
51: pc->ops->view = 0;
52: pc->ops->applyrichardson = 0;
53: pc->ops->applysymmetricleft = 0;
54: pc->ops->applysymmetricright = 0;
55: return(0);
56: }