[Gmsh] Different interpolation schemes

Christophe Geuzaine cgeuzaine at ulg.ac.be
Tue Nov 5 08:14:28 CET 2013


On 04 Nov 2013, at 20:59, Marios Papadopoulos <mariospapa2008 at gmail.com> wrote:

> Hello Martin,
>  
> I've checked the option you mentioned and nothing happened when I select "vertex" and not "barycenter" for the Glyph Location. You can check it out in a simple example with one quad element. Attached you will find scalar field plotted in gmsh and the same contour plot taken from wikipedia lemma (bilinear interpolation). (see http://en.wikipedia.org/wiki/Bilinear_interpolation)
>  
> The question is, how I can use gmsh's $InterpolationScheme feature to get the same contour plot inside the quad element? 
>  

Hi Marios,

You actually don't need to define a specific $InterpolationScheme for this, as your function space is the classical, built-in one.

The issue is that by default we draw the colormap on quads by splitting them into 2 triangles. You can get better visual accuracy by using our adaptive visualization scheme: select "Adapt visualization grid" in the View's Option panel. Set the "Target visuzalisation error" to the minimum (slide your mouse to the left). Set the recursion level to 1 to match the display of your other code. Note that this is still not exact. Increase the recursion level more to get closer to the exact visu.

Christophe


> Regards!
> 
> 
> On Mon, Nov 4, 2013 at 2:14 PM, Martin Vymazal <martin.vymazal at vki.ac.be> wrote:
> Hello Marios,
> 
>  could you check that gmsh plots the values in vertices and not in
> barycenters?
> You can verify this by clicking on Tools->Options, then select your
> postprocessing view, go to tab 'Aspect' and look at 'Glyph location'.
> 
> Best regards,
> 
>   Martin Vymazal
> 
> On Sunday 03 November 2013 19:03:56 Marios Papadopoulos wrote:
> > Dear gmshers,
> >
> > attached you will find two contour plots from a scalar field. The first one
> > (contour1.png) was made with gmsh using $NodeData feature, without using
> > any extra $InterpolationScheme rule info. The second one (contour2.png) was
> > made using another post-processing software with the same nodal values.
> > This second image is the right represantion of the contour for the scalar
> > field.
> >
> > As you notice, gmsh interpolate the nodal values with a "wrong" way.
> > Ignoring the color mapping, how i can use the $InterpolationScheme feature
> > in .msh format in order to get the right distribution inside the elements
> > from the corresponding nodal values?
> >
> > i.e.
> > $InterpolationScheme
> > "name"
> > number-of-element-topologies
> > elm-topology
> > number-of-interpolation-matrices
> > num-rows num-columns value
> > ... ...
> > $EndInterpolationScheme
> >
> > Thank you in advance!
> 
> 
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh
> 
> <interpolation.msh><interpolation_gmsh.png><interpolation_wiki.png>_______________________________________________
> 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