Salome HOME
Debug algorithms and hypotheses assignment
[modules/smesh.git] / src / SMESH_SWIG / ex17_dome1.py
1 # CEA/LGLS 2004-2005, Francis KLOSS (OCC)
2 # =======================================
3
4 from geompy import *
5
6 import smesh
7
8 # Geometrie
9 # =========
10
11 # Creer un cylindre surplombe d'une demi-sphere le tout troue par un petit cylindre.
12 # Decouper en hexahedre et mailler.
13
14 # Donnees
15 # -------
16
17 cylindre_rayon   = 100
18 cylindre_hauteur = 400
19
20 trou_rayon = 20
21 trou_z     = cylindre_rayon/2
22
23 plan_trim = 2000
24
25 # Cylindre
26 # --------
27
28 cylindre_base = MakeVertex(0, 0, 0)
29 cylindre_dir  = MakeVectorDXDYDZ(1, 0, 0)
30 cylindre      = MakeCylinder(cylindre_base, cylindre_dir, cylindre_rayon, cylindre_hauteur)
31
32 # Dome
33 # ----
34
35 dome_sphere = MakeSpherePntR(cylindre_base, cylindre_rayon)
36 dome        = MakeFuse(dome_sphere, cylindre)
37
38 # Cheminee
39 # --------
40
41 cheminee_base = MakeVertex(-cylindre_hauteur/2, 0, trou_z)
42 cheminee_trou = MakeCylinder(cheminee_base, cylindre_dir, trou_rayon, 2*cylindre_hauteur)
43 cheminee      = MakeCut(dome, cheminee_trou)
44
45 # Decoupage et reparation
46 # -----------------------
47
48 blocs_plan1 = MakePlane(cheminee_base, MakeVectorDXDYDZ(0, 1, 0), plan_trim)
49 blocs_plan2 = MakePlane(cheminee_base, MakeVectorDXDYDZ(0, 0, 1), plan_trim)
50
51 blocs_part = MakePartition([cheminee], [blocs_plan1, blocs_plan2], [], [], ShapeType["SOLID"])
52
53 piece = RemoveExtraEdges(blocs_part)
54
55 # Etude
56 # -----
57
58 piece_id = addToStudy(piece, "ex17_dome1")
59
60 # Maillage
61 # ========
62
63 # Maillage hexahedrique
64 # ---------------------
65
66 hexa = smesh.Mesh(piece, "ex17_dome1:hexa")
67
68 algo = hexa.Segment()
69 algo.NumberOfSegments(20)
70
71 hexa.Quadrangle()
72
73 hexa.Hexahedron()
74
75 # Calcul du maillage
76 # ------------------
77
78 hexa.Compute()