1 # CEA/LGLS 2004-2005, Francis KLOSS (OCC)
2 # =======================================
11 # 5 box with a hexahedral mesh and with 2 box in tetrahedral mesh
26 box_tetra1 = MakeBox(arete0, arete0, 0, arete1, arete1, arete)
28 box_ijk1 = MakeBox(arete1, arete0, 0, arete2, arete1, arete)
30 box_hexa = MakeBox(arete1, arete1, 0, arete2, arete2, arete)
32 box_ijk2 = MakeBox(arete2, arete1, 0, arete3, arete2, arete)
34 box_tetra2 = MakeBox(arete2, arete2, 0, arete3 ,arete3, arete)
39 piece_cpd = MakeCompound([box_tetra1, box_ijk1, box_hexa, box_ijk2, box_tetra2])
41 piece = MakeGlueFaces(piece_cpd, 1e-4)
43 piece_id = addToStudy(piece, "ex04_cube5tetraHexa")
48 # Create a hexahedral mesh
49 # ------------------------
51 mixed = smesh.Mesh(piece, "ex04_cube5tetraHexa:mixed")
53 algo = mixed.Segment()
55 algo.StartEndLength(3, 25)
61 # Tetrahedral local mesh
62 # ----------------------
64 def localMesh(b, hyp):
65 box = GetInPlace(piece, b)
66 faces = SubShapeAll(box, ShapeType["FACE"])
71 algo = mixed.Triangle(faces[i])
73 algo.MaxElementArea(80)
75 algo.LengthFromEdges()
78 algo = mixed.Tetrahedron(smesh.NETGEN, box)
79 algo.MaxElementVolume(400)
81 localMesh(box_tetra1, 1)
82 localMesh(box_tetra2, 0)