<div dir="ltr">Hi Jed,<div><br></div><div>I was searching a topic on preconditioning in the mail list and found this email.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 10, 2012 at 2:55 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Then you aren't using a matrix-free method at all. </blockquote>
<div><br></div><div>In case of using <span style="font-family:Menlo;font-size:11px">SNESDefaultComputeJacobianColor</span> to compute Jacobian matrix and mf_operator command, is this exactly what you are describing ('aren't using a matrix-free method at all')?</div>
<div><br></div><div>The <span style="font-family:Menlo;font-size:11px">SNESDefaultComputeJacobianColor </span>I found in lines 149-155 from</div><div><a href="http://www.mcs.anl.gov/petsc/petsc-2.3.3/src/snes/examples/tutorials/ex5.c.html">http://www.mcs.anl.gov/petsc/petsc-2.3.3/src/snes/examples/tutorials/ex5.c.html</a><br>
</div><div><br></div><div>Best,</div><div><br></div><div>Ling</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Just don't call SNESSetJacobian and it will be done for you. Are you using a DM? If not, you will also need to create a MatFDColoring. The easiest way to do that, if you don't have a structured mesh, is to assemble the nonzero pattern of your operator.<div class="">
<div class="h5"><br>
<br><div class="gmail_quote">On Wed, Oct 10, 2012 at 3:44 PM, <span dir="ltr"><<a href="mailto:panourg@mech.upatras.gr" target="_blank">panourg@mech.upatras.gr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Is exactly the same.<br>
<br>
Kostas<br>
<div><div><br>
<br>
<br>
<br>
<br>
<br>
> On Wed, Oct 10, 2012 at 3:32 PM, <<a href="mailto:panourg@mech.upatras.gr" target="_blank">panourg@mech.upatras.gr</a>> wrote:<br>
><br>
>> Dear all<br>
>><br>
>> I have a non-linear system which i want to solve it with matrix free<br>
>> method. However i must form the whole proconditioning matrix using<br>
>> finite<br>
>> differences and coloring method.<br>
>><br>
><br>
> How is the preconditioning matrix different from the actual operator?<br>
><br>
><br>
>><br>
>> I can set the function F() of non-linear system (i take the notation F()<br>
>> from documentation).<br>
>><br>
>> Could you send me exactly the commands and the order of it which i must<br>
>> use or an apt example for that?<br>
>><br>
>> I have looked for that in internet but i could not find any suitable<br>
>> example.<br>
>><br>
>> Kostas<br>
>><br>
>> Thanks<br>
>><br>
>><br>
><br>
<br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br></div></div>