Salome HOME
Merge from V6_3_BR 06/06/2011
[modules/smesh.git] / doc / salome / gui / SMESH / input / tui_generate_flat_elements.doc
1 /*!
2
3 \page tui_generate_flat_elements_page Generate flat elements
4
5 <br>
6 \anchor tui_double_nodes_on_group_boundaries
7 <h2>Double nodes on groups boundaries</h2>
8
9 \n Double nodes on shared faces between groups of volumes and create flat elements on demand.
10 \n The list of groups must describe a partition of the mesh volumes.The nodes of the internal
11 faces at the boundaries of the groups are doubled. In option, the internal faces are replaced
12 by flat elements.
13 \n Triangles are transformed in prisms, and quadrangles in hexahedrons.
14 \n The flat elements are stored in groups of volumes.
15
16 \n
17 \n This example represents an iron cable (a thin cylinder) in a concrete bloc (a big cylinder).
18 The big cylinder is defined by two geometric volumes.
19
20 \code
21 # geometry 
22
23 O = geompy.MakeVertex(0, 0, 0)
24 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
25 OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
26 OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
27 Vertex_1 = geompy.MakeVertex(50, 0, 0)
28 Cylinder_1 = geompy.MakeCylinder(O, OX, 10, 500)
29 Cylinder_2 = geompy.MakeCylinder(Vertex_1, OX, 100, 400)
30 Vertex_2 = geompy.MakeVertex(-200, -200, -200)
31 Vertex_3 = geompy.MakeVertex(250, 200, 200)
32 Box_1 = geompy.MakeBoxTwoPnt(Vertex_2, Vertex_3)
33 Cut_1 = geompy.MakeCut(Cylinder_2, Cylinder_1)
34 Partition_2 = geompy.MakePartition([Cut_1], [Box_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
35 Fuse_1 = geompy.MakeFuse(Partition_2, Cylinder_1)
36 Partition_1 = geompy.MakePartition([Fuse_1], [Cylinder_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
37 [Solid_1,Solid_2,Solid_3] = geompy.SubShapes(Partition_1, [53, 2, 30])
38 [Face_1,Face_2] = geompy.SubShapes(Partition_1, [37, 20])
39
40 # meshing (linear tetrahedrons here, but other elements are OK)
41
42 Mesh_1 = smesh.Mesh(Partition_1)
43 BLSURF = Mesh_1.Triangle(algo=smesh.BLSURF)
44 BLSURF_Parameters = BLSURF.Parameters()
45 BLSURF_Parameters.SetPhysicalMesh( 0 )
46 BLSURF_Parameters.SetGeometricMesh( 1 )
47 BLSURF_Parameters.SetAngleMeshS( 16 )
48 BLSURF_Parameters.SetAngleMeshC( 16 )
49 GHS3D_3D = Mesh_1.Tetrahedron(algo=smesh.GHS3D)
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 Face_1_1 = Mesh_1.GroupOnGeom(Face_1,'Face_1',SMESH.FACE)
58 Face_2_1 = Mesh_1.GroupOnGeom(Face_2,'Face_2',SMESH.FACE)
59
60 \endcode
61
62 \n Here, the 3 groups of volumes [Solid_1_1, Solid_2_1, Solid_3_1] constitute a partition of the mesh.
63 The flat elements on group boundaries and on faces are built with the following code.
64 \n If the last argument (boolean) in DoubleNodesOnGroupBoundaries is set to 1,
65 the flat elements are built, otherwise, there is only a duplication of the nodes.
66
67 \code
68 Mesh_1.DoubleNodesOnGroupBoundaries([Solid_1_1, Solid_2_1, Solid_3_1], 1)
69
70 Mesh_1.CreateFlatElementsOnFacesGroups([Face_1_1, Face_2_1])
71 \endcode
72
73 \n To observe the flat element groups, save the resulting mesh on a Med file and reload it.
74
75 */