[Gmsh] Gmsh merge several partial meshes to a complete mesh

Christophe Geuzaine cgeuzaine at uliege.be
Thu Mar 28 12:33:37 CET 2019



> On 27 Mar 2019, at 20:02, Johannes_ACKVA <johannes.ackva at code-aster.de> wrote:
> 
> Hi Christoph,
> 
> """
> We could also add an option to "force" MED meshes to be loaded in the
> same model, whatever the name. Would that be useful?
> """
> 
> that would be VERY useful. Thank you when doing it!
> 

The latest development build has a new option "Mesh.MedSingleModel" which will do just that.

2 notes:

- Gmsh uses the MED "family" id to define Gmsh entities; so if identical families exist in several files, the elements will be stored in a single geometrical entity
- No effort is made to make mesh nodes/elements unique (it they exist in more than 1 file) ; if you want to remove duplicates, you need to perform the operation explicitly afterwards (e.g. Coherence Mesh in a .geo file, or removeDuplicateNodes() in the api.)

Christophe



> 
> The 1st option which you mention - to store each mesh with the same name
> - ist not really practical, because clearly names  help to distinguish
> 
> 
> Best regards,
> 
> 
> 
> Johannes
> 
> 
> 
> ______________________________________________________________________
> Ingenieurbüro für Mechanik                     Tel 0049 (0)9832 708152
> Dr.-Ing. Johannes Ackva
> Markgrafenstr. 21
> D 91717 Wassertrüdingen
> 
> www.code-aster.de                              *
> 
> On 27.03.19 18:24, Christophe Geuzaine wrote:
>> 
>> Hi Johannes,
>> 
>> The mesh import procedure for MED files is a bit particular, as MED files can store multiple meshes, each with their own name. Gmsh tries to handle this gracefully by creating one model per mesh name. In your case each file stores a single mesh, with its own name. As in the case of a single file with several mesh names, Gmsh then automatically creates a new model for each mesh.
>> 
>> If you save each MED file with the same mesh name, Gmsh will merge them in the same model. We could also add an option to "force" MED meshes to be loaded in the same model, whatever the name. Would that be useful?
>> 
>> Christophe
>> 
>>>                 *
>>> 
>>> On 27.03.19 18:02, Christophe Geuzaine wrote:
>>>> 
>>>> 
>>>>> On 27 Mar 2019, at 16:50, Johannes_ACKVA <johannes.ackva at code-aster.de> wrote:
>>>>> 
>>>>> 
>>>>> Max, thank you for your reply.
>>>>> 
>>>>> Unfortunally my question (1) is not yet answered: does anyone know is
>>>>> there a way to assemble 2 (or more) meshes??
>>>> 
>>>> It depends on the mesh format. With the native MSH format you can indeed directly merge several meshes: nodes and elements have unique global tags (identifiers). With other formats it depends on how they have been stored. Can you send a simple example of the MED files you'd like to merge?
>>>> 
>>>> Christophe
>>>> 
>>>>> 
>>>>> 
>>>>> Johannes
>>>>> 
>>>>> _______________________________________________
>>>>> gmsh mailing list
>>>>> gmsh at onelab.info
>>>>> http://onelab.info/mailman/listinfo/gmsh
>>>> 
>>>>>>>> Prof. Christophe Geuzaine
>>>> University of Liege, Electrical Engineering and Computer Science 
>>>> http://www.montefiore.ulg.ac.be/~geuzaine
>>>> 
>>>> 
>>>> 
>>> <meshes_ToGeuzaine.zip>
>> 
>>>> 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






More information about the gmsh mailing list