Date: 2022-08-02T03:14:32+00:00

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: {
      9:   VecCopy(x,y);
     10:   return 0;
     11: }

     13: PetscErrorCode PCMatApply_None(PC pc,Mat X,Mat Y)
     14: {
     15:   MatCopy(X,Y,SAME_NONZERO_PATTERN);
     16:   return 0;
     17: }

     19: /*MC
     20:      PCNONE - This is used when you wish to employ a nonpreconditioned
     21:              Krylov method.

     23:    Level: beginner

     25:   Notes:
     26:     This is implemented by a VecCopy()

     28: .seealso:  PCCreate(), PCSetType(), PCType (for list of available types), PC
     29: M*/

     31: PETSC_EXTERN PetscErrorCode PCCreate_None(PC pc)
     32: {
     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;

     42:   pc->data = NULL;
     43:   return 0;
     44: }