[Gmsh] Diplaying of Vector fields

Christophe Geuzaine cgeuzaine at ulg.ac.be
Fri Jun 14 21:42:37 CEST 2013


On 14 Jun 2013, at 08:21, Christophe Geuzaine <cgeuzaine at ulg.ac.be> wrote:

> 
> On 12 Jun 2013, at 23:13, Matthias Lang <Lang_Matthias at gmx.de> wrote:
> 
>> Hi Christophe,
>> 
>> when I select "Aspect->Glyph location = Vertex (instead of Barycenter),
>> then some vectors are shown.
>> 
>> Enclosed you can find a small file "js.pos" where the effect can be demonstrated.
>> 
> 
> Hi Matthias,
> 
> Looking at the dataset, the behavior is actually "normal". Here's what happens:
> 
> * min/max=1 is correctly computed from the original dataset (all vectors have a norm = 1)
> 
> * displaying the values at the nodes does shows all the values (as expected)
> 
> * displaying the values at the barycenter of the elements uses average values; due to the nature of the vector field, the average value over one cell is != 1 (due to the rotation), hence the vectors are not displayed
> 
> Maybe we should change the test and display the value at the barycenter if any of (or all ?) the nodal values are within the range?
> 

A better solution is probably to consider the value drawn at the barycenter as a "representative" value for the element, not an  interpolation.

I changed the code to average the direction and the norm independently; this is consistent with the definition of our min/max (based on the norm), and also fixes your problem.

Give it a try with tomorrow's nightly build and let us know?

Thanks,

Christophe






> Re-attaching the file so others can provide suggestions...
> 
> Christophe
> 
> <js.pos>
> 
> 
> 
>> btw.:
>> I used the most recent gmsh version:
>> Info    : Gmsh version   : 2.7.2-svn
>> Info    : Build OS       : Linux
>> Info    : Build date     : 20130612
>> 
>> Regards
>> Matthias Lang
>> 
>> Am 12.06.2013 17:24, schrieb Christophe Geuzaine:
>>> 
>>> Hi Matthias - My guess is that there is some roundoff error and we don't use a large enough tolerance. Could you
>>> 
>>> * try to see if the same problem persists when selecting "Aspect->Glyph location = Vertex" in Tools->Options->View
>>> 
>>> * send me a small .pos file with a dataset that triggers the issue ?
>>> 
>>> Many thanks,
>>> 
>>> Christophe
>>> 
>>> On 11 Jun 2013, at 07:39, Matthias Lang <Lang_Matthias at gmx.de> wrote:
>>> 
>>>> Hello everybody,
>>>> 
>>>> I defined in a getdp *.pro file for an example a current (1Amp) in a torus.
>>>> I expected to see a vector field with vector arrows of the same length.  But in the coressponding view no vector field were seen (and no error message) And the displayed scale showed a range from 1 to 1
>>>> 
>>>> Few hours later...
>>>> 
>>>> I found out, that when I set the  range mode in Menu Options //General
>>>> to "Custom" and the range form Min=0 to Max=1 --> then the expected vectorfield is shown.
>>>> But when I set the range from Min=1 Max = 1 -  nothing ist shown again.
>>>> 
>>>> My suggestion for the developer:
>>>> If the min value is equal to the maximum value of a (magnitude of a) vector
>>>> and min value > 0 --> something should be displayed.
>>>> 
>>>> 
>>>> Matthias Lang
>>>> 
>>>> _______________________________________________
>>>> gmsh mailing list
>>>> gmsh at geuz.org
>>>> http://www.geuz.org/mailman/listinfo/gmsh
>>> 
>> <js.pos>
> 
> -- 
> Prof. Christophe Geuzaine
> University of Liege, Electrical Engineering and Computer Science 
> http://www.montefiore.ulg.ac.be/~geuzaine
> 
> 
> 

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