<html><head><base href="x-msg://334/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jul 8, 2010, at 10:18 AM, Daniel L Crumly wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Thank you for the&nbsp; quick reply - I actually do want the action of the factored matrix (or preconditioner) on a vector.&nbsp; Is there a recommended workaround?</span></div></div></div></span></blockquote><div><br></div>&nbsp;&nbsp; If A =approx L*U then applying the preconditioner involves triangular solves of L and U and use MatSolve() to do this. If you want to actually apply L*U we don't have code for this, as Matt mentioned. But note that right, left or split (symmetric) preconditioning do not need the application of L or U only the triangular solves.</div><div><br></div><div>&nbsp;&nbsp; If you want to form the product L*U to see how "far" from A it is we don't have code for that, you could write a new routine that directly access the data structure and does the product for you, but since it is not needed for traditional linear solvers we don't provide such a thing.</div><div><br></div><div>&nbsp;&nbsp; Barry</div><div><br></div><div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p>&nbsp;</o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Thanks<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p>&nbsp;</o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Daniel "The Plaid Mentat" Crumly<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><a href="mailto:Daniel.Crumly@colorado.edu" style="color: blue; text-decoration: underline; ">Daniel.Crumly@colorado.edu</a><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">--------<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">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.<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">--Book of Diatribes from the Hayt Chronicle<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">----Herbert, Frank. Children of Dune 28.<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p>&nbsp;</o:p></span></div><div style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-width: initial; border-color: initial; border-left-style: solid; border-left-color: blue; border-left-width: 1.5pt; padding-top: 0in; padding-right: 0in; padding-bottom: 0in; padding-left: 4pt; "><div><div style="border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-top-style: solid; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding-top: 3pt; padding-right: 0in; padding-bottom: 0in; padding-left: 0in; "><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; ">From:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; "><span class="Apple-converted-space">&nbsp;</span><a href="mailto:petsc-users-bounces@mcs.anl.gov" style="color: blue; text-decoration: underline; ">petsc-users-bounces@mcs.anl.gov</a><span class="Apple-converted-space">&nbsp;</span>[mailto:petsc-users-bounces@mcs.anl.gov]<span class="Apple-converted-space">&nbsp;</span><b>On Behalf Of<span class="Apple-converted-space">&nbsp;</span></b>Matthew Knepley<br><b>Sent:</b><span class="Apple-converted-space">&nbsp;</span>Thursday, July 08, 2010 11:10 AM<br><b>To:</b><span class="Apple-converted-space">&nbsp;</span>PETSc users list<br><b>Subject:</b><span class="Apple-converted-space">&nbsp;</span>Re: [petsc-users] MatMult with factored matrix<o:p></o:p></span></div></div></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p>&nbsp;</o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">On Thu, Jul 8, 2010 at 7:06 PM, Daniel L Crumly &lt;<a href="mailto:daniel.crumly@colorado.edu" style="color: blue; text-decoration: underline; ">daniel.crumly@colorado.edu</a>&gt; wrote:<o:p></o:p></div><div><blockquote style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-width: initial; border-color: initial; border-left-style: solid; border-left-color: rgb(204, 204, 204); border-left-width: 1pt; padding-top: 0in; padding-right: 0in; padding-bottom: 0in; padding-left: 6pt; margin-left: 4.8pt; margin-right: 0in; "><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">Hello all -<br><br>Is there a recommended way to multiply a factored matrix by a vector<br>(effectively MatMult where the matrix is a factored matrix or<br>preconditioner)? &nbsp;Specifically, I would like to get take the ILU<br>factorization of a matrix, then multiply a vector by this approximation.<o:p></o:p></div></blockquote><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p>&nbsp;</o:p></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">Do you actually want the action, or the action of the inverse? We only provide<o:p></o:p></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">the action of the inverse<o:p></o:p></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p>&nbsp;</o:p></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSolve.html" style="color: blue; text-decoration: underline; ">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSolve.html</a><o:p></o:p></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p>&nbsp;</o:p></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">&nbsp;&nbsp; &nbsp;Matt<o:p></o:p></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">&nbsp;<o:p></o:p></div></div><blockquote style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-width: initial; border-color: initial; border-left-style: solid; border-left-color: rgb(204, 204, 204); border-left-width: 1pt; padding-top: 0in; padding-right: 0in; padding-bottom: 0in; padding-left: 6pt; margin-left: 4.8pt; margin-right: 0in; "><p class="MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 12pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">What I currently have is:<br><br>&nbsp;ierr = PCGetType(pc, &amp;pctype);CHKERRQ(ierr);<br>&nbsp;if (strcmp(pctype, PCILU) == 0 || strcmp(pctype, PCICC) == 0) {<br>&nbsp; &nbsp;ierr = PCFactorGetMatrix(pc, &amp;M);CHKERRQ(ierr);<br>&nbsp; &nbsp;ierr = MatMult(M, x, Mx);CHKERRQ(ierr);<br>&nbsp;}<br><br>which throws the runtime error (I'm currently using PETSc 3.0.0-p8.):<br><br>[0]PETSC ERROR: --------------------- Error Message<br>------------------------------------<br>[0]PETSC ERROR: Object is in wrong state!<br>[0]PETSC ERROR: Not for factored matrix!<br>[0]PETSC ERROR:<br>------------------------------------------------------------------------<br><br>Any suggestions are greatly appreciated, thank you.<br><br>Daniel "The Plaid Mentat" Crumly<br><a href="mailto:Daniel.Crumly@colorado.edu" style="color: blue; text-decoration: underline; ">Daniel.Crumly@colorado.edu</a><br>--------<br>I give you the desert chameleon, whose ability to blend itself into the<br>background tells you all you need to know about the roots of ecology and the<br>foundations of a personal identity.<br>--Book of Diatribes from the Hayt Chronicle<br>----Herbert, Frank. Children of Dune 28.<br><br><o:p></o:p></p></blockquote></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><br><br clear="all"><br>--<span class="Apple-converted-space">&nbsp;</span><br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<o:p></o:p></div></div></div></div></span></blockquote></div><br></body></html>