[Gmsh] mesh partition colors
Christophe Geuzaine
c.geuzaine at ulg.ac.be
Sat Jun 11 19:09:31 CEST 2005
Jozsef Bakosi wrote:
> On Sat, Jun 11, 2005 at 12:24:08AM -0700, Christophe Geuzaine wrote:
>
>>Jozsef Bakosi wrote:
>>
>>>Hello all,
>>>
>>>after applying the patch from Chirstophe, in case of a mesh with
>>>different partitions, gmsh displays the mesh very nicely using
>>>different colors now. I have, however, a few minor questions/requests
>>>regarding this functionality.
>>>
>>>If I have mesh-partition #0, how do I set its color? In
>>>Options->Mesh->Color there are only colors assigned starting from One,
>>>Two, etc. It would be great to be able to use partition number 0. This
>>>is a minor thing, however, because one could just save the partitioned
>>>mesh-file with partition numbers starting from 1 and also gmsh does handle
>>>partition #0 as a different partition, but still, I think it would
>>>be great have its color controllable, now that it handles it right.
>>
>>Hi Jozsef - the current version actually associates the color "one" with
>>all partitions such that (partition_number % 10) == 0, the color "two"
>>with all the partitions s.t. (partition_number % 10) == 1, etc.
>
>
> Hmmm, I understand and I guess it should work, but then why do I get the
> same colors for partition 1,2 and 8,9 on the following mesh:
> http://camp.gmu.edu/jbakosi/pub/cylinder/mesh/cylinder.msh ? But maybe I
> mess up something else when writing the mesh-file...
>
Your file looks OK here. Maybe we should choose more contrasted default
colors in the carousel?
>
>>>How are the colors to partition numbers higher than 10 assigned? Is this
>>>changeable (through ~/.gmsh-options at least)? I don't wish for too
>>>many more, but another 10 would be great. Also, I'm not sure, but I
>>>think I remember correctly that partitions over 10 get the same color
>>>(or end up having some of the already used colors). That can be confusing.
>>
>>I've increased the number of colors in the carousel from 10 to 20, and
>>changed the numbering to start at "zero" instead of "one". It should be
>>less confusing this way :-)
>
>
> Very cool, thanks.
>
>
>>>When I save partitions of a bigger mesh into seperate files with
>>>different partition numbers (but each file only has one number of course),
>>>it would be great if gmsh displayed the mesh according to the number in the
>>>file (and not using the the color for partition One, since that is the
>>>only one in that file). (I know if I just wanted to look at the different
>>>partitions (from one file), I could just hide the ones I don't want to look
>>>at, but I needed to save different partitions to different files and wanted
>>>to look at them separately to see if they are correctly
>>>transmitted/received
>>>and -- locally to a processor -- reordered well. Yeah, that was a way of
>>>debugging for me... :-)
>>
>>I don't understand your question: the color is already chosen according
>>to the partition number (in the file).
>
>
> What I mean is that when I open the files
> http://camp.gmu.edu/jbakosi/pub/cylinder/mesh/cylinder.msh.p1of15
> http://camp.gmu.edu/jbakosi/pub/cylinder/mesh/cylinder.msh.p2of15
> http://camp.gmu.edu/jbakosi/pub/cylinder/mesh/cylinder.msh.p3of15
> and so on, they all look like the following (ie. using the same color, that
> is color "One"):
> http://camp.gmu.edu/jbakosi/pub/cylinder/mesh/p1of15.png
> http://camp.gmu.edu/jbakosi/pub/cylinder/mesh/p2of15.png
> http://camp.gmu.edu/jbakosi/pub/cylinder/mesh/p3of15.png
> even though they all have different partition numbers 0, 1, 2, etc, respectively.
>
> This is my .gmsh-options file:
> http://camp.gmu.edu/jbakosi/pub/cylinder/mesh/gmsh-options
>
Aah, I see. Gmsh was actually using the partition index (and not the
partition number) to choose the color. I've fixed it: the changes will
be available in tomorrow's nightly cvs snapshot (geuz.org/gmsh/src).
Take care,
Christophe
--
Christophe Geuzaine
Applied and Computational Mathematics, Caltech
geuzaine at acm.caltech.edu - http://geuz.org