Question about Coloring

Yaakoub El Khamra yelkhamra at
Tue Oct 6 21:04:33 CDT 2009

Great idea! Modify the DAGetColoring code and register it. Thank you very much!

Yaakoub El Khamra

On Tue, Oct 6, 2009 at 9:02 PM, Barry Smith <bsmith at> wrote:
>    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
> DAGetColoring().
>    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.
>   Barry
> 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