[petsc-users] example on manually setup matrix coloring for finite difference Jacobian?

Barry Smith bsmith at mcs.anl.gov
Wed Jul 17 20:23:06 CDT 2013


On Jul 17, 2013, at 6:02 PM, "Zou (Non-US), Ling" <ling.zou at inl.gov> wrote:

> Hi All,
> 
> If I have a 2-d problem with unstructured triangle mesh, I suppose I
> need handle the coloring manually in case I need the finite
> differencing Jacobian. Also I guess it is doable as I know the mesh
> connectivity. I noticed there are several examples handling structured
> mesh case. Is there any example to setup the matrix coloring for this
> kind of case?

    See the section Finite Difference Jacobian Approximations in the users manual; this tells you exactly what needs to be done. See also src/snes/examples/tutorials/ex1.c that code that begins with   if (fd_coloring) { similar code also for Fortran programmers in ex1f.F ex10d/ex10.c 
    
   Should be straightforward, let us know if you have any problems,

   Barry



> Best,
> 
> Ling



More information about the petsc-users mailing list