[petsc-users] MatMult with factored matrix

Matthew Knepley knepley at gmail.com
Thu Jul 8 12:09:51 CDT 2010


On Thu, Jul 8, 2010 at 7:06 PM, Daniel L Crumly
<daniel.crumly at colorado.edu>wrote:

> Hello all -
>
> Is there a recommended way to multiply a factored matrix by a vector
> (effectively MatMult where the matrix is a factored matrix or
> preconditioner)?  Specifically, I would like to get take the ILU
> factorization of a matrix, then multiply a vector by this approximation.
>

Do you actually want the action, or the action of the inverse? We only
provide
the action of the inverse

http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSolve.html

    Matt


> What I currently have is:
>
>  ierr = PCGetType(pc, &pctype);CHKERRQ(ierr);
>  if (strcmp(pctype, PCILU) == 0 || strcmp(pctype, PCICC) == 0) {
>    ierr = PCFactorGetMatrix(pc, &M);CHKERRQ(ierr);
>    ierr = MatMult(M, x, Mx);CHKERRQ(ierr);
>  }
>
> which throws the runtime error (I'm currently using PETSc 3.0.0-p8.):
>
> [0]PETSC ERROR: --------------------- Error Message
> ------------------------------------
> [0]PETSC ERROR: Object is in wrong state!
> [0]PETSC ERROR: Not for factored matrix!
> [0]PETSC ERROR:
> ------------------------------------------------------------------------
>
> Any suggestions are greatly appreciated, thank you.
>
> Daniel "The Plaid Mentat" Crumly
> Daniel.Crumly at colorado.edu
> --------
> I give you the desert chameleon, whose ability to blend itself into the
> background tells you all you need to know about the roots of ecology and
> the
> foundations of a personal identity.
> --Book of Diatribes from the Hayt Chronicle
> ----Herbert, Frank. Children of Dune 28.
>
>
>


-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20100708/1b47f969/attachment.htm>


More information about the petsc-users mailing list