Personal tools
You are here: Home Forum Use Get IDs of group of Faces

Get IDs of group of Faces

Up to Use

Get IDs of group of Faces

Posted by Claudio Caccia at June 08. 2021

Hi,

I'm trying to automate the generation of a mesh with Salome. I have made a script that generates a parametric geometry, defines some groups and then generates a mesh for CFD purposes. I need to add a viscous layer hypothesis  for which I'd like to use the function SetFaces, where I pass the walls defined in the geometry. If I dump the study I get something like

ViscousLayers.SetFaces( [ 7, 12, 20 ], 0 )

As I am not completely sure that in every possible parametric geometry the number and the ID of the faces will always be the list [7,12,20] I tried to access that list with some functions, but without success. As it can be seen in the attached image, I have a group named wall1 made of 3 faces, whose indices are [7, 12, 20].

I tried to  use:

ViscousLayers.SetFaces(wall1.GetSubShapeIndices(), 0 )

but wall1.GetSubShapeIndices()  returns [7, 12, 17] instead of  [7, 12, 20] and obviously the mesh generation doesn't work as expected.

What is the correct way to access the indices of a group of faces?

Thank you

Claudio

 

 

Attachments

Re: Get IDs of group of Faces

Posted by SMESH expert at June 08. 2021

Hi Claudio

You can directly use your geom group to define Viscous layers by calling ViscousLayers() method of your 3D algorithm.

https://docs.salome-platform.org/latest/gui/SMESH/StdMeshersBuilder.html?highlight=viscous#smesh_algorithm.Mesh_Algorithm.ViscousLayers

Best regards

Edward

Re: Get IDs of group of Faces

Posted by SMESH expert at June 08. 2021

Re: Get IDs of group of Faces

Posted by Claudio Caccia at June 09. 2021

Hi SMESH expert,

thank you for the links. I had read them but I didn't find exactly what I was looking for. Nevertheless, reading the code again made me understand the mistake. I made  a Fusion of two objects in the geometry, keeping the groups of the original shapes, but in the MESH module I pointed to the groups of the original objects. That explains the difference in the list of faces.

Once I point to the right name, wall.GetSubShapeIndices() or geompy.GetObjectIDs(wall) give the expected results.

Thank you

Claudio

 

 

Powered by Ploneboard
Document Actions