Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/smesh.git] / doc / salome / gui / SMESH / grouping_elements.htm
index b3f7985c80bc50d92f8c6f9ef5040c6725490fae..1b561a87ec1db514348c7ff21f995da8e5aec2a2 100755 (executable)
@@ -174,7 +174,7 @@ else
 \r
 <p class="whs2"><img src="pics/create_group.png" x-maintain-ratio="TRUE" width="430px" height="391px" border="0" class="img_whs3"></p>\r
 \r
-<h4><a name=bookmark5>Create a Group on Geometry</a></h4>\r
+<h3><a name=bookmark5>Create a Group on Geometry</a></h3>\r
 \r
 <p class="whs1">import salome</p>\r
 \r
@@ -182,6 +182,8 @@ else
 \r
 <p class="whs1">&nbsp;</p>\r
 \r
+<p class="whs1">import SMESH</p>\r
+\r
 <p class="whs1">import StdMeshers</p>\r
 \r
 <p class="whs1">&nbsp;</p>\r
@@ -189,12 +191,6 @@ else
 <p class="whs1">smesh = salome.lcc.FindOrLoadComponent(&quot;FactoryServer&quot;, \r
  &quot;SMESH&quot;)</p>\r
 \r
-<p class="whs1">&nbsp;</p>\r
-\r
-<p class="whs1">smeshgui = salome.ImportComponentGUI(&quot;SMESH&quot;)</p>\r
-\r
-<p class="whs1">smeshgui.Init(salome.myStudyId);</p>\r
-\r
 <p class="whs2">&nbsp;</p>\r
 \r
 <p class="whs2"># create a box</p>\r
@@ -229,122 +225,24 @@ else
 \r
 <p class="whs2"># create a hypothesis</p>\r
 \r
-<p class="whs1">print &quot;-------------------------- \r
- create Hypothesis&quot;</p>\r
-\r
-<p class="whs1">&nbsp;</p>\r
-\r
-<p class="whs1">print &quot;-------------------------- \r
- NumberOfSegments&quot;</p>\r
-\r
 <p class="whs1">numberOfSegments \r
  = 7</p>\r
 \r
-<p class="whs1">&nbsp;</p>\r
-\r
 <p class="whs1">hypNbSeg = smesh.CreateHypothesis(&quot;NumberOfSegments&quot;, \r
  &quot;libStdMeshersEngine.so&quot;)</p>\r
 \r
 <p class="whs1">hypNbSeg.SetNumberOfSegments(numberOfSegments)</p>\r
 \r
-<p class="whs1">&nbsp;</p>\r
-\r
-<p class="whs1">print hypNbSeg.GetName()</p>\r
-\r
-<p class="whs1">print hypNbSeg.GetId()</p>\r
-\r
-<p class="whs1">print hypNbSeg.GetNumberOfSegments()</p>\r
-\r
-<p class="whs1">&nbsp;</p>\r
-\r
-<p class="whs1">smeshgui.SetName(salome.ObjectToID(hypNbSeg), \r
- &quot;NumberOfSegments_10&quot;)</p>\r
-\r
-<p class="whs1">&nbsp;</p>\r
-\r
-<p class="whs1">print &quot;-------------------------- \r
- MaxElementArea&quot;</p>\r
-\r
-<p class="whs1">maxElementArea = \r
- 800</p>\r
-\r
-<p class="whs1">&nbsp;</p>\r
-\r
-<p class="whs1">hypArea = smesh.CreateHypothesis(&quot;MaxElementArea&quot;, \r
- &quot;libStdMeshersEngine.so&quot;)</p>\r
-\r
-<p class="whs1">hypArea.SetMaxElementArea(maxElementArea)</p>\r
-\r
-<p class="whs1">&nbsp;</p>\r
-\r
-<p class="whs1">print hypArea.GetName()</p>\r
-\r
-<p class="whs1">print hypArea.GetId()</p>\r
-\r
-<p class="whs1">print hypArea.GetMaxElementArea()</p>\r
-\r
-<p class="whs1">&nbsp;</p>\r
-\r
-<p class="whs1">smeshgui.SetName(salome.ObjectToID(hypArea), \r
- &quot;MaxElementArea_500&quot;)</p>\r
-\r
-<p class="whs1">&nbsp;</p>\r
-\r
-<p class="whs1">print &quot;-------------------------- \r
- MaxElementVolume&quot;</p>\r
-\r
-<p class="whs1">maxElementVolume \r
- = 900</p>\r
-\r
-<p class="whs1">&nbsp;</p>\r
-\r
-<p class="whs1">hypVolume = smesh.CreateHypothesis(&quot;MaxElementVolume&quot;, \r
- &quot;libStdMeshersEngine.so&quot;)</p>\r
-\r
-<p class="whs1">hypVolume.SetMaxElementVolume(maxElementVolume)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs1">print hypVolume.GetName()</p>\r
-\r
-<p class="whs1">print hypVolume.GetId()</p>\r
-\r
-<p class="whs1">print hypVolume.GetMaxElementVolume()</p>\r
-\r
-<p class="whs1">&nbsp;</p>\r
-\r
-<p class="whs1">smeshgui.SetName(salome.ObjectToID(hypVolume), \r
- &quot;MaxElementVolume_500&quot;)</p>\r
-\r
 <p class="whs2">&nbsp;</p>\r
 \r
 <p class="whs2"># create algorithms</p>\r
 \r
-<p class="whs1">print &quot;-------------------------- \r
- create Algorithms&quot;</p>\r
-\r
-<p class="whs1">&nbsp;</p>\r
-\r
-<p class="whs1">print &quot;-------------------------- \r
- Regular_1D&quot;</p>\r
-\r
 <p class="whs1">regular1D = smesh.CreateHypothesis(&quot;Regular_1D&quot;, \r
  &quot;libStdMeshersEngine.so&quot;)</p>\r
 \r
-<p class="whs1">smeshgui.SetName(salome.ObjectToID(regular1D), \r
- &quot;Wire Discretisation&quot;)</p>\r
-\r
-<p class="whs1">&nbsp;</p>\r
-\r
-<p class="whs1">print &quot;-------------------------- \r
- Quadrangle_2D&quot;</p>\r
-\r
 <p class="whs1">quad2D = smesh.CreateHypothesis(&quot;Quadrangle_2D&quot;, \r
  &quot;libStdMeshersEngine.so&quot;)</p>\r
 \r
-<p class="whs1">smeshgui.SetName(salome.ObjectToID(quad2D), \r
- &quot;Quadrangle_2D&quot;)</p>\r
-\r
 <p class="whs2">&nbsp;</p>\r
 \r
 <p class="whs2"># initialize a mesh with \r
@@ -352,23 +250,13 @@ else
 \r
 <p class="whs1">mesh = smesh.CreateMesh(box)</p>\r
 \r
-<p class="whs1">smeshgui.SetName(salome.ObjectToID(mesh), \r
- &quot;MeshBox&quot;)</p>\r
-\r
 <p class="whs2">&nbsp;</p>\r
 \r
-<p class="whs2"># add a hypothesis to the \r
- box</p>\r
-\r
-<p class="whs1">print &quot;-------------------------- \r
- add hypothesis to the box&quot;</p>\r
+<p class="whs2"># add hypotheses and algorithms \r
+ to the box</p>\r
 \r
 <p class="whs1">mesh.AddHypothesis(box,hypNbSeg)</p>\r
 \r
-<p class="whs1">mesh.AddHypothesis(box,hypArea)</p>\r
-\r
-<p class="whs1">mesh.AddHypothesis(box,hypVolume)</p>\r
-\r
 <p class="whs1">mesh.AddHypothesis(box,regular1D)</p>\r
 \r
 <p class="whs1">mesh.AddHypothesis(box,quad2D)</p>\r
@@ -377,35 +265,33 @@ else
 \r
 <p class="whs2"># compute the mesh</p>\r
 \r
-<p class="whs1">print &quot;-------------------------- \r
- compute the mesh of the box&quot;</p>\r
-\r
 <p class="whs1">ret = smesh.Compute(mesh,box)</p>\r
 \r
-<p class="whs1">print ret</p>\r
-\r
 <p class="whs1">if ret == 0:</p>\r
 \r
 <p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;print \r
  &quot;probleme when computing the mesh&quot;</p>\r
 \r
+<p class="whs1">else:</p>\r
+\r
+<p class="whs1">&nbsp;&nbsp;&nbsp;&nbsp;print \r
+ &quot;Computation succeded&quot;</p>\r
+\r
 <p class="whs2">&nbsp;</p>\r
 \r
 <p class="whs2"># create geometry groups \r
- on the plane:</p>\r
+ on the face</p>\r
 \r
-<p class="whs1">aGeomGroup1 = geompy.CreateGroup(face \r
geompy.ShapeType[&quot;FACE&quot;])</p>\r
+<p class="whs1">aGeomGroup1 = geompy.CreateGroup(face, \r
+ geompy.ShapeType[&quot;FACE&quot;])</p>\r
 \r
 <p class="whs1">geompy.AddObject(aGeomGroup1, \r
  1)</p>\r
 \r
 <p class="whs1">&nbsp;</p>\r
 \r
-<p class="whs1">aGeomGroup2 = geompy.CreateGroup(face \r
- , geompy.ShapeType[&quot;EDGE&quot;])</p>\r
-\r
-<p class="whs1">&nbsp;</p>\r
+<p class="whs1">aGeomGroup2 = geompy.CreateGroup(face, \r
+ geompy.ShapeType[&quot;EDGE&quot;])</p>\r
 \r
 <p class="whs1">geompy.AddObject(aGeomGroup2, \r
  3)</p>\r
@@ -427,10 +313,14 @@ else
 <p class="whs1">geompy.addToStudy(aGeomGroup2, \r
  &quot;Group on Edges&quot;)</p>\r
 \r
-<p class="whs1">&nbsp;</p>\r
+<p class="whs2">&nbsp;</p>\r
+\r
+<p class="whs2"># create SMESH groups</p>\r
 \r
 <p class="whs1">aSmeshGroup1 = mesh.CreateGroupFromGEOM(SMESH.FACE, \r
- &quot;SMESHGroup1&quot;, aGeomGroup1)</p>\r
+ &quot;SMESHGroup1&quot;,</p>\r
+\r
+<p class="whs1">aGeomGroup1)</p>\r
 \r
 <p class="whs1">aSmeshGroup2 = mesh.CreateGroupFromGEOM(SMESH.EDGE, \r
  &quot;SMESHGroup2&quot;, aGeomGroup2)</p>\r
@@ -438,7 +328,7 @@ else
 <p class="whs1">&nbsp;</p>\r
 \r
 <p class="whs2"><span style="font-family: 'Lucida Console', monospace;">salome.sg.updateObjBrowser(1)</span> \r
- </p>\r
&nbsp;</p>\r
 \r
 <p class="whs2">&nbsp;</p>\r
 \r