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 # Tetrahedrization of the geometry generated by the Python script
24 # The new Netgen algorithm is used that discretizes baoundaries itself
29 compshell = SMESH_fixation.compshell
30 idcomp = SMESH_fixation.idcomp
31 geompy = SMESH_fixation.geompy
32 salome = SMESH_fixation.salome
34 print "Analysis of the geometry to be meshed :"
35 subShellList = geompy.SubShapeAll(compshell, geompy.ShapeType["SHELL"])
36 subFaceList = geompy.SubShapeAll(compshell, geompy.ShapeType["FACE"])
37 subEdgeList = geompy.SubShapeAll(compshell, geompy.ShapeType["EDGE"])
39 print "number of Shells in compshell : ", len(subShellList)
40 print "number of Faces in compshell : ", len(subFaceList)
41 print "number of Edges in compshell : ", len(subEdgeList)
43 status = geompy.CheckShape(compshell)
44 print " check status ", status
46 ### ---------------------------- SMESH --------------------------------------
48 print "-------------------------- create Mesh, algorithm, hypothesis"
50 mesh = smesh.Mesh(compshell, "MeshcompShel");
51 netgen = mesh.Tetrahedron(smesh.FULL_NETGEN)
52 netgen.SetMaxSize( 50 )
53 #netgen.SetSecondOrder( 0 )
54 netgen.SetFineness( smesh.Fine )
55 #netgen.SetOptimize( 1 )
57 salome.sg.updateObjBrowser(1)
59 print "-------------------------- compute mesh"
63 print "Information about the MeshcompShel:"
64 print "Number of nodes : ", mesh.GetMesh().NbNodes()
65 print "Number of edges : ", mesh.GetMesh().NbEdges()
66 print "Number of faces : ", mesh.GetMesh().NbFaces()
67 print "Number of triangles : ", mesh.GetMesh().NbTriangles()
68 print "Number of volumes : ", mesh.GetMesh().NbVolumes()
69 print "Number of tetrahedrons : ", mesh.GetMesh().NbTetras()
72 print "problem when computing the mesh"