1 # CEA/LGLS 2004-2005, Francis KLOSS (OCC)
2 # =======================================
11 # Create the hexahedrical block geometry of a holed parallelepipede.
12 # The hole has a T form composed by 2 cylinders with different radius, and their axis are normal.
13 # This piece is meshed in hexahedrical.
34 p_boite = MakeBox(gx-g_dx, gy-g_dy, gz-g_dz, gx+g_dx, gy+g_dy, gz+g_dz)
39 g_base = MakeVertex(gx-g_dx, gy, gz)
40 g_dir = MakeVectorDXDYDZ(1, 0, 0)
41 g_cyl = MakeCylinder(g_base, g_dir, g_rayonGrand, g_dx*2)
46 b_boite = MakeCut(p_boite , g_cyl)
51 p_base = MakeVertex(gx, gy, gz)
55 p_tools.append(MakePlane(p_base, MakeVectorDXDYDZ(0, 1 , 0 ), g_trim))
56 p_tools.append(MakePlane(p_base, MakeVectorDXDYDZ(0, g_dz, g_dy), g_trim))
57 p_tools.append(MakePlane(p_base, MakeVectorDXDYDZ(0, -g_dz, g_dy), g_trim))
59 p_tools.append(MakePlane(MakeVertex(gx-g_rayonPetit, gy, gz), g_dir, g_trim))
60 p_tools.append(MakePlane(MakeVertex(gx+g_rayonPetit, gy, gz), g_dir, g_trim))
62 p_piece = MakePartition([b_boite], p_tools, [], [], ShapeType["SOLID"])
67 c_cyl = MakeCylinder(p_base, MakeVectorDXDYDZ(0, 0, 1), g_rayonPetit, g_dz)
72 d_element = SubShapeAllSorted(p_piece, ShapeType["SOLID"])
74 d_element[ 8] = MakeCut(d_element[ 8], c_cyl)
75 d_element[10] = MakeCut(d_element[10], c_cyl)
80 piece = RemoveExtraEdges(MakeCompound(d_element))
85 piece_id = addToStudy(piece, "ex16_cyl2complementary")
90 # Create a hexahedral mesh
91 # ------------------------
93 hexa = smesh.Mesh(piece, "ex16_cyl2complementary:hexa")
96 algo.NumberOfSegments(12)
102 # Define local hypothesis
103 # -----------------------
105 def local(x, y, z, d):
106 edge = GetEdgeNearPoint(piece, MakeVertex(x, y, z))
107 algo = hexa.Segment(edge)
108 algo.NumberOfSegments(d)
111 local(gx , gy+g_dy, gz+g_dz, 7)
112 local(gx+g_dx, gy+g_dy, gz , 21)
113 local(gx+g_dx, gy-g_dy, gz , 21)