[Gmsh] mesh partition colors

Jozsef Bakosi jbakosi at gmu.edu
Sat Jun 11 19:36:43 CEST 2005


On Sat, Jun 11, 2005 at 10:09:31AM -0700, Christophe Geuzaine wrote:
> 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?

Oh, I think I understand now. You are assigning colors based on
(partition_INDEX % 10) == 0, (partition_INDEX % 10) == 1, etc. The
above mesh contains 15 partitions (eg. 0-14). When I go to the Visibility
menu and order the Partitions by Type, the partition numbers stay in
the order: 0,1,7,8,5,6,14,12,13,4,3,2,10,9,11. That is, the program
assigns the color not based on this number, but based on the index (as
you say it below). That's why I got the same colors for partition
numbers 1,2 and 8,9 and 7,10: the "distance" between their indices is
exactly 10.

> >>>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 :-)
> >

20 should take care of the above issue, I guess.

> >>>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).
> 

Awesome! Thanks,

Jozsef
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20050611/6f9cc2b5/attachment.asc>