On Fri, Jan 20, 2012 at 8:28 AM, Bernardo Rocha <span dir="ltr"><<a href="mailto:bernardomartinsrocha@gmail.com">bernardomartinsrocha@gmail.com</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">
Hi everyone,
<div><br></div><div>I'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="'times new roman', serif">func</font></span><span style="font-family:arial;white-space:normal;font-size:small"> does not take an application context "object" like</span><span style="white-space:normal;font-size:small"><font face="'times new roman', 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>Can you use <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESGetApplicationContext.html">http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESGetApplicationContext.html</a></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><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><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>