[Gmsh] Patch: minimal arrow size

Christophe Geuzaine cgeuzaine at ulg.ac.be
Fri Dec 5 17:01:47 CET 2008


Jiří Hnídek wrote:
> Hi Christophe,
> thanks for reply.
> 
> Christophe Geuzaine píše v Pá 05. 12. 2008 v 13:56 +0100:
>> Jir(í Hnídek wrote:
>>> Hi,
>>> I created small patch of GMSH source code. This patch is created from 2
>>> days old cvs source snapshot (I mentione this, because noticed lot of
>>> new code in last cvs snapshot). This patch adds option to change minimal
>>> arrow size. Hopefully, this screenshot describes more:
>>>
>>> http://dl.getdropbox.com/u/369894/GMSH_minimal_arrow_size.png
>>>
>>> Why is it useful for us? We try to do visualization of water flow in a
>>> underground (simulation of poisoned water, simulation of
>>> decontamination, etc). There are areas with large flow speed (rifts) and
>>> very small flow speed (massif). Flows in massif are sometimes so small,
>>> that are invisible with logarithmic value scale. This option could help
>>> us see and understand processes in underground better :-).
>>>
>> Hi Jiri - Thanks for the patch. This could indeed be very interesting: 
>> we'll have a look.
>>
>> Another thing you could try is to select the "logarithmic" value scale 
>> mode. That's the mode we usually use when we visualizae vector fields 
>> with large variations. How does it work on your dataset?
> 
> Logarithmic value scale works fine for some types of data set, but for example in this case it doesn't work too good:
> 
> Linear value scale:
> http://dl.getdropbox.com/u/369894/Linear_vector_field.png
> 
> Logarithmic value scale:
> http://dl.getdropbox.com/u/369894/Logarithmic_vector_field.png
> 
> Logarithmic value scale win minimal arrow size:
> http://dl.getdropbox.com/u/369894/Logarithmic_vector_field_with_min_arrow_size.png
> 
> Why logarithmic value scale does not work for us too good in this case?
> It is influenced by code in function drawVectorArray(...):
> 
> scale = opt->ArrowSize / l * log10(l / opt->TmpMin) /
> log10(opt->TmpMax / opt->TmpMin);
> 
> This returns zero values for vectors near to the smallest vector in a
> vector field. Most of vectors in our vector fields are near to the
> minimal vector, because flow in massif is small. Why are so small flows
> so important for us? Because such flows are in large volumes and amount
> of flowed water could be significant.

Indeed. We've just added a modified version of your patch. Let us know 
what you think...

> 
>>> If you will find my patch interesting, then let me know, I can recreate
>>> it against new cvs source snapshot. I will try to ask again. Do you have
>>> any public cvs repository? This would help me very much. Are you
>> Not public, but we create accounts for frequent contributors.
> 
> Ok, I will try to convince you, that I deserve account :-). How many
> patches should I send to be accepted as contributor? I'm Blender
> developer and Blender developer community gives subversion write access
> to developer, who contributed 3 good patches. Do you have similar
> politic?

No official politic: it just happens when it happens ;-)

> 
>>> interested in any cooperation? I have some ideas to improve GMSH. What
>> Of course! Don't hesitate to contact us with ideas, remarks, etc.
> 
> I would like to focus at OpenGL. It seems you use OpenGL immediate mode
> in many cases. I would like to rewrite it with OpenGL display lists or
> vertex arrays. I know it isn't so easy in project like GMSH. We have
> same problems in Blender. We still use OpenGL immediate mode, becuase
> Blender has old design (should be rewritten in blender2.5 though).
> 

Gmsh actually uses vertex arrays for pretty much everything (meshes and 
scalar datasetsets). But it still uses immediate mode for the geometry 
and for vector post-processing datasets.

The geometry is not a problem; but getting vector datasets to use vertex 
arrays could be hugely beneficial... Can you imagine a way how one could 
do this?




> BTW: I created wiki page (czech language) for my colleagues. They should
> write there some ideas about improving GMSH:
> 
> https://www.nti.tul.cz/wiki/WikiUser:Jiri.Hnidek/GMSH_Ideas
> 
>> Cheers,
>>
>> Christophe
> 
> Cheers,
> 
> Jiri
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh


-- 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine