<div class="gmail_quote">On Thu, Apr 5, 2012 at 05:02, behzad baghapour <span dir="ltr"><<a href="mailto:behzad.baghapour@gmail.com">behzad.baghapour@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":3x9">I could solve the problem by shifting the postCheck below the SNESSetFromOptions but still have another problem with passing defined context:<br><br>All my calcualtions are saved into global FieldContext including flow-field variables. I passed it to PostCheck. I could apply my desired change on the context BUT the results came back to the original values (before postCheck function) and therefore my efferts to modify the Newton procedure did not achieved.<br>
<br>How should I handle it?</div></blockquote></div><br><div>You will have to explain more completely what is happening. If you want the postcheck to modify a context, you have to make sure that it sees the same context. PETSc NEVER does anything with the context pointers, it just passes it through to the callbacks.</div>