Question about Coloring

Barry Smith bsmith at
Tue Oct 6 21:02:39 CDT 2009

     There are any number of valid colorings for same matrix nonzero  
pattern. The only reason to like one over the other is if it requires  
fewer colors (then it requires fewer function evaluations).

     There is no easy way to modify a coloring once it is created with  

     If you have code that efficiently colors the matrix then yes you  
can use MatColoringRegisterDynamic() to provide it.

     I take the coloring DAGetColoring() gives you is not a correct  
coloring for your problem?

     You could also copy the code from DAGetColoring() and modify it  
for your problem.


On Oct 6, 2009, at 8:51 PM, Yaakoub El Khamra wrote:

> Greetings
> I have a system of equations that I am solving with SNES on a DA, and
> the coloring is almost exactly as the one I would get with
> DAGetColoring but different in a very small and identifiable number of
> locations. Is there a way to modify the coloring I get from
> DAGetColoring directly as opposed to running MatGetColoring? Or should
> I register my own coloring using MatColoringRegisterDynamic? Any
> ideas/suggestions/examples are greatly appreciated.
> Many thanks in advance.
> Regards
> Yaakoub El Khamra

More information about the petsc-users mailing list