\r
<h3>Viewing Mesh Infos</h3>\r
\r
-<p class="whs1">import salome</p>\r
+<p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import \r
+ geompy</span></p>\r
\r
-<p class="whs1">import geompy</p>\r
-\r
-<p class="whs1">import SMESH</p>\r
-\r
-<p class="whs1">import StdMeshers</p>\r
-\r
-<p class="whs1"> </p>\r
-\r
-<p class="whs1">smesh = salome.lcc.FindOrLoadComponent("FactoryServer", \r
- "SMESH")</p>\r
-\r
-<p class="whs1">smesh.SetCurrentStudy(salome.myStudy)</p>\r
-\r
-<p class="whs1"> </p>\r
-\r
-<p class="whs1">box = \r
- geompy.MakeBox(0., 0., 0., 20., 20., 20.)</p>\r
-\r
-<p class="whs1">idbox = geompy.addToStudy(box, "box")</p>\r
+<p class="whs1">import smesh</p>\r
\r
<p class="whs1"> </p>\r
\r
-<p class="whs1">subShapeList = geompy.SubShapeAll(box, \r
- geompy.ShapeType["EDGE"])</p>\r
+<p class="whs2"># create a box</p>\r
\r
-<p class="whs1">edge = \r
- subShapeList[0]</p>\r
+<p class="whs1">box = geompy.MakeBox(0., 0., 0., 20., \r
+ 20., 20.)</p>\r
\r
-<p class="whs1">name = \r
- geompy.SubShapeName(edge, box)</p>\r
-\r
-<p class="whs1">idedge = geompy.addToStudyInFather(box, \r
- edge, name)</p>\r
+<p class="whs1">geompy.addToStudy(box, "box")</p>\r
\r
<p class="whs1"> </p>\r
\r
-<p class="whs1">box = \r
- salome.IDToObject(idbox)</p>\r
+<p class="whs2"># create a mesh</p>\r
\r
-<p class="whs1">edge = salome.IDToObject(idedge)</p>\r
+<p class="whs1">tetra = smesh.Mesh(box, "MeshBox")</p>\r
\r
<p class="whs1"> </p>\r
\r
-<p class="whs1">hyp1 = smesh.CreateHypothesis("NumberOfSegments", \r
- "libStdMeshersEngine.so")</p>\r
-\r
-<p class="whs1">hyp1.SetNumberOfSegments(3)</p>\r
-\r
-<p class="whs1">hyp2 = smesh.CreateHypothesis("MaxElementArea", \r
- "libStdMeshersEngine.so")</p>\r
-\r
-<p class="whs1">hyp2.SetMaxElementArea(10)</p>\r
-\r
-<p class="whs1">hyp3 = smesh.CreateHypothesis("Arithmetic1D", \r
- "libStdMeshersEngine.so")</p>\r
-\r
-<p class="whs1">hyp3.SetLength(1,1)</p>\r
+<p class="whs1">algo1D = tetra.Segment()</p>\r
\r
-<p class="whs1">hyp3.SetLength(6,0)</p>\r
-\r
-<p class="whs1">hyp4 = smesh.CreateHypothesis("Propagation", \r
- "libStdMeshersEngine.so")</p>\r
+<p class="whs1">algo1D.NumberOfSegments(3)</p>\r
\r
<p class="whs1"> </p>\r
\r
-<p class="whs1">algo1 = smesh.CreateHypothesis("Regular_1D", \r
- "libStdMeshersEngine.so")</p>\r
-\r
-<p class="whs1">algo2 = smesh.CreateHypothesis("MEFISTO_2D", \r
- "libStdMeshersEngine.so")</p>\r
+<p class="whs1">algo2D = tetra.Triangle()</p>\r
\r
-<p class="whs1">mesh = smesh.CreateMesh(box)</p>\r
+<p class="whs1">algo2D.MaxElementArea(10.)</p>\r
\r
<p class="whs1"> </p>\r
\r
-<p class="whs1">mesh.AddHypothesis(box,hyp1)</p>\r
-\r
-<p class="whs1">mesh.AddHypothesis(box,hyp2)</p>\r
-\r
-<p class="whs1">mesh.AddHypothesis(box,algo1)</p>\r
-\r
-<p class="whs1">mesh.AddHypothesis(box,algo2)</p>\r
-\r
-<p class="whs1">mesh.AddHypothesis(edge,hyp3)</p>\r
-\r
-<p class="whs1">mesh.AddHypothesis(edge,hyp4)</p>\r
-\r
-<p class="whs1">mesh.AddHypothesis(edge,algo1)</p>\r
+<p class="whs1">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>\r
\r
-<p class="whs1">smesh.Compute(mesh,box)</p>\r
-\r
-<p class="whs1">salome.sg.updateObjBrowser(1)</p>\r
+<p class="whs1">algo3D.MaxElementVolume(900.)</p>\r
\r
<p class="whs1"> </p>\r
\r
-<p class="whs2"># remove one hypothesis</p>\r
-\r
-<p class="whs1">mesh.RemoveHypothesis(edge,hyp4)</p>\r
+<p class="whs2"># compute the mesh</p>\r
\r
-<p class="whs1">smesh.Compute(mesh,box)</p>\r
-\r
-<p class="whs1">salome.sg.updateObjBrowser(1)</p>\r
+<p class="whs1">tetra.Compute()</p>\r
\r
<p class="whs1"> </p>\r
\r
-<p class="whs2"># change the value \r
- of the hypothesis</p>\r
-\r
-<p class="whs1">hyp2.SetMaxElementArea(2)</p>\r
+<p class="whs2"># print informations \r
+ about the mesh</p>\r
\r
-<p class="whs1">mesh.AddHypothesis(box,hyp2)</p>\r
-\r
-<p class="whs1">smesh.Compute(mesh,box)</p>\r
+<p class="whs1">mesh = tetra.GetMesh()</p>\r
\r
<p class="whs1">print "Information about mesh:"</p>\r
\r
<p class="whs1">print "Number of faces : \r
", mesh.NbFaces()</p>\r
\r
-<p class="whs1">print "Number of triangles : \r
+<p class="whs1">print " triangles \r
+ : \r
", mesh.NbTriangles()</p>\r
\r
-<p class="whs1">print "Number of quadrangles : ", \r
- mesh.NbQuadrangles()</p>\r
+<p class="whs1">print " quadrangles \r
+ : ", mesh.NbQuadrangles()</p>\r
\r
-<p class="whs1">print "Number of polygons : \r
+<p class="whs1">print " polygons \r
+ : \r
", mesh.NbPolygons()</p>\r
\r
<p class="whs1">print "Number of volumes : \r
", mesh.NbVolumes()</p>\r
\r
-<p class="whs1">print "Number of tetrahedrons: ", \r
- mesh.NbTetras()</p>\r
+<p class="whs1">print " tetrahedrons: \r
+ ", mesh.NbTetras()</p>\r
\r
-<p class="whs1">print "Number of hexahedrons : ", \r
- mesh.NbHexas()</p>\r
+<p class="whs1">print " hexahedrons \r
+ : ", mesh.NbHexas()</p>\r
\r
-<p class="whs1">print "Number of prisms : \r
+<p class="whs1">print " prisms \r
+ : \r
", mesh.NbPrisms()</p>\r
\r
-<p class="whs1">print "Number of pyramids : \r
+<p class="whs1">print " pyramids \r
+ : \r
", mesh.NbPyramids()</p>\r
\r
-<p class="whs1">print "Number of polyhedrons : ", \r
- mesh.NbPolyhedrons()</p>\r
-\r
-<p class="whs1">salome.sg.updateObjBrowser(1) </p>\r
-\r
-<p class="whs1"> </p>\r
+<p class="whs1">print " polyhedrons \r
+ : ", mesh.NbPolyhedrons() </p>\r
\r
<script type="text/javascript" language="javascript1.2">\r
<!--\r