1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
4 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 # Tetrahedrization of the geometry generated by the Python script
25 # The new Netgen algorithm is used that discretizes baoundaries itself
30 compshell = SMESH_fixation.compshell
31 idcomp = SMESH_fixation.idcomp
32 geompy = SMESH_fixation.geompy
33 salome = SMESH_fixation.salome
35 print "Analysis of the geometry to be meshed :"
36 subShellList = geompy.SubShapeAll(compshell, geompy.ShapeType["SHELL"])
37 subFaceList = geompy.SubShapeAll(compshell, geompy.ShapeType["FACE"])
38 subEdgeList = geompy.SubShapeAll(compshell, geompy.ShapeType["EDGE"])
40 print "number of Shells in compshell : ", len(subShellList)
41 print "number of Faces in compshell : ", len(subFaceList)
42 print "number of Edges in compshell : ", len(subEdgeList)
44 status = geompy.CheckShape(compshell)
45 print " check status ", status
47 ### ---------------------------- SMESH --------------------------------------
48 smesh.SetCurrentStudy(salome.myStudy)
50 print "-------------------------- create Mesh, algorithm, hypothesis"
52 mesh = smesh.Mesh(compshell, "MeshcompShel");
53 netgen = mesh.Tetrahedron(smesh.FULL_NETGEN)
54 netgen.SetMaxSize( 50 )
55 #netgen.SetSecondOrder( 0 )
56 netgen.SetFineness( smesh.Fine )
57 #netgen.SetOptimize( 1 )
59 salome.sg.updateObjBrowser(1)
61 print "-------------------------- compute mesh"
65 print "Information about the MeshcompShel:"
66 print "Number of nodes : ", mesh.GetMesh().NbNodes()
67 print "Number of edges : ", mesh.GetMesh().NbEdges()
68 print "Number of faces : ", mesh.GetMesh().NbFaces()
69 print "Number of triangles : ", mesh.GetMesh().NbTriangles()
70 print "Number of volumes : ", mesh.GetMesh().NbVolumes()
71 print "Number of tetrahedrons : ", mesh.GetMesh().NbTetras()
74 print "problem when computing the mesh"