Actual source code: pcmat.c
1: /*$Id: jacobi.c,v 1.75 2001/08/07 03:03:32 balay Exp $*/
3: #include src/sles/pc/pcimpl.h
5: #undef __FUNCT__
7: static int PCApply_Mat(PC pc,Vec x,Vec y)
8: {
9: int ierr;
12: MatMult(pc->pmat,x,y);
13: return(0);
14: }
16: #undef __FUNCT__
18: static int PCApplyTranspose_Mat(PC pc,Vec x,Vec y)
19: {
20: int ierr;
23: MatMultTranspose(pc->pmat,x,y);
24: return(0);
25: }
27: #undef __FUNCT__
29: static int PCDestroy_Mat(PC pc)
30: {
32: return(0);
33: }
35: /*MC
36: PCMAT - A preconditioner obtained by multiplying by the preconditioner matrix supplied
37: in PCSetOperators() or SLESSetOperators()
39: Notes: This one is a little strange. One rarely has an explict matrix that approximates the
40: inverse of the matrix they wish to solve for.
42: Level: intermediate
44: .seealso: PCCreate(), PCSetType(), PCType (for list of available types), PC,
45: PCSHELL
47: M*/
49: EXTERN_C_BEGIN
50: #undef __FUNCT__
52: int PCCreate_Mat(PC pc)
53: {
55: pc->ops->apply = PCApply_Mat;
56: pc->ops->applytranspose = PCApplyTranspose_Mat;
57: pc->ops->setup = 0;
58: pc->ops->destroy = PCDestroy_Mat;
59: pc->ops->setfromoptions = 0;
60: pc->ops->view = 0;
61: pc->ops->applyrichardson = 0;
62: pc->ops->applysymmetricleft = 0;
63: pc->ops->applysymmetricright = 0;
64: return(0);
65: }
66: EXTERN_C_END