1 # CEA/LGLS 2004-2005, Francis KLOSS (OCC)
2 # =======================================
13 # Element of a grid compound by a square with a cylinder on each vertex build by points, edges, faces and solids
28 r3 = demi*math.sqrt(3)
33 piecePoint111 = MakeVertex(ox+rayon , oy, oz)
34 piecePoint211 = MakeVertex(ox+arete-rayon, oy, oz)
35 piecePoint112 = MakeVertex(ox , oy, oz+rayon)
36 piecePoint212 = MakeVertex(ox+arete , oy, oz+rayon)
37 piecePoint113 = MakeVertex(ox , oy, oz+arete-rayon)
38 piecePoint213 = MakeVertex(ox+arete , oy, oz+arete-rayon)
39 piecePoint114 = MakeVertex(ox+rayon , oy, oz+arete)
40 piecePoint214 = MakeVertex(ox+arete-rayon, oy, oz+arete)
42 pieceCenter1 = MakeVertex(ox , oy, oz)
43 pieceCenter2 = MakeVertex(ox+arete , oy, oz)
44 pieceCenter3 = MakeVertex(ox , oy, oz+arete)
45 pieceCenter4 = MakeVertex(ox+arete , oy, oz+arete)
47 piecePass1 = MakeVertex(ox+demi , oy, oz+r3)
48 piecePass2 = MakeVertex(ox+arete-demi , oy, oz+r3)
49 piecePass3 = MakeVertex(ox+arete-demi , oy, oz+arete-r3)
50 piecePass4 = MakeVertex(ox+demi , oy, oz+arete-r3)
55 pieceEdgeSquare1 = MakeEdge(piecePoint111, piecePoint211)
56 pieceEdgeSquare2 = MakeEdge(piecePoint114, piecePoint214)
57 pieceEdgeSquare3 = MakeEdge(piecePoint112, piecePoint113)
58 pieceEdgeSquare4 = MakeEdge(piecePoint212, piecePoint213)
60 pieceEdgeDiagonal1 = MakeEdge(piecePoint111, piecePoint213)
61 pieceEdgeDiagonal2 = MakeEdge(piecePoint112, piecePoint214)
63 pieceEdgeArc1 = MakeArc(piecePoint111, piecePass1, piecePoint112)
64 pieceEdgeArc2 = MakeArc(piecePoint211, piecePass2, piecePoint212)
65 pieceEdgeArc3 = MakeArc(piecePoint213, piecePass3, piecePoint214)
66 pieceEdgeArc4 = MakeArc(piecePoint113, piecePass4, piecePoint114)
71 pieceFace1 = MakeQuad(pieceEdgeSquare1, pieceEdgeArc2, pieceEdgeSquare4, pieceEdgeDiagonal1)
72 pieceFace2 = MakeQuad(pieceEdgeSquare2, pieceEdgeArc4, pieceEdgeSquare3, pieceEdgeDiagonal2)
74 pieceFace3 = MakeQuad(pieceEdgeArc1, pieceEdgeDiagonal1, pieceEdgeArc3, pieceEdgeDiagonal2)
79 pieceVector = MakeVectorDXDYDZ(0, 1, 0)
81 pieceSolid1 = MakePrismVecH(pieceFace1, pieceVector, hauteur)
82 pieceSolid2 = MakePrismVecH(pieceFace2, pieceVector, hauteur)
83 pieceSolid3 = MakePrismVecH(pieceFace3, pieceVector, hauteur)
88 c_cpd = MakeCompound([pieceSolid1, pieceSolid2, pieceSolid3])
90 piece = MakeGlueFaces(c_cpd, 1.e-5)
95 piece_id = addToStudy(piece, "ex09_grid4build")
100 # Create a hexahedral mesh
101 # ------------------------
103 hexa = smesh.Mesh(piece, "ex09_grid4build:hexa")
105 algo = hexa.Segment()
106 algo.NumberOfSegments(6)