On Wed, Dec 14, 2011 at 7:34 PM, Philip, Bobby <span dir="ltr"><<a href="mailto:philipb@ornl.gov">philipb@ornl.gov</a>></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;font-family:"Calibri","sans-serif";color:#1f497d">Matt:<u></u><u></u></span></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:petsc-dev-bounces@mcs.anl.gov" target="_blank">petsc-dev-bounces@mcs.anl.gov</a> [mailto:<a href="mailto:petsc-dev-bounces@mcs.anl.gov" target="_blank">petsc-dev-bounces@mcs.anl.gov</a>] <b>On Behalf Of </b>Matthew Knepley<br>
<b>Sent:</b> Wednesday, December 14, 2011 5:15 PM<br><b>To:</b> For users of the development version of PETSc<br><b>Subject:</b> Re: [petsc-dev] controlling vector values while doing matrix free operations<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">On Wed, Dec 14, 2011 at 4:07 PM, Philip, Bobby <<a href="mailto:philipb@ornl.gov" target="_blank">philipb@ornl.gov</a>> wrote:<u></u><u></u></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">Hi:<br><br>When doing the following operation in PETSc using FD approximations to a  Jacobian vector product<br><br>J'(u)*a = [J(u+h*a) - J(u)]/h<u></u><u></u></p></blockquote><div><p class="MsoNormal">
<u></u> <u></u></p></div><div><p class="MsoNormal">Usually, we would put in F where you have J.<u></u><u></u></p></div><div><p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Actually this is taken from PETSc documentation so you may want to modify it. I normally do use F also.</span></p>
</div></div></div></div></blockquote><div><br></div><div>This uses F (<a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatCreateMFFD.html#MatCreateMFFD">http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatCreateMFFD.html#MatCreateMFFD</a>), where are you looking?</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><div><div><p class="MsoNormal"> </p><p class="MsoNormal">
<u></u></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">is there a way for the user to specify that the entries of u+h*a cannot be negative for example?<br>
Browsing the PETSc documentation it was not obvious whether I could do this.<u></u><u></u></p></blockquote><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">You can do whatever you want in your F function, but you should really investigate SNESVI if<u></u><u></u></p>
</div><div><p class="MsoNormal">you have bounds on your variables.<u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I do indeed control F and u but I do not control h*a. This is determined by PETSc. Hence the possibility<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">exists that u+h*a is outside the domain of the function. This is what I would like to control. Being able to<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">check whether u+h*a lies in the domain of the function and then potentially modifying it so it does much <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">in the flavor of the LineSearchPost and PreCheck functions. Any suggestions?</span></p></div></div></div>
</div></blockquote><div><br></div><div>If all you want to do is project to the positive orthant, you can do that when computing F. If you want</div><div>to maintain the convergence rate of the method, you would need something like SNESVI.</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><div><div><p class="MsoNormal">
  Thanks,<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">     Matt<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></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">Thanks,<br>Bobby<span class="HOEnZb"><font color="#888888"><u></u><u></u></font></span></p></blockquote></div><span class="HOEnZb"><font color="#888888"><p class="MsoNormal"><br><br clear="all"><u></u><u></u></p>
<div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal">-- <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<u></u><u></u></p></font></span></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <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>