1 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # ==================================
31 # an assembly of a box, a cylinder and a truncated cone meshed with tetrahedral.
50 box = MakeBox(-cote, -cote, -cote, +cote, +cote, +cote)
55 pt1 = MakeVertex(0, 0, cote/3)
56 di1 = MakeVectorDXDYDZ(0, 0, 1)
57 cyl = MakeCylinder(pt1, di1, section, size)
59 # Build a truncated cone
60 # ----------------------
62 pt2 = MakeVertex(0, 0, size)
63 cone = MakeCone(pt2, di1, radius_1, radius_2, height)
68 box_cyl = MakeFuse(box, cyl)
69 piece = MakeFuse(box_cyl, cone)
74 addToStudy(piece, name)
76 # Create a group of faces
77 # -----------------------
79 group = CreateGroup(piece, ShapeType["FACE"])
81 group_name = name + "_grp"
82 addToStudy(group, group_name)
83 group.SetName(group_name)
85 # Add faces in the group
86 # ----------------------
88 faces = SubShapeAllIDs(piece, ShapeType["FACE"])
90 UnionIDs(group, faces)
95 # Define a mesh on a geometry
96 # ---------------------------
98 tetra = smesh.Mesh(piece, name)
100 # Define 1D hypothesis
101 # --------------------
103 algo1d = tetra.Segment()
104 algo1d.LocalLength(10)
106 # Define 2D hypothesis
107 # --------------------
109 algo2d = tetra.Triangle()
110 algo2d.LengthFromEdges()
112 # Define 3D hypothesis
113 # --------------------
115 algo3d = tetra.Tetrahedron(smesh.NETGEN)
116 algo3d.MaxElementVolume(100)
123 # Create a groupe of faces
124 # ------------------------