<div class="gmail_extra">On Mon, Apr 23, 2012 at 9:28 AM, Dominik Szczerba <span dir="ltr"><<a href="mailto:dominik@itis.ethz.ch" target="_blank">dominik@itis.ethz.ch</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">
On Mon, Apr 23, 2012 at 3:13 PM, Jed Brown <<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>> wrote:<br>
> On Mon, Apr 23, 2012 at 08:11, Dominik Szczerba <<a href="mailto:dominik@itis.ethz.ch">dominik@itis.ethz.ch</a>><br>
> wrote:<br>
>><br>
>> What is 'func' on the SNESSetPicard manual page. It only says<br>
>> "function evaluation routine". What function? Do you mean Ax-b?<br>
><br>
><br>
> Just b(x)<br>
><br>
>><br>
>><br>
>> > All SNESSetPicard does is evaluate both A and b in "residual<br>
>> > evaluation",<br>
>> > compute F(x) = A(x)x - b(x), and internally cache the matrix A(x). Using<br>
>> > it<br>
>> > is completely optional. If you are willing to write residual evaluation<br>
>> > for<br>
>> > the whole F(x), then you will benefit from having less expensive<br>
>> > residual<br>
>> > evaluations, making line searches and matrix-free Newton<br>
>> > (-snes_mf_operator)<br>
>> > affordable.<br>
>><br>
>> I understood from the documentation sec. 5.1 and 5.6 that<br>
>> -snes_mf_operator is not well suited for unstructured problems, rather<br>
>> for structured problems with known stencil. Is it not so?<br>
><br>
><br>
> You must be thinking of coloring.<br>
<br>
5.1.2: "This causes PETSc to approximate the Jacobian using finite<br>
differencing of the function evaluation (discussed in section 5.6),"<br>
5.1.6: "PETSc provides some tools to help approximate the Jacobian<br>
matrices efficiently via finite differences. (...) The approximation<br>
requires several steps: (...) Determining the structure<br>
is problem dependent, but fortunately, for most structured grid<br>
problems (the class of problems for which<br>
111PETSc is designed) if one knows the stencil used for the nonlinear<br>
function one can usually fairly easily<br>
obtain an estimate of the location of nonzeros in the matrix. This is<br>
harder in the unstructured case, and has<br>
not yet been implemented in general."<br></blockquote><div><br></div><div>-snes_mf uses FD to approximate the ACTION of the operator. The above</div><div>quotes are talking about using FD to approximate the operator itself.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am dealing with unstructured problems. Will I still be able to<br>
benefit from -snes_mf_operator and will it approximate the Jacobian<br>
correctly/efficiently in such cases?</blockquote><div><br></div><div>-snes_mf_operator allows the user to specify a preconditioner, which is</div><div>usually necessary for good convergence.</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"><span class="HOEnZb"><font color="#888888"><br>
Dominik<br>
</font></span></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>
</div>