<div class="gmail_extra">Here is my procedure:<br><br>Define:<br><br>KSP mon_ksp;<br>PC mon_pre;<br>.<br>.<br>.<br>if( res_n < 1e-1 && c_test == 0 )<br>{<br> KSPGetPC ( mon_ksp, &mon_pre );
<br> ierr = PCFactorSetLevels( mon_pre, 4 ); CHKERRQ( ierr );<br> KSPSetPC ( mon_ksp, mon_pre );<br> SNESSetKSP( snes, mon_ksp );
<br> ierr = SNESSetUp( snes ); CHKERRQ( ierr );<br> c_test = 1;
<br>}<br><br>and did get the error: "Object is in wrong state..." <br><br></div>