Actual source code: pcmat.c

petsc-3.8.2 2017-11-09
Report Typos and Errors

  2:  #include <petsc/private/pcimpl.h>

  4: static PetscErrorCode PCApply_Mat(PC pc,Vec x,Vec y)
  5: {

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

 13: static PetscErrorCode PCApplyTranspose_Mat(PC pc,Vec x,Vec y)
 14: {

 18:   MatMultTranspose(pc->pmat,x,y);
 19:   return(0);
 20: }

 22: static PetscErrorCode PCDestroy_Mat(PC pc)
 23: {
 25:   return(0);
 26: }

 28: /*MC
 29:      PCMAT - A preconditioner obtained by multiplying by the preconditioner matrix supplied
 30:              in PCSetOperators() or KSPSetOperators()

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

 35:    Level: intermediate

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

 40: M*/

 42: PETSC_EXTERN PetscErrorCode PCCreate_Mat(PC pc)
 43: {
 45:   pc->ops->apply               = PCApply_Mat;
 46:   pc->ops->applytranspose      = PCApplyTranspose_Mat;
 47:   pc->ops->setup               = 0;
 48:   pc->ops->destroy             = PCDestroy_Mat;
 49:   pc->ops->setfromoptions      = 0;
 50:   pc->ops->view                = 0;
 51:   pc->ops->applyrichardson     = 0;
 52:   pc->ops->applysymmetricleft  = 0;
 53:   pc->ops->applysymmetricright = 0;
 54:   return(0);
 55: }