Version: 8.3.0
 All Classes Namespaces Files Functions Variables Groups Pages
Generate flat elements


Double nodes on groups boundaries


Double nodes on shared faces between groups of volumes and create flat elements on demand.
The list of groups must contain at least two groups. The groups have to be disjoint: no common element into two different groups.
The nodes of the internal faces at the boundaries of the groups are doubled. Optionally, the internal faces are replaced by flat elements.
Triangles are transformed into prisms, and quadrangles into hexahedrons.
The flat elements are stored in groups of volumes. These groups are named according to the position of the group in the list: the group j_n_p is the group of the flat elements that are built between the group #n and the group #p in the list. If there is no shared faces between the group #n and the group #p in the list, the group j_n_p is not created. All the flat elements are gathered into the group named "joints3D" (or "joints2D" in 2D situation). The flat element of the multiple junctions between the simple junction are stored in a group named "jointsMultiples".



This example represents an iron cable (a thin cylinder) in a concrete bloc (a big cylinder). The big cylinder is defined by two geometric volumes.

1 # Double nodes on groups boundaries
2 
3 # This example represents an iron cable (a thin cylinder) in a concrete bloc (a big cylinder).
4 # The big cylinder is defined by two geometric volumes.
5 
6 
7 import salome
8 salome.salome_init()
9 import GEOM
10 from salome.geom import geomBuilder
11 geompy = geomBuilder.New(salome.myStudy)
12 
13 import SMESH, SALOMEDS
14 from salome.smesh import smeshBuilder
15 smesh = smeshBuilder.New(salome.myStudy)
16 
17 
18 # geometry
19 
20 O = geompy.MakeVertex(0, 0, 0)
21 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
22 OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
23 OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
24 Vertex_1 = geompy.MakeVertex(50, 0, 0)
25 Cylinder_1 = geompy.MakeCylinder(O, OX, 10, 500)
26 Cylinder_2 = geompy.MakeCylinder(Vertex_1, OX, 100, 400)
27 Vertex_2 = geompy.MakeVertex(-200, -200, -200)
28 Vertex_3 = geompy.MakeVertex(250, 200, 200)
29 Box_1 = geompy.MakeBoxTwoPnt(Vertex_2, Vertex_3)
30 Fuse_1 = geompy.MakeFuse(Cylinder_1, Cylinder_2)
31 Partition_1 = geompy.MakePartition([Fuse_1], [Cylinder_1, Box_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
32 [Solid_1,Solid_2] = geompy.GetShapesOnShape(Cylinder_1, Partition_1, geompy.ShapeType["SOLID"], GEOM.ST_IN)
33 [Solid_3,Solid_4] = geompy.GetShapesOnShape(Cylinder_2, Partition_1, geompy.ShapeType["SOLID"], GEOM.ST_IN)
34 Vertex_4 = geompy.MakeVertex(450, 0, 0)
35 Vertex_5 = geompy.MakeVertex(500, 0, 0)
36 Vertex_6 = geompy.MakeVertex(550, 0, 0)
37 vec1 = geompy.MakeVector(Vertex_4, Vertex_5)
38 vec2 = geompy.MakeVector(Vertex_5, Vertex_6)
39 [Face_1] = geompy.GetShapesOnPlane(Partition_1, geompy.ShapeType["FACE"], vec1, GEOM.ST_ON)
40 [Face_2] = geompy.GetShapesOnPlane(Partition_1, geompy.ShapeType["FACE"], vec2, GEOM.ST_ON)
41 
42 # meshing (we have linear tetrahedrons here, but other elements are OK)
43 
44 Mesh_1 = smesh.Mesh(Partition_1)
45 Regular_1D = Mesh_1.Segment()
46 Nb_Segments_1 = Regular_1D.NumberOfSegments(15)
47 MEFISTO_2D = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO)
48 Length_From_Edges_2D = MEFISTO_2D.LengthFromEdges()
49 ALGO3D = Mesh_1.Tetrahedron()
50 isDone = Mesh_1.Compute()
51 
52 # relevant groups of volumes and faces
53 
54 Solid_1_1 = Mesh_1.GroupOnGeom(Solid_1,'Solid_1',SMESH.VOLUME)
55 Solid_2_1 = Mesh_1.GroupOnGeom(Solid_2,'Solid_2',SMESH.VOLUME)
56 Solid_3_1 = Mesh_1.GroupOnGeom(Solid_3,'Solid_3',SMESH.VOLUME)
57 Solid_4_1 = Mesh_1.GroupOnGeom(Solid_4,'Solid_4',SMESH.VOLUME)
58 Face_1_1 = Mesh_1.GroupOnGeom(Face_1,'Face_1',SMESH.FACE)
59 Face_2_1 = Mesh_1.GroupOnGeom(Face_2,'Face_2',SMESH.FACE)
60 
61 # Building of flat elements
62 
63 Mesh_1.DoubleNodesOnGroupBoundaries([Solid_1_1, Solid_2_1, Solid_3_1, Solid_4_1], 1)
64 
65 Mesh_1.CreateFlatElementsOnFacesGroups([Face_1_1, Face_2_1])

Download this script


Here, the 4 groups of volumes [Solid_1_1, Solid_2_1, Solid_3_1, Solid_4_1] constitute a partition of the mesh. The flat elements on group boundaries and on faces are built with the 2 last lines of the code above.
If the last argument (Boolean) in DoubleNodesOnGroupBoundaries is set to 1, the flat elements are built, otherwise, there is only a duplication of the nodes.


To observe flat element groups, save the resulting mesh on a MED file and reload it.