xref: /petsc/src/ksp/pc/impls/none/none.c (revision 7b6e20038cd7a330335af7f4640b5599e59f035f)
1dba47a55SKris Buschelman 
24b9ad928SBarry Smith /*
34b9ad928SBarry Smith     Identity preconditioner, simply copies vector x to y.
44b9ad928SBarry Smith */
5af0996ceSBarry Smith #include <petsc/private/pcimpl.h>          /*I "petscpc.h" I*/
64b9ad928SBarry Smith 
7dfbe8321SBarry Smith PetscErrorCode PCApply_None(PC pc,Vec x,Vec y)
84b9ad928SBarry Smith {
9dfbe8321SBarry Smith   PetscErrorCode ierr;
104b9ad928SBarry Smith 
114b9ad928SBarry Smith   PetscFunctionBegin;
124b9ad928SBarry Smith   ierr = VecCopy(x,y);CHKERRQ(ierr);
134b9ad928SBarry Smith   PetscFunctionReturn(0);
144b9ad928SBarry Smith }
154b9ad928SBarry Smith 
16*7b6e2003SPierre Jolivet PetscErrorCode PCMatApply_None(PC pc,Mat X,Mat Y)
17*7b6e2003SPierre Jolivet {
18*7b6e2003SPierre Jolivet   PetscErrorCode ierr;
19*7b6e2003SPierre Jolivet 
20*7b6e2003SPierre Jolivet   PetscFunctionBegin;
21*7b6e2003SPierre Jolivet   ierr = MatCopy(X,Y,SAME_NONZERO_PATTERN);CHKERRQ(ierr);
22*7b6e2003SPierre Jolivet   PetscFunctionReturn(0);
23*7b6e2003SPierre Jolivet }
24*7b6e2003SPierre Jolivet 
254b9ad928SBarry Smith /*MC
264b9ad928SBarry Smith      PCNONE - This is used when you wish to employ a nonpreconditioned
274b9ad928SBarry Smith              Krylov method.
284b9ad928SBarry Smith 
294b9ad928SBarry Smith    Level: beginner
304b9ad928SBarry Smith 
3195452b02SPatrick Sanan   Notes:
3295452b02SPatrick Sanan     This is implemented by a VecCopy()
334b9ad928SBarry Smith 
344b9ad928SBarry Smith .seealso:  PCCreate(), PCSetType(), PCType (for list of available types), PC
354b9ad928SBarry Smith M*/
364b9ad928SBarry Smith 
378cc058d9SJed Brown PETSC_EXTERN PetscErrorCode PCCreate_None(PC pc)
384b9ad928SBarry Smith {
394b9ad928SBarry Smith   PetscFunctionBegin;
404b9ad928SBarry Smith   pc->ops->apply               = PCApply_None;
41*7b6e2003SPierre Jolivet   pc->ops->matapply            = PCMatApply_None;
424b9ad928SBarry Smith   pc->ops->applytranspose      = PCApply_None;
430a545947SLisandro Dalcin   pc->ops->destroy             = NULL;
440a545947SLisandro Dalcin   pc->ops->setup               = NULL;
450a545947SLisandro Dalcin   pc->ops->view                = NULL;
464b9ad928SBarry Smith   pc->ops->applysymmetricleft  = PCApply_None;
474b9ad928SBarry Smith   pc->ops->applysymmetricright = PCApply_None;
484b9ad928SBarry Smith 
490a545947SLisandro Dalcin   pc->data = NULL;
504b9ad928SBarry Smith   PetscFunctionReturn(0);
514b9ad928SBarry Smith }
52