[Gmsh] Gmsh ASCII post-processing file format

Christophe Geuzaine geuzaine at acm.caltech.edu
Sat May 15 01:34:20 CEST 2004


Axel Gerstenberger (TU Dresden) wrote:

> Dear Professor Geuzaine:
> 
> I am a graduate student from TU Dresden, Germany.
> 
> So far, I successfully used Gmsh for 2D and 3D mesh generation and
> post-processing and I was able to create movies. So far I used only the
> parsed post-processing format.
> 
> Now, I want to solve a problem including adaptive meshing by element
> subdivision and encountered several problems with the post-processing format
> for which I seek your help. I checked your mailing list, but couldn't find a
> similar question and answer for the following problems:
> 
> 1:
>   I think, the ASCII post-processing file format (and, eventually, its
> binary variant) is a good choice, since I am want to process transient data
> and going to use a large number of elements later on. However, I was not
> able to create the ASCII post-processing file format. The Gmsh manual
> explains the format for a triangle with vector data.
>   I can produce the scalar output for 1 triangle, however if I change to 2
> or more triangles, all elements appear distorted. I would appreciate very
> much, if you could take a look at the attached ".pos" file and suggest, what
> I do wrong. 

You forgot one number ('nb-text3d-chars') before 'time-step-values'.
Also, the ordering of the node coordinates is probably wrong (warning!
read the documentation: it's not the same as in in the parsed format).

You can easily check if your routines are correct:

1) generate your files in both parsed and ASCII formats
2) load your files in Gmsh, and select view->Save as->ASCII view
3) compare...


> I also don't understand, how the connectivity for the elements is stored.

That's the trick: the post-processing file format does not have *any*
connectivity information.  It's just a "plotting" format, i.e., a
list of completely independent entities.

> 
> 2:
>   Can I use the provided possibility to save multiple time steps in one .pos
> file as suggested in the manual, if the number of nodes and the connectivity
> changes in time (I am using element subdivision and incompatible elements
> (-> hanging nodes) as shown in the attachment)? Since I could not master the
> output format yet, I could not answer this question yet. My current idea is
> to store each time step in a different file and therefore I am allowed to
> use independent data and output settings for each ".pos" file.

The basic rule is: one view is associated with one fixed "mesh". So:

1) if the node coordinates of your elements do not change from time step
to time step, you can generate a multi-time step view.

2) otherwise, you need to generate one view per step. You can either put
the views in the same file, or put them in separate files.

> 
> 3:
>   Since my mesh is incompatible, I see "jumps" or discontinuities at the
> element edges. This seems to be logical, since the linear interpolation in a
> 3 node triangle  can't "see" the neighboring mid-point (see attachment).
> However, my nodal values represent the correct value. I could display the
> scalar field as a number of points without elements, but then I can't see a
> smooth solution as in standard FEM meshes.
> One partly satisfying solution is to show iso-values and set the number of
> lines to 255. This smoothes the field a little, but does not always look
> good.

You could subdivide the elements inside your code, before saving them...

> 
> Another way would be to create a new mesh using all my nodes just for the
> post-processing (e.g. Delauney Triangulation), but I wonder if I can solve
> the third problem within Gmsh.
> 

There is actually a plugin that does just that:

1) generate a view with scalar points
2) call Plugin(Triangulate) on that view
3) et voila :-)

Best,

Christophe

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