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 # Hexahedrization of the geometry generated by the Python script
24 # Hypothesis and algorithms for the mesh generation are global
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 # ---- init a Mesh with the compshell
49 shape_mesh = salome.IDToObject( idcomp )
51 mesh = smesh.Mesh(shape_mesh, "MeshCompShell")
54 # ---- set Hypothesis and Algorithm
56 print "-------------------------- NumberOfSegments"
60 regular1D = mesh.Segment()
61 regular1D.SetName("Wire Discretisation")
62 hypNbSeg = regular1D.NumberOfSegments(numberOfSegments)
63 print hypNbSeg.GetName()
64 print hypNbSeg.GetId()
65 print hypNbSeg.GetNumberOfSegments()
66 smesh.SetName(hypNbSeg, "NumberOfSegments_" + str(numberOfSegments))
68 print "-------------------------- Quadrangle_2D"
70 quad2D = mesh.Quadrangle()
71 quad2D.SetName("Quadrangle_2D")
73 print "-------------------------- Hexa_3D"
75 hexa3D = mesh.Hexahedron()
76 hexa3D.SetName("Hexa_3D")
79 salome.sg.updateObjBrowser(1)
81 print "-------------------------- compute compshell"
85 log = mesh.GetLog(0) # no erase trace
88 print "Information about the MeshcompShel:"
89 print "Number of nodes : ", mesh.NbNodes()
90 print "Number of edges : ", mesh.NbEdges()
91 print "Number of faces : ", mesh.NbFaces()
92 print "Number of quadrangles : ", mesh.NbQuadrangles()
93 print "Number of volumes : ", mesh.NbVolumes()
94 print "Number of hexahedrons : ", mesh.NbHexas()
96 print "problem when Computing the mesh"