Salome HOME
Comment out the example.
[modules/smesh.git] / src / SMESH_SWIG / grid4partition.py
1 # CEA/LGLS 2004, Francis KLOSS (OCC)
2 # ==================================
3
4 # Import
5 # ------
6
7 from geompy import *
8 from meshpy import *
9
10 # Piece
11 # -----
12
13 # grid compound by a square with a cylinder on each vertex
14
15 # Geometry
16 # --------
17
18 ox = 0
19 oy = 0
20 oz = 0
21
22 arete   =  50
23 hauteur = 100
24 rayon   =  10
25
26 g_trim = 1000
27
28 # Box
29 # ---
30
31 piecePoint = MakeVertex(ox, oy, oz)
32
33 pieceBox = MakeBoxTwoPnt(piecePoint, MakeVertex(ox+arete, oy+hauteur, oz+arete))
34
35 # Cut by cylinders
36 # ----------------
37
38 dirUp = MakeVectorDXDYDZ(0, 1, 0)
39
40 pieceCut1 = MakeCut(pieceBox , MakeCylinder(piecePoint                        , dirUp, rayon, hauteur))
41 pieceCut2 = MakeCut(pieceCut1, MakeCylinder(MakeVertex(ox+arete, oy, oz      ), dirUp, rayon, hauteur))
42 pieceCut3 = MakeCut(pieceCut2, MakeCylinder(MakeVertex(ox      , oy, oz+arete), dirUp, rayon, hauteur))
43 pieceCut4 = MakeCut(pieceCut3, MakeCylinder(MakeVertex(ox+arete, oy, oz+arete), dirUp, rayon, hauteur))
44
45 # Compound by make a partition of a solid
46 # ---------------------------------------
47
48 dir = MakeVectorDXDYDZ(-1, 0, 1)
49
50 tools = []
51 tools.append(MakePlane(MakeVertex(ox+rayon, oy, oz      ), dir, g_trim))
52 tools.append(MakePlane(MakeVertex(ox      , oy, oz+rayon), dir, g_trim))
53
54 piece = MakePartition([pieceCut4], tools, [], [], ShapeType["SOLID"])
55
56 # Add in study
57 # ------------
58
59 piece_id = addToStudy(piece, "Grid4partition")
60
61 # Meshing
62 # =======
63
64 # Create hexahedrical mesh on piece
65 # ---------------------------------
66
67 m_hexa=MeshHexa(piece, 4, "Grid4partitionHexa")
68
69 # Compute
70 # -------
71
72 m_hexa.Compute()