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
00053 mesh = smesh.Mesh(compshell, "MeshcompShell")
00054
00055
00056
00057
00058 print "-------------------------- NumberOfSegments"
00059
00060 numberOfSegments = 5
00061
00062 regular1D = mesh.Segment()
00063 regular1D.SetName("Wire Discretisation")
00064 hypNbSeg = regular1D.NumberOfSegments(numberOfSegments)
00065 print hypNbSeg.GetName()
00066 print hypNbSeg.GetId()
00067 print hypNbSeg.GetNumberOfSegments()
00068 smesh.SetName(hypNbSeg, "NumberOfSegments_" + str(numberOfSegments))
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 print "-------------------------- LengthFromEdges"
00083
00084 mefisto2D = mesh.Triangle()
00085 mefisto2D.SetName("MEFISTO_2D")
00086 hypLengthFromEdges = mefisto2D.LengthFromEdges()
00087 print hypLengthFromEdges.GetName()
00088 print hypLengthFromEdges.GetId()
00089 smesh.SetName(hypLengthFromEdges, "LengthFromEdges")
00090
00091
00092 print "-------------------------- MaxElementVolume"
00093
00094 maxElementVolume = 1000
00095
00096 netgen3D = mesh.Tetrahedron(smesh.NETGEN)
00097 netgen3D.SetName("NETGEN_3D")
00098 hypVolume = netgen3D.MaxElementVolume(maxElementVolume)
00099 print hypVolume.GetName()
00100 print hypVolume.GetId()
00101 print hypVolume.GetMaxElementVolume()
00102 smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
00103
00104
00105 salome.sg.updateObjBrowser(1)
00106
00107 print "-------------------------- compute compshell"
00108 ret = mesh.Compute(mesh)
00109 print ret
00110 if ret != 0:
00111 log = mesh.GetLog(0)
00112 for linelog in log:
00113 print linelog
00114 print "Information about the MeshcompShel:"
00115 print "Number of nodes : ", mesh.NbNodes()
00116 print "Number of edges : ", mesh.NbEdges()
00117 print "Number of faces : ", mesh.NbFaces()
00118 print "Number of triangles : ", mesh.NbTriangles()
00119 print "Number of volumes : ", mesh.NbVolumes()
00120 print "Number of tetrahedrons : ", mesh.NbTetras()
00121
00122 else:
00123 print "problem when computing the mesh"