analyze preconditioned operator?

Matthew Knepley knepley at gmail.com
Thu Oct 9 16:36:46 CDT 2008


On Thu, Oct 9, 2008 at 4:32 PM, Matt Funk <mafunk at nmsu.edu> wrote:
> mmhh,
>
> i think i am missing something. Doesn't PCApply() apply the preconditioner to
> a vector? So how would that work (easily) with a matrix?

You do not apply it to the matrix. Here is a skeleton (maybe has mistakes)

void myApply(Mat A, Vec x, Vec y) {
  MatShellGetContext(A, &ctx);
  MatMult(ctx->M, x, ctx->work);
  PCApply(ctx->pc, ctx->work, y);
}

MatShellSetOperation(A, MATOP_MULT, myApply)

  Matt

> matt
>
> On Thursday 09 October 2008, Matthew Knepley wrote:
>> CApply().
-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener




More information about the petsc-users mailing list