<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 12 January 2016 at 14:14, Gideon Simpson <span dir="ltr"><<a href="mailto:gideon.simpson@gmail.com" target="_blank">gideon.simpson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">That seems to to allow for me to cook up a convergence test in terms of the 2 norm. </div></blockquote><div><br></div><div>While you are only provided the 2 norm of F, you are also given access to the SNES object. Thus inside your user convergence test function, you can call SNESGetFunction() and SNESGetSolution(), then you can compute your
convergence criteria and set the converged reason to what ever you want.<br><div><br></div>See <br><div><br><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESGetFunction.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESGetFunction.html</a><br><br><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESGetSolution.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESGetSolution.html</a><br><br></div><div>Cheers,<br></div><div> Dave<br></div><div><br></div><br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">What I’m really looking for is the ability to change things to be something like the 2 norm of the vector with elements<div><br></div><div>F_i/|x_i|</div><div><br></div><div>where I am looking for a root of F(x). I can just build that scaling into the form function, but is there a way to do it without rewriting that piece of the code?</div><span class=""><font color="#888888"><div><br></div></font></span><div><div><div><span class=""><font color="#888888"><br><div>
<span style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">-gideon</span>
</div></font></span><div><div class="h5">
<br><div><blockquote type="cite"><div>On Jan 12, 2016, at 12:14 AM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> wrote:</div><br><div><div><br> You can use SNESSetConvergenceTest() to use whatever test you want to decide on convergence.<br><br>Barry<br><br><blockquote type="cite">On Jan 11, 2016, at 3:26 PM, Gideon Simpson <<a href="mailto:gideon.simpson@gmail.com" target="_blank">gideon.simpson@gmail.com</a>> wrote:<br><br>I’m solving nonlinear problem for a complex valued function which is decomposed into real and imaginary parts, Q = u + i v. What I’m finding is that where |Q| is small, the numerical phase errors tend to be larger. I suspect this is because it’s using the 2-norm for convergence in the SNES, so, where the solution is already, the phase errors are seen as small too. Is there a way to use something more like an infinity norm with SNES, to get more point wise control?<br><br>-gideon<br><br></blockquote><br></div></div></blockquote></div><br></div></div></div></div></div></div></blockquote></div><br></div></div>