7 # Geometry: an assembly of a box, a cylinder and a truncated cone
8 # meshed with tetrahedral
21 box = MakeBox(-cote, -cote, -cote, +cote, +cote, +cote)
24 pt1 = MakeVertex(0, 0, cote/3)
25 di1 = MakeVectorDXDYDZ(0, 0, 1)
26 cyl = MakeCylinder(pt1, di1, section, size)
28 # Build a truncated cone
29 pt2 = MakeVertex(0, 0, size)
30 cone = MakeCone(pt2, di1, radius_1, radius_2, height)
33 box_cyl = MakeFuse(box, cyl)
34 piece = MakeFuse(box_cyl, cone)
37 addToStudy(piece, name)
39 # Create a group of faces
40 group = CreateGroup(piece, ShapeType["FACE"])
41 group_name = name + "_grp"
42 addToStudy(group, group_name)
43 group.SetName(group_name)
45 # Add faces to the group
46 faces = SubShapeAllIDs(piece, ShapeType["FACE"])
47 UnionIDs(group, faces)
53 # Define a mesh on a geometry
54 tetra = smesh.Mesh(piece, name)
56 # Define 1D hypothesis
57 algo1d = tetra.Segment()
58 algo1d.LocalLength(10)
60 # Define 2D hypothesis
61 algo2d = tetra.Triangle()
62 algo2d.LengthFromEdges()
64 # Define 3D hypothesis
65 algo3d = tetra.Tetrahedron()
66 algo3d.MaxElementVolume(100)
71 # Create a groupe of faces