Personal tools
You are here: Home Forum How to use Salome? Which edge will hold a non-empty mesh?

Which edge will hold a non-empty mesh?

Up to How to use Salome?

Which edge will hold a non-empty mesh?

Posted by Zoltan Csati at January 24. 2021

Hi,

 

When a 2D geometry, loaded from a STEP file, is exploded into edges, two overlapping edges are created by Salome for a pair of neighboring faces. I want to keep only one of them. Identifying which edges overlap is easy, but it is not indifferent which edge I keep out of the two. The reason is that after the meshing, I want to extract the 1D mesh on the edges. I noticed that only one of the two edges will hold a mesh when I execute GroupOnGeom. My workflow is:

  1. Identify the overlapping edges
  2. Create the 2D mesh on the geometry
  3. Extract the mesh groups for each edge
  4. Remove that edge out of the two overlapping ones whose mesh is empty (using the IsEmpty() method)
The problem is that I cannot finish dealing with the geometry (by removing the unnecessary edges) before the meshing procedure. Is there a way to know in advance which edge out of the two overlapping edges will hold a non-empty 1D mesh? That would allow me to decouple the geometry manipulations from the mesh processing.
 
 
Thank you,
Zoltan

Re: Which edge will hold a non-empty mesh?

Posted by SMESH expert at January 26. 2021

Hello Zoltan

If there are two overlapping edges, Mesh module generates 1D mesh on the both, so that GroupOnGeom won't be empty for any of them. This can change if you apply Merge Equal Nodes and Merge Equal Elements, provided that the equal edges are divided equally within a merge tolerance. In such a case the mesh remains on an edge with lower ID.

Best regards

Edward

Re: Which edge will hold a non-empty mesh?

Posted by Zoltan Csati at January 26. 2021

Dear Edward,

 

I didn't perform Merge Equal Nodes or Merge Equal Elements.

I created a simple test example, two squares touching each other along a common side. Then I created a compound object out of the two faces (squares) to mimic my scenario when a STEP file is loaded as a Compound. Next, I exploded the compound into two faces, and then the faces to edges. This way, I obtained two  overlapping edges. After having generated the mesh on the compound object, I created two edge groups based on the two overlapping edges. You were right, both of them hold a mesh.

 

Since this toy example couldn't reproduce the behaviour I experienced with my geometry, I attached the script to run. Could you please take a look at it? The STEP file can be downloaded from here.

If you execute the script in Salome GUI, you will see that the compound object, called microstructure, is exploded into faces: Face_1, ..., Face_234. The faces are also exploded to edges. If in the Mesh module you create mesh groups on Edge_1 (belongs to Face_1) and on Edge_6 (part of Face_3), you will see that only the mesh on Edge_1 has elements. Can you explain why it is the case?

 

Attachments

Re: Which edge will hold a non-empty mesh?

Posted by SMESH expert at January 26. 2021

This is a feature of NETGEN that it does Merge Equal Nodes before generating elements. It can be deactivated in NETGEN_Parameters_2D > Advanced > Insider > Fuse coincident nodes on edges and vertices.

NETGEN divide edges with lower ID before those with upper ID, so edges with upper ID have no mesh.

geompy.GetSubShapeID( microstructure.geometry, Face_1 )

Best regards

Edward

Re: Which edge will hold a non-empty mesh?

Posted by Zoltan Csati at January 28. 2021

Dear Edward,

 

Could you give me a link to the documentation where I can find how the IDs are allocated (I searched for it in the KERNEL docs as studies should be there)? I use the following code to find the ID of a Salome object, such as an Edge or a Face:


salome.myStudy.FindObject(salome_object.GetName()).GetID()

 


It gives me IDs like 0:1:1:1:2:2 or 0:1:1:1:235. In this example, two consecutive edges have these IDs. I need to understand the logic, otherwise how could I compare IDs?

 

 

Thank you,

Zoltan

p, li { white-space: pre-wrap; }p, li { white-space: pre-wrap; }p, li { white-space: pre-wrap; }

 

Previously SMESH expert wrote:

This is a feature of NETGEN that it does Merge Equal Nodes before generating elements. It can be deactivated in NETGEN_Parameters_2D > Advanced > Insider > Fuse coincident nodes on edges and vertices.

NETGEN divide edges with lower ID before those with upper ID, so edges with upper ID have no mesh.

geompy.GetSubShapeID( microstructure.geometry, Face_1 )

Best regards

Edward

 

Re: Which edge will hold a non-empty mesh?

Posted by SMESH expert at January 28. 2021

Dear Zoltan

ID here means an integer number which refers a sub-shape within a shape. One sees these IDs in Create Group dialog in Geometry module. A sub-shape implicitly gets its ID in a process of exploding a shape into all sub-shapes.

Best regards

Edward

Re: Which edge will hold a non-empty mesh?

Posted by Zoltan Csati at January 28. 2021

Thank you.

 

Comparing IDs works sometimes, but not always. For example when two overlapping edges belong to faces with names and IDs ('Face_105', '0:1:1:1:105') and ('Face_126', '0:1:1:1:126'), respectively, NETGEN should generate the mesh on the edge that belongs to 'Face_105'. However, it generates it on the other edge, i.e. on the one that belongs to 'Face_126'.

Do you know why it is so?

 

Sincerely,

Zoltan

p, li { white-space: pre-wrap; }p, li { white-space: pre-wrap; }

Re: Which edge will hold a non-empty mesh?

Posted by SMESH expert at January 29. 2021

Most probably this is because New Entity > Explode publishes sub-shapes in the order given by Sort function, which is different from the order given by ID assignment procedure.

Sort function is activated by isSorted option of functions exploding a shape into sub-shapes, e.g.

def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):

In your script you can get the ID influencing presence of  mesh on an edge by calling

geompy.GetSubShapeID( shape, edge )

Best regards

Edward

Re: Which edge will hold a non-empty mesh?

Posted by Zoltan Csati at January 29. 2021

Dear Edward,

 

Thank you a lot. After keeping the isSorted parameter False (i.e. the default behaviour), comparing IDs works as expected.

 

Sincerely,

Zoltan

Powered by Ploneboard
Document Actions