Thank you for the quick reply - I actually do want the action of the factored matrix (or preconditioner) on a vector. Is there a recommended workaround?
Thanks 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. From: [email protected] [mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Matthew Knepley Sent: Thursday, July 08, 2010 11:10 AM To: PETSc users list Subject: Re: [petsc-users] MatMult with factored matrix 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/manualpag es/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/11c124e4/attachment.htm>
