2 # -*- coding: iso-8859-1 -*-
3 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
5 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
6 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
8 # This library is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public
10 # License as published by the Free Software Foundation; either
11 # version 2.1 of the License.
13 # This library is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Lesser General Public License for more details.
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with this library; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 # Hexahedrization of the geometry generated by the Python script
26 # Hypothesis and algorithms for the mesh generation are global
31 compshell = SMESH_fixation.compshell
32 idcomp = SMESH_fixation.idcomp
33 geompy = SMESH_fixation.geompy
34 salome = SMESH_fixation.salome
36 print "Analysis of the geometry to be meshed :"
37 subShellList = geompy.SubShapeAll(compshell, geompy.ShapeType["SHELL"])
38 subFaceList = geompy.SubShapeAll(compshell, geompy.ShapeType["FACE"])
39 subEdgeList = geompy.SubShapeAll(compshell, geompy.ShapeType["EDGE"])
41 print "number of Shells in compshell : ", len(subShellList)
42 print "number of Faces in compshell : ", len(subFaceList)
43 print "number of Edges in compshell : ", len(subEdgeList)
45 status = geompy.CheckShape(compshell)
46 print " check status ", status
48 ### ---------------------------- SMESH --------------------------------------
50 # ---- init a Mesh with the compshell
51 shape_mesh = salome.IDToObject( idcomp )
53 mesh = smesh.Mesh(shape_mesh, "MeshCompShell")
56 # ---- set Hypothesis and Algorithm
58 print "-------------------------- NumberOfSegments"
62 regular1D = mesh.Segment()
63 regular1D.SetName("Wire Discretisation")
64 hypNbSeg = regular1D.NumberOfSegments(numberOfSegments)
65 print hypNbSeg.GetName()
66 print hypNbSeg.GetId()
67 print hypNbSeg.GetNumberOfSegments()
68 smesh.SetName(hypNbSeg, "NumberOfSegments_" + str(numberOfSegments))
70 print "-------------------------- Quadrangle_2D"
72 quad2D = mesh.Quadrangle()
73 quad2D.SetName("Quadrangle_2D")
75 print "-------------------------- Hexa_3D"
77 hexa3D = mesh.Hexahedron()
78 hexa3D.SetName("Hexa_3D")
81 salome.sg.updateObjBrowser(1)
83 print "-------------------------- compute compshell"
87 log = mesh.GetLog(0) # no erase trace
90 print "Information about the MeshcompShel:"
91 print "Number of nodes : ", mesh.NbNodes()
92 print "Number of edges : ", mesh.NbEdges()
93 print "Number of faces : ", mesh.NbFaces()
94 print "Number of quadrangles : ", mesh.NbQuadrangles()
95 print "Number of volumes : ", mesh.NbVolumes()
96 print "Number of hexahedrons : ", mesh.NbHexas()
98 print "problem when Computing the mesh"