OK, thanks...<br><br><div class="gmail_quote">On Fri, Jan 20, 2012 at 12:33 PM, Matthew Knepley <span dir="ltr">&lt;<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Fri, Jan 20, 2012 at 8:28 AM, Bernardo Rocha <span dir="ltr">&lt;<a href="mailto:bernardomartinsrocha@gmail.com" target="_blank">bernardomartinsrocha@gmail.com</a>&gt;</span> wrote:<br>
</div></div><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi everyone,
<div><br></div><div>I&#39;m using SNES but I would like to update my data after each successful step computation within the nonlinear solver using a different function. I mean, after the solution of each linear system I would like to get \Delta x_k to update x_{k+1} which is stored somewhere in my application class (C++ code). Looking at the documentation I found this function:</div>


<div><span style="font-family:monospace;font-size:medium;white-space:pre-wrap"><br></span></div><div><span style="font-family:monospace;font-size:medium;white-space:pre-wrap">PetscErrorCode  SNESSetUpdate(SNES snes, PetscErrorCode (*func)(SNES, PetscInt))</span></div>


<div><span style="font-family:monospace;font-size:medium;white-space:pre-wrap"><br></span></div><div><font face="monospace"><span style="white-space:pre-wrap;font-size:medium"><span style="font-family:arial;white-space:normal;font-size:small">but </span><span style="white-space:normal;font-size:small"><font face="&#39;times new roman&#39;, serif">func</font></span><span style="font-family:arial;white-space:normal;font-size:small"> does not take an application context &quot;object&quot; like</span><span style="white-space:normal;font-size:small"><font face="&#39;times new roman&#39;, serif"> void *ctx</font></span><span style="font-family:arial;white-space:normal;font-size:small">, that I could use to get my data and finally update it. Is there another function that would allow me to do this? </span></span></font></div>

</blockquote><div><br></div></div></div><div>Can you use <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESGetApplicationContext.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESGetApplicationContext.html</a></div>

<div><br></div><div>   Matt</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><font face="monospace"><span style="white-space:pre-wrap;font-size:medium"><span style="font-family:arial;white-space:normal;font-size:small">Thanks in advance,</span></span></font></div>


<div><font face="monospace"><span style="white-space:pre-wrap;font-size:medium"><span style="font-family:arial;white-space:normal;font-size:small">Best regards,</span></span></font></div>
<div><font face="monospace"><span style="white-space:pre-wrap;font-size:medium"><span style="font-family:arial;white-space:normal;font-size:small">Bernardo M. Rocha</span></span></font></div>
<div><font face="monospace"><span style="white-space:pre-wrap;font-size:medium"><span style="font-family:arial;white-space:normal;font-size:small"><br>
</span></span></font></div><div><span style="font-family:monospace;font-size:medium;white-space:pre-wrap"><br></span></div>
</blockquote></div></div><span class="HOEnZb"><font color="#888888"><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>
</font></span></blockquote></div><br>