1 2 /* 3 Identity preconditioner, simply copies vector x to y. 4 */ 5 #include <petsc/private/pcimpl.h> /*I "petscpc.h" I*/ 6 7 PetscErrorCode PCApply_None(PC pc, Vec x, Vec y) { 8 PetscFunctionBegin; 9 PetscCall(VecCopy(x, y)); 10 PetscFunctionReturn(0); 11 } 12 13 PetscErrorCode PCMatApply_None(PC pc, Mat X, Mat Y) { 14 PetscFunctionBegin; 15 PetscCall(MatCopy(X, Y, SAME_NONZERO_PATTERN)); 16 PetscFunctionReturn(0); 17 } 18 19 /*MC 20 PCNONE - This is used when you wish to employ a nonpreconditioned 21 Krylov method. 22 23 Level: beginner 24 25 Notes: 26 This is implemented by a VecCopy() 27 28 .seealso: `PCCreate()`, `PCSetType()`, `PCType`, `PC` 29 M*/ 30 31 PETSC_EXTERN PetscErrorCode PCCreate_None(PC pc) { 32 PetscFunctionBegin; 33 pc->ops->apply = PCApply_None; 34 pc->ops->matapply = PCMatApply_None; 35 pc->ops->applytranspose = PCApply_None; 36 pc->ops->destroy = NULL; 37 pc->ops->setup = NULL; 38 pc->ops->view = NULL; 39 pc->ops->applysymmetricleft = PCApply_None; 40 pc->ops->applysymmetricright = PCApply_None; 41 42 pc->data = NULL; 43 PetscFunctionReturn(0); 44 } 45