<p>As a hack, you can probably PCSetType(pc, PCNONE); PCSetType(pc, PCILU); and then set the new number of levels.</p>
<p>PCILU should be updated to be able to do this.</p>
<div class="gmail_quote">On Oct 31, 2011 4:14 AM, "behzad baghapour" <<a href="mailto:behzad.baghapour@gmail.com">behzad.baghapour@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This means to PCDestroy() and then PCCreate again at that iteration?<br><br><br><div class="gmail_quote">On Mon, Oct 31, 2011 at 2:32 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@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>On Mon, Oct 31, 2011 at 10:58 AM, behzad baghapour <span dir="ltr"><<a href="mailto:behzad.baghapour@gmail.com" target="_blank">behzad.baghapour@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I did it but received this Error when I want to change the level of fill for PCILU:<br></blockquote><div><br></div></div><div>Right, you would have to recreate the preconditioner. The SetType() would not work since</div>
<div>you did not actually change the type.</div>
<div><br></div><div> Matt</div><div><div></div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[0]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
[0]PETSC ERROR: Object is in wrong state!<br>
[0]PETSC ERROR: Cannot change levels after use!<br>[0]PETSC ERROR: ------------------------------------------------------------------------<div><div></div><div><br><br><br><br><div class="gmail_quote">On Mon, Oct 31, 2011 at 2:19 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@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>On Mon, Oct 31, 2011 at 8:55 AM, behzad baghapour <span dir="ltr"><<a href="mailto:behzad.baghapour@gmail.com" target="_blank">behzad.baghapour@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear all,<br><br>I'm using KSP iteration (for now) to solve my nonlinear problem and handling Newton Iterations manually. Here I want to change the PC method from some specified KSP iteration. How should I do it correctly in Petsc?<br>
</blockquote><div><br></div></div><div>Call PCSetType() and then KSPSetOperators() again in your loop</div><div><br></div><div> Matt</div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks, B.B.<br clear="all"><font color="#888888"><br>-- <br>==================================<br>Behzad Baghapour<br>Ph.D. Candidate, Mechecanical Engineering<br>University of Tehran, Tehran, Iran<br><a href="https://sites.google.com/site/behzadbaghapour" target="_blank">https://sites.google.com/site/behzadbaghapour</a><br>
Fax: 0098-21-88020741<br>==================================<br><br>
</font></blockquote></div></div><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></blockquote></div><br><br clear="all"><br>-- <br>==================================<br>Behzad Baghapour<br>Ph.D. Candidate, Mechecanical Engineering<br>University of Tehran, Tehran, Iran<br><a href="https://sites.google.com/site/behzadbaghapour" target="_blank">https://sites.google.com/site/behzadbaghapour</a><br>
Fax: 0098-21-88020741<br>==================================<br><br>
</div></div></blockquote></div></div></div><div><div></div><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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>==================================<br>Behzad Baghapour<br>Ph.D. Candidate, Mechecanical Engineering<br>University of Tehran, Tehran, Iran<br><a href="https://sites.google.com/site/behzadbaghapour" target="_blank">https://sites.google.com/site/behzadbaghapour</a><br>
Fax: 0098-21-88020741<br>==================================<br><br>
</blockquote></div>