1 # Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # CEA/LGLS 2006, Francis KLOSS (OCC)
21 # ==================================
30 # an assembly of a box, a cylinder and a truncated cone meshed with tetrahedral.
49 box = MakeBox(-cote, -cote, -cote, +cote, +cote, +cote)
54 pt1 = MakeVertex(0, 0, cote/3)
55 di1 = MakeVectorDXDYDZ(0, 0, 1)
56 cyl = MakeCylinder(pt1, di1, section, size)
58 # Build a truncated cone
59 # ----------------------
61 pt2 = MakeVertex(0, 0, size)
62 cone = MakeCone(pt2, di1, radius_1, radius_2, height)
67 box_cyl = MakeFuse(box, cyl)
68 piece = MakeFuse(box_cyl, cone)
73 addToStudy(piece, name)
75 # Create a group of faces
76 # -----------------------
78 group = CreateGroup(piece, ShapeType["FACE"])
80 group_name = name + "_grp"
81 addToStudy(group, group_name)
82 group.SetName(group_name)
84 # Add faces in the group
85 # ----------------------
87 faces = SubShapeAllIDs(piece, ShapeType["FACE"])
89 UnionIDs(group, faces)
94 # Define a mesh on a geometry
95 # ---------------------------
97 tetra = smesh.Mesh(piece, name)
99 # Define 1D hypothesis
100 # --------------------
102 algo1d = tetra.Segment()
103 algo1d.LocalLength(10)
105 # Define 2D hypothesis
106 # --------------------
108 algo2d = tetra.Triangle()
109 algo2d.LengthFromEdges()
111 # Define 3D hypothesis
112 # --------------------
114 algo3d = tetra.Tetrahedron(smesh.NETGEN)
115 algo3d.MaxElementVolume(100)
122 # Create a groupe of faces
123 # ------------------------