On Thu, Jul 8, 2010 at 7:18 PM, Daniel L Crumly <span dir="ltr">&lt;<a href="mailto:daniel.crumly@colorado.edu">daniel.crumly@colorado.edu</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">









<div lang="EN-US" link="blue" vlink="purple">

<div>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">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?</span></p></div></div></blockquote><div><br></div><div>Not really. You would only need this for incomplete facotrization, and neither the serial PETSc version,</div><div>nor any of the 3rd party solvers implement this. Its usually possible to reformulate without it.</div>
<div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span class="Apple-style-span" style="font-size: 15px; color: rgb(31, 73, 125); "> </span></p>


<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Thanks</span></p><div class="im">

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Daniel &quot;The Plaid Mentat&quot; Crumly</span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"><a href="mailto:Daniel.Crumly@colorado.edu" target="_blank">Daniel.Crumly@colorado.edu</a></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">--------</span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">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.</span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">--Book of Diatribes from the Hayt Chronicle</span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">----Herbert, Frank. Children of Dune 28.</span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>

</div><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">

<div>

<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">

<p class="MsoNormal"><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt">
<a href="mailto:petsc-users-bounces@mcs.anl.gov" target="_blank">petsc-users-bounces@mcs.anl.gov</a> [mailto:<a href="mailto:petsc-users-bounces@mcs.anl.gov" target="_blank">petsc-users-bounces@mcs.anl.gov</a>] <b>On
Behalf Of </b>Matthew Knepley<br>
<b>Sent:</b> Thursday, July 08, 2010 11:10 AM<br>
<b>To:</b> PETSc users list<br>
<b>Subject:</b> Re: [petsc-users] MatMult with factored matrix</span></p>

</div>

</div><div><div></div><div class="h5">

<p class="MsoNormal"> </p>

<p class="MsoNormal">On Thu, Jul 8, 2010 at 7:06 PM, Daniel L Crumly &lt;<a href="mailto:daniel.crumly@colorado.edu" target="_blank">daniel.crumly@colorado.edu</a>&gt;
wrote:</p>

<div>

<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">

<p class="MsoNormal">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)?  Specifically, I would like to get take the ILU<br>
factorization of a matrix, then multiply a vector by this approximation.</p>

</blockquote>

<div>

<p class="MsoNormal"> </p>

</div>

<div>

<p class="MsoNormal">Do you actually want the action, or the action of the
inverse? We only provide</p>

</div>

<div>

<p class="MsoNormal">the action of the inverse</p>

</div>

<div>

<p class="MsoNormal"> </p>

</div>

<div>

<p class="MsoNormal"><a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSolve.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSolve.html</a></p>


</div>

<div>

<p class="MsoNormal"> </p>

</div>

<div>

<p class="MsoNormal">    Matt</p>

</div>

<div>

<p class="MsoNormal"> </p>

</div>

<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">

<p class="MsoNormal" style="margin-bottom:12.0pt">What I currently have is:<br>
<br>
 ierr = PCGetType(pc, &amp;pctype);CHKERRQ(ierr);<br>
 if (strcmp(pctype, PCILU) == 0 || strcmp(pctype, PCICC) == 0) {<br>
   ierr = PCFactorGetMatrix(pc, &amp;M);CHKERRQ(ierr);<br>
   ierr = MatMult(M, x, Mx);CHKERRQ(ierr);<br>
 }<br>
<br>
which throws the runtime error (I&#39;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 &quot;The Plaid Mentat&quot; Crumly<br>
<a href="mailto:Daniel.Crumly@colorado.edu" target="_blank">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>
</p>

</blockquote>

</div>

<p class="MsoNormal"><br>
<br clear="all">
<br>
-- <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</p>

</div></div></div>

</div>

</div>


</blockquote></div><br><br clear="all"><br>-- <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<br>