mesh file conversion

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Jean-Baptiste Leydet

mesh file conversion

Post by Jean-Baptiste Leydet »

Hi all,
I would like to convert mesh files from one format to another, like Gambit Neutral to MED (human readable)
I thought of using Code_Saturne for that but as I understand only binary MED (or CGNS) files can be generated that way.
I have installed the mdump and xmdump utilities and I have a few questions:
 
1. Is mdump the way to go?
2. If so, how can I use it to generate a human readable MED file like one that would be generated by Salome maybe? (there are a few options available)
 
I hope I am making any sense at all :/
 
Thanks!
Jean-Baptiste
Mickael Hassanaly

Re: mesh file conversion

Post by Mickael Hassanaly »

Dear M Leydet,
The conversion tool you need is the pre processor of Code_Saturne. To do so, type the following command line :
code_saturne check_mesh -m "your_mesh_neutral" --med --volume
However i don't know if it would be "human readable" enough. Let me know if  it is.
Best regards
Mickaël Hassanaly
Jean-Baptiste Leydet

Re: mesh file conversion

Post by Jean-Baptiste Leydet »

Dear Mickael,
The method you describe produces a binary MED file.
From there I'm hoping I can use mdump to make the MED human readable.
The idea is to understand how the MED file is built by converting a .neu I am familiar with.
Thanks,
Jean-Baptiste
Mickael Hassanaly

Re: mesh file conversion

Post by Mickael Hassanaly »

Dear M Leydet,
The way you plane to proceed should be ok. If not, i've some others possibilities to test.
Best regards
Mickaël
Yvan Fournier

Re: mesh file conversion

Post by Yvan Fournier »

Hello,
mdump is the way to go, as MED files are always binary. Since MED is built on top of HDF5, HDF5 utilities such as h5dump or h5view (graphical) may help.
The MED documentation (packaged along with the library) also describes the mesh structure.
There are significant differences between MED and .neu, as GAMBIT neutral files describe boundary conditions to be on local face j of cell i, while MED uses surface elements (defined with the same vertices as face j of cell i) to carry group information.
Furthermore, with MED, groups are defined through "families", which are equivalence classes of groups For example, with groups A and B, we may have up to 3 families: group A only, group B only, group A and B.
Local element vertex numbering is probably also different.
Best regards,
  Yvan
Jean-Baptiste Leydet

Re: mesh file conversion

Post by Jean-Baptiste Leydet »

Yvan, Mickaël,

Thanks for the input.

There are several options to select prior to the dumping operation ("mode d'affichage de coordonnées des noeuds" [entrelacé ou non] et "connectivité des éléments" [nodale ou descendante]). Which settings correspond to a standard MED file that will be readable by Saturne?
I have tried dumping the output of mdump in a text file (using the default mdump settings) but that file can't be read by Saturne as such.

Regarding the documentation - If we're talking about the same documentation it is all in French. Unfortunately, the person that would need this information do not know french...

Yvan, what I am trying to do is to get a software provider to implement a mesh export functionality to an existing tool. As I understood, there is a commercial support for implementation of MED support, but I'm afraid that is not an option for the time being.

If a non-french should add a mesh export functionality to an existing program, without any commercial support, that would work with Saturne (and preferably with Aster / Syrthes as well), what would his best pick for the format?

Thanks,

Jean-Baptiste
Mickael Hassanaly

Re: mesh file conversion

Post by Mickael Hassanaly »

Dear M Leydet,

What concerns the options to choose for mdump :

1- entrelacé
2-nodale

And you must have a mesh that will work with Code_Saturne.

Your second question is more difficult, i think Yvan will be more able to answer to it.

Best regards

Mickaël
Yvan Fournier

Re: mesh file conversion

Post by Yvan Fournier »

Hello,

The best pick for the format depends on what you want to do with it. If it is purely for post-processing, and you do not need to keep track of groups, boundary conditions, zones, or such, the EnSight gold format is quite simple, well documented, and does not require any additional library. A second advantage is that many visualization tools can handle this format, which may be nice for testing/debugging output. The Gmsh format is even simpler, and allows for some zone info, but is does not allow polygons or polyhedra, and is less well known.

The next version of MED (MED 3) as an English instead of French API, but the documentation of the beta version I received is still in French, so it may not be ideal for a non-French speaker yet, though there may already be some converters to various formats (you may want to check the CAELinux or http://www.salome-platform.org forums).

I find the documentation of the CGNS library very readable, and it si in English, so that would seem a good pick. A disadvantage of the CGNS format is that many variants are possible (making reading it from an unknown source complex), but if all you need to read is Code_Saturne output, the subset is simpler.

I wrote more details on the various post-processing formats in the user documentation, with (hopefully up to date) links to the format documentations when available, so you will have more details there, but what is above would be my picks.

You may contact me directly for further details if any information is confidential.

Best regards,

  Yvan
Post Reply