Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 import SMESH_fixation
00029 import smesh
00030
00031 compshell = SMESH_fixation.compshell
00032 idcomp = SMESH_fixation.idcomp
00033 geompy = SMESH_fixation.geompy
00034 salome = SMESH_fixation.salome
00035
00036 print "Analysis of the geometry to be meshed :"
00037 subShellList = geompy.SubShapeAll(compshell, geompy.ShapeType["SHELL"])
00038 subFaceList = geompy.SubShapeAll(compshell, geompy.ShapeType["FACE"])
00039 subEdgeList = geompy.SubShapeAll(compshell, geompy.ShapeType["EDGE"])
00040
00041 print "number of Shells in compshell : ", len(subShellList)
00042 print "number of Faces in compshell : ", len(subFaceList)
00043 print "number of Edges in compshell : ", len(subEdgeList)
00044
00045 status = geompy.CheckShape(compshell)
00046 print " check status ", status
00047
00048
00049 smesh.SetCurrentStudy(salome.myStudy)
00050
00051
00052 shape_mesh = salome.IDToObject( idcomp )
00053
00054 mesh = smesh.Mesh(shape_mesh, "MeshCompShell")
00055
00056
00057
00058
00059 print "-------------------------- NumberOfSegments"
00060
00061 numberOfSegments = 5
00062
00063 regular1D = mesh.Segment()
00064 regular1D.SetName("Wire Discretisation")
00065 hypNbSeg = regular1D.NumberOfSegments(numberOfSegments)
00066 print hypNbSeg.GetName()
00067 print hypNbSeg.GetId()
00068 print hypNbSeg.GetNumberOfSegments()
00069 smesh.SetName(hypNbSeg, "NumberOfSegments_" + str(numberOfSegments))
00070
00071 print "-------------------------- Quadrangle_2D"
00072
00073 quad2D = mesh.Quadrangle()
00074 quad2D.SetName("Quadrangle_2D")
00075
00076 print "-------------------------- Hexa_3D"
00077
00078 hexa3D = mesh.Hexahedron()
00079 hexa3D.SetName("Hexa_3D")
00080
00081
00082 salome.sg.updateObjBrowser(1)
00083
00084 print "-------------------------- compute compshell"
00085 ret = mesh.Compute()
00086 print ret
00087 if ret != 0:
00088 log = mesh.GetLog(0)
00089 for linelog in log:
00090 print linelog
00091 print "Information about the MeshcompShel:"
00092 print "Number of nodes : ", mesh.NbNodes()
00093 print "Number of edges : ", mesh.NbEdges()
00094 print "Number of faces : ", mesh.NbFaces()
00095 print "Number of quadrangles : ", mesh.NbQuadrangles()
00096 print "Number of volumes : ", mesh.NbVolumes()
00097 print "Number of hexahedrons : ", mesh.NbHexas()
00098 else:
00099 print "problem when Computing the mesh"