[petsc-users] Jacobian free in SNES

Jed Brown jedbrown at mcs.anl.gov
Sat Nov 5 15:26:30 CDT 2011


On Sat, Nov 5, 2011 at 13:40, Konstantinos Kontzialis <ckontzialis at lycos.com
> wrote:

>  ierr = MatFDColoringSetFunction(**fdcoloring, base_residual_implicit,
> &sys);
>        CHKERRQ(ierr);
>

This does not work since your base_residual_implicit has the wrong calling
sequence for SNES. You should configure the MatFDColoring using this
sequence:

    ierr =
MatFDColoringSetFunction(matfdcoloring,(PetscErrorCode(*)(void))SNESTSFormFunction,ts);CHKERRQ(ierr);
    ierr = MatFDColoringSetFromOptions(matfdcoloring);CHKERRQ(ierr);
    ierr =
SNESSetJacobian(snes,A,B,SNESDefaultComputeJacobianColor,matfdcoloring);CHKERRQ(ierr);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111105/ea53ee06/attachment.htm>


More information about the petsc-users mailing list