<div class="gmail_quote">On Sat, Nov 5, 2011 at 13:40, Konstantinos Kontzialis <span dir="ltr">&lt;<a href="mailto:ckontzialis@lycos.com">ckontzialis@lycos.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"> ierr = MatFDColoringSetFunction(<u></u>fdcoloring, base_residual_implicit,<br>
&amp;sys);<br>
        CHKERRQ(ierr);<br></div></blockquote></div><br><div>This does not work since your base_residual_implicit has the wrong calling sequence for SNES. You should configure the MatFDColoring using this sequence:</div><div>
<br></div><div><div>    ierr = MatFDColoringSetFunction(matfdcoloring,(PetscErrorCode(*)(void))SNESTSFormFunction,ts);CHKERRQ(ierr);</div><div>    ierr = MatFDColoringSetFromOptions(matfdcoloring);CHKERRQ(ierr);</div><div>
    ierr = SNESSetJacobian(snes,A,B,SNESDefaultComputeJacobianColor,matfdcoloring);CHKERRQ(ierr);</div></div><div><br></div>