[Gmsh] question about python api

Frederic Dubois frederic.dubois at umontpellier.fr
Fri Nov 29 09:06:59 CET 2019


Hi Christophe,

In fact I did things in the "complicated" way to be able to recover the 2D elements on the skin of the grains.

Using fragments, these elements are not created or saved even if I create a 2D physical group (here "itz".

Using the "complicated" way, how can I remove the duplicated nodes (like using coherence in .geo file) ?
I tried to do this by fusing the two meshes but I am not confident in the result.

Regards

----- Mail original -----
> De: "Christophe Geuzaine" <cgeuzaine at uliege.be>
> À: "Frederic Dubois" <frederic.dubois at umontpellier.fr>
> Cc: "gmsh" <gmsh at onelab.info>
> Envoyé: Jeudi 28 Novembre 2019 23:12:28
> Objet: Re: [Gmsh] question about python api

>> On 28 Nov 2019, at 22:42, Frederic Dubois <frederic.dubois at umontpellier.fr>
>> wrote:
>> 
>> Hi Christophe,
>> 
>> You are right, this is the best way.
>> 
>> Can you comment this ?
>> f.remove(sphere1)
>> f.remove(sphere2)
> 
> Fragment tries hard to keep intact the tags of those entities that have not been
> modified, here the two spheres. So I remove these two from the list of returned
> entities, which gives me the remaining (new) volume - the paste.
> 
> Christophe
> 
> 
>> 
>> Regards
>> 
>> ----- Mail original -----
>>> De: "Christophe Geuzaine" <cgeuzaine at uliege.be>
>>> À: "Frederic Dubois" <frederic.dubois at umontpellier.fr>
>>> Cc: "gmsh" <gmsh at onelab.info>
>>> Envoyé: Jeudi 28 Novembre 2019 21:31:12
>>> Objet: Re: [Gmsh] question about python api
>> 
>>>> On 28 Nov 2019, at 20:06, Frederic Dubois <frederic.dubois at umontpellier.fr>
>>>> wrote:
>>>> 
>>>> Dear all,
>>>> 
>>>> I am trying to mesh a composite material made of paste and grains.
>>>> Since I have to do some Boolean operation on a 3D volume of composite I tried to
>>>> use the occ factory.
>>>> At the end of the day I need a continuous mesh where paste elements of the mesh
>>>> belong to a paste physical group and grains elements belong to an other
>>>> physical group.
>>>> 
>>>> In the attached script I first create a cylinder and two grains.
>>>> Using a cut I was able to obtain a mesh with all the elements belonging to the
>>>> paste.
>>>> Using a fuse I was able to obtain a mesh with all the elements belonging to the
>>>> grains.
>>>> Unfortunately, it seems that the two meshes are separated.
>>>> 
>>>> I tried to fuse them to obtain a continuous mesh but I am not sure it works fine
>>>> and that it is the proper method.
>>>> 
>>>> Any advice ?
>>> 
>>> Simpler to use fragments:
>>> 
>>> 
>>> 
>>> 
>>> Christophe
>>> 
>>> 
>>>> 
>>>> Regards
>>>> 
>>>> --
>>>> Frédéric Dubois, PhD, Eng.
>>>> ---
>>>> Directeur adjoint du LMGC.
>>>> Laboratoire de Mécanique et Génie Civil - CNRS/UM
>>>> cc 048, 163 rue Auguste Broussonnet, 34090 Montpellier
>>>> http://www.lmgc.univ-montp2.fr/~dubois
>>>> Tel: 33/0 467144984
>>>> Mobile: 33/0 635490843
>>>> <composite.py>_______________________________________________
>>>> 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
>> 
>> --
>> Frédéric Dubois, PhD, Eng.
>> ---
>> Directeur adjoint du LMGC.
>> Laboratoire de Mécanique et Génie Civil - CNRS/UM
>> cc 048, 163 rue Auguste Broussonnet, 34090 Montpellier
>> http://www.lmgc.univ-montp2.fr/~dubois
>> Tel: 33/0 467144984
>> Mobile: 33/0 635490843
> 
>> Prof. Christophe Geuzaine
> University of Liege, Electrical Engineering and Computer Science
> http://www.montefiore.ulg.ac.be/~geuzaine

-- 
Frédéric Dubois, PhD, Eng.
---
Directeur adjoint du LMGC.
Laboratoire de Mécanique et Génie Civil - CNRS/UM
cc 048, 163 rue Auguste Broussonnet, 34090 Montpellier
http://www.lmgc.univ-montp2.fr/~dubois
Tel: 33/0 467144984
Mobile: 33/0 635490843
-------------- next part --------------
A non-text attachment was scrubbed...
Name: composite.py
Type: text/x-python
Size: 1738 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20191129/cab86f0e/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: composite_simpler.py
Type: text/x-python
Size: 1516 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20191129/cab86f0e/attachment-0001.py>


More information about the gmsh mailing list