Actual source code: none.c
2: /*
3: Identity preconditioner, simply copies vector x to y.
4: */
5: #include <petsc/private/pcimpl.h>
7: PetscErrorCode PCApply_None(PC pc,Vec x,Vec y)
8: {
12: VecCopy(x,y);
13: return(0);
14: }
16: PetscErrorCode PCMatApply_None(PC pc,Mat X,Mat Y)
17: {
21: MatCopy(X,Y,SAME_NONZERO_PATTERN);
22: return(0);
23: }
25: /*MC
26: PCNONE - This is used when you wish to employ a nonpreconditioned
27: Krylov method.
29: Level: beginner
31: Notes:
32: This is implemented by a VecCopy()
34: .seealso: PCCreate(), PCSetType(), PCType (for list of available types), PC
35: M*/
37: PETSC_EXTERN PetscErrorCode PCCreate_None(PC pc)
38: {
40: pc->ops->apply = PCApply_None;
41: pc->ops->matapply = PCMatApply_None;
42: pc->ops->applytranspose = PCApply_None;
43: pc->ops->destroy = NULL;
44: pc->ops->setup = NULL;
45: pc->ops->view = NULL;
46: pc->ops->applysymmetricleft = PCApply_None;
47: pc->ops->applysymmetricright = PCApply_None;
49: pc->data = NULL;
50: return(0);
51: }