[Gmsh] mesh partitions without different colors

Christophe Geuzaine geuzaine at acm.caltech.edu
Tue Jun 7 01:11:23 CEST 2005


Jozsef Bakosi wrote:
> Hi all,
> 
> I'm trying to display a 2d triangular partitioned mesh by setting
> Options->Mesh->Color to "By Partition", but gmsh doesn't use
> different colors for the different partitions. However, the mesh is
> read in well, since when I change the visibility to display only
> one/some of the partitions, the partitions appear.
> 
> This is the mesh I'm using:
> http://camp.gmu.edu/jbakosi/pub/square.msh
> 
> Is this a bug or I'm missing something?
> 

Hi Jozsef - Good catch: it's a bug... Here is a patch to fix it:


--- Common/Options.cpp.orig     2005-06-06 16:07:23.000000000 -0700
+++ Common/Options.cpp  2005-06-06 16:07:34.000000000 -0700
@@ -4442,7 +4442,7 @@
    if(action & GMSH_SET) {
      if(CTX.mesh.color_carousel != (int)val) CTX.mesh.changed = 1;
      CTX.mesh.color_carousel = (int)val;
-    if(CTX.mesh.color_carousel < 0 || CTX.mesh.color_carousel > 2)
+    if(CTX.mesh.color_carousel < 0 || CTX.mesh.color_carousel > 3)
        CTX.mesh.color_carousel = 0;
    }
  #if defined(HAVE_FLTK)



Thanks for the report!

Christophe

-- 
Christophe Geuzaine
Applied and Computational Mathematics, Caltech
geuzaine at acm.caltech.edu - http://geuz.org