Actual source code: pcmat.c
petsc-3.7.1 2016-05-15
Report Typos and Errors

      2: #include <petsc/private/pcimpl.h>   /*I "petscpc.h" I*/

      6: static PetscErrorCode PCApply_Mat(PC pc,Vec x,Vec y)
      7: {

     11:   MatMult(pc->pmat,x,y);
     12:   return(0);
     13: }

     17: static PetscErrorCode PCApplyTranspose_Mat(PC pc,Vec x,Vec y)
     18: {

     22:   MatMultTranspose(pc->pmat,x,y);
     23:   return(0);
     24: }

     28: static PetscErrorCode PCDestroy_Mat(PC pc)
     29: {
     31:   return(0);
     32: }

     34: /*MC
     35:      PCMAT - A preconditioner obtained by multiplying by the preconditioner matrix supplied
     36:              in PCSetOperators() or KSPSetOperators()

     38:    Notes:  This one is a little strange. One rarely has an explict matrix that approximates the
     39:          inverse of the matrix they wish to solve for.

     41:    Level: intermediate

     43: .seealso:  PCCreate(), PCSetType(), PCType (for list of available types), PC,
     44:            PCSHELL

     46: M*/

     50: PETSC_EXTERN PetscErrorCode PCCreate_Mat(PC pc)
     51: {
     53:   pc->ops->apply               = PCApply_Mat;
     54:   pc->ops->applytranspose      = PCApplyTranspose_Mat;
     55:   pc->ops->setup               = 0;
     56:   pc->ops->destroy             = PCDestroy_Mat;
     57:   pc->ops->setfromoptions      = 0;
     58:   pc->ops->view                = 0;
     59:   pc->ops->applyrichardson     = 0;
     60:   pc->ops->applysymmetricleft  = 0;
     61:   pc->ops->applysymmetricright = 0;
     62:   return(0);
     63: }