1 # CEA/LGLS 2004-2005, Francis KLOSS (OCC)
2 # =======================================
11 # grid compound of 3 x 3 elements
12 # an element is compound of 3 cylinders concentriques
13 # an element is centered in a square of the grid
14 # the smaller cylinder is a hole
16 # prism the grid, and mesh it in hexahedral way
39 e_boite = MakeBox(g_x-g_arete, g_y-g_hauteur, g_z-g_arete, g_x+g_arete, g_y+g_hauteur, g_z+g_arete)
41 e_hauteur = 2*g_hauteur
42 e_centre = MakeVertex(g_x, g_y-g_hauteur, g_z)
43 e_dir = MakeVectorDXDYDZ(0, 1, 0)
45 e_cyl1 = MakeCylinder(e_centre, e_dir, g_rayon3, e_hauteur)
47 e_blo1 = MakeCut(e_boite, e_cyl1)
49 e_cyl2 = MakeCylinder(e_centre, e_dir, g_rayon2, e_hauteur)
51 e_blo2 = MakeCut(e_cyl1, e_cyl2)
53 e_cyl3 = MakeCylinder(e_centre, e_dir, g_rayon1, e_hauteur)
55 e_blo3 = MakeCut(e_cyl2, e_cyl3)
57 # Partition and repair
58 # --------------------
61 p_tools.append(MakePlane(e_centre, MakeVectorDXDYDZ( 1, 0, 1), g_trim))
62 p_tools.append(MakePlane(e_centre, MakeVectorDXDYDZ(-1, 0, 1), g_trim))
64 p_part = MakePartition([e_blo1, e_blo2, e_blo3], p_tools, [], [], ShapeType["SOLID"])
66 p_element = RemoveExtraEdges(p_part)
71 grid = MakeMultiTranslation2D(p_element, MakeVectorDXDYDZ(1, 0, 0), 2*g_arete, g_grid, MakeVectorDXDYDZ(0, 0, 1), 2*g_arete, g_grid)
73 piece = MakeGlueFaces(grid, 1e-5)
78 piece_id = addToStudy(piece, "ex11_grid3partition")
83 # Create a hexahedral mesh
84 # ------------------------
86 hexa = smesh.Mesh(piece, "ex11_grid3partition:hexa")
89 algo.NumberOfSegments(3)