Salome HOME
Modifications in SMESH Help.
[modules/smesh.git] / doc / salome / gui / SMESH / grouping_elements.htm
index f479f57dfadb362b936c45d10a48348a88e2225e..b3f7985c80bc50d92f8c6f9ef5040c6725490fae 100755 (executable)
@@ -9,6 +9,18 @@
 <!--\r
 p.whs1 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }\r
 p.whs2 { margin-top:0pt; margin-bottom:0pt; }\r
+img_whs3 { border:none; width:430px; height:391px; float:none; border-style:none; }\r
+img_whs4 { border:none; float:none; width:463px; height:417px; border-style:none; }\r
+img_whs5 { border:none; width:541px; height:417px; float:none; border-style:none; }\r
+img_whs6 { border:none; width:394px; height:425px; float:none; border-style:none; }\r
+img_whs7 { border:none; float:none; width:368px; height:379px; border-style:none; }\r
+img_whs8 { border:none; float:none; width:344px; height:381px; border-style:none; }\r
+img_whs9 { border:none; width:314px; height:351px; float:none; border-style:none; }\r
+img_whs10 { border:none; float:none; width:319px; height:351px; border-style:none; }\r
+img_whs11 { border:none; float:none; width:304px; height:352px; border-style:none; }\r
+img_whs12 { border:none; width:318px; height:355px; float:none; border-style:none; }\r
+img_whs13 { border:none; float:none; width:318px; height:355px; border-style:none; }\r
+img_whs14 { border:none; float:none; width:320px; height:354px; border-style:none; }\r
 -->\r
 </style><script type="text/javascript" language="JavaScript">\r
 <!--\r
@@ -78,7 +90,7 @@ else
 </script>\r
 <h1>Grouping Elements</h1>\r
 \r
-<h3><a name=bookmark>Create a Group</a></h3>\r
+<h3><a name=bookmark>Create a Standalone Group</a></h3>\r
 \r
 <p class="whs1">&nbsp;</p>\r
 \r
@@ -160,6 +172,276 @@ else
 \r
 <p class="whs2">&nbsp;</p>\r
 \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
+\r
+<p class="whs1">import salome</p>\r
+\r
+<p class="whs1">import geompy</p>\r
+\r
+<p class="whs1">&nbsp;</p>\r
+\r
+<p class="whs1">import StdMeshers</p>\r
+\r
+<p class="whs1">&nbsp;</p>\r
+\r
+<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
+\r
+<p class="whs1">box = geompy.MakeBox(0., \r
+ 0., 0., 100., 100., 100.)</p>\r
+\r
+<p class="whs2">&nbsp;</p>\r
+\r
+<p class="whs2"># add the box to the study</p>\r
+\r
+<p class="whs1">idbox = geompy.addToStudy(box, \r
+ &quot;box&quot;)</p>\r
+\r
+<p class="whs2">&nbsp;</p>\r
+\r
+<p class="whs2"># add the first face of \r
+ the box to the study</p>\r
+\r
+<p class="whs1">subShapeList = geompy.SubShapeAll(box, \r
+ geompy.ShapeType[&quot;FACE&quot;])</p>\r
+\r
+<p class="whs1">face = subShapeList[0]</p>\r
+\r
+<p class="whs1">name = geompy.SubShapeName(face, \r
+ box)</p>\r
+\r
+<p class="whs1">idface = geompy.addToStudyInFather(box, \r
+ face, name)</p>\r
+\r
+<p class="whs2">&nbsp;</p>\r
+\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
+ the box</p>\r
+\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
+\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
+\r
+<p class="whs2">&nbsp;</p>\r
+\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="whs2">&nbsp;</p>\r
+\r
+<p class="whs2"># create geometry groups \r
+ on the plane:</p>\r
+\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
+\r
+<p class="whs1">geompy.AddObject(aGeomGroup2, \r
+ 3)</p>\r
+\r
+<p class="whs1">geompy.AddObject(aGeomGroup2, \r
+ 6)</p>\r
+\r
+<p class="whs1">geompy.AddObject(aGeomGroup2, \r
+ 8)</p>\r
+\r
+<p class="whs1">geompy.AddObject(aGeomGroup2, \r
+ 10)</p>\r
+\r
+<p class="whs1">&nbsp;</p>\r
+\r
+<p class="whs1">geompy.addToStudy(aGeomGroup1, \r
+ &quot;Group on Faces&quot;)</p>\r
+\r
+<p class="whs1">geompy.addToStudy(aGeomGroup2, \r
+ &quot;Group on Edges&quot;)</p>\r
+\r
+<p class="whs1">&nbsp;</p>\r
+\r
+<p class="whs1">aSmeshGroup1 = mesh.CreateGroupFromGEOM(SMESH.FACE, \r
+ &quot;SMESHGroup1&quot;, aGeomGroup1)</p>\r
+\r
+<p class="whs1">aSmeshGroup2 = mesh.CreateGroupFromGEOM(SMESH.EDGE, \r
+ &quot;SMESHGroup2&quot;, aGeomGroup2)</p>\r
+\r
+<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
+\r
+<p class="whs2">&nbsp;</p>\r
+\r
 <h3><a name=bookmark1>Edit a Group</a></h3>\r
 \r
 <p class="whs1">import SMESH</p>\r
@@ -291,6 +573,8 @@ else
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
+<p class="whs2"><img src="pics/editing_groups1.png" x-maintain-ratio="TRUE" width="463px" height="417px" border="0" class="img_whs4"> &nbsp;<img src="pics/editing_groups2.png" x-maintain-ratio="TRUE" width="541px" height="417px" border="0" class="img_whs5"></p>\r
+\r
 <h3><a name=bookmark2>Union of two groups</a></h3>\r
 \r
 <p class="whs1">import SMESH</p>\r
@@ -492,6 +776,14 @@ else
 \r
 <p class="whs1">&nbsp;</p>\r
 \r
+<p class="whs1"><img src="pics/union_groups1.png" x-maintain-ratio="TRUE" width="394px" height="425px" border="0" class="img_whs6"></p>\r
+\r
+<p class="whs1">&nbsp;</p>\r
+\r
+<p class="whs1"><img src="pics/union_groups2.png" x-maintain-ratio="TRUE" width="368px" height="379px" border="0" class="img_whs7"> <img src="pics/union_groups3.png" x-maintain-ratio="TRUE" width="344px" height="381px" border="0" class="img_whs8"></p>\r
+\r
+<p class="whs1">&nbsp;</p>\r
+\r
 <h3><a name=bookmark3>Intersection of two groups</a></h3>\r
 \r
 <p class="whs1">import SMESH</p>\r
@@ -632,6 +924,8 @@ else
 \r
 <p class="whs2">&nbsp;</p>\r
 \r
+<p class="whs2"><img src="pics/intersect_groups1.png" x-maintain-ratio="TRUE" width="314px" height="351px" border="0" class="img_whs9"> &nbsp;<img src="pics/intersect_groups2.png" x-maintain-ratio="TRUE" width="319px" height="351px" border="0" class="img_whs10"> &nbsp;<img src="pics/intersect_groups3.png" x-maintain-ratio="TRUE" width="304px" height="352px" border="0" class="img_whs11"></p>\r
+\r
 <h3><a name=bookmark4>Cut of two groups</a></h3>\r
 \r
 <p class="whs1">import SMESH</p>\r
@@ -772,7 +1066,7 @@ else
 \r
 <p class="whs1">&nbsp;</p>\r
 \r
-<p class="whs2">&nbsp;</p>\r
+<p class="whs2"><img src="pics/cut_groups1.png" x-maintain-ratio="TRUE" width="318px" height="355px" border="0" class="img_whs12"> &nbsp;<img src="pics/cut_groups2.png" x-maintain-ratio="TRUE" width="318px" height="355px" border="0" class="img_whs13"> &nbsp;<img src="pics/cut_groups3.png" x-maintain-ratio="TRUE" width="320px" height="354px" border="0" class="img_whs14"></p>\r
 \r
 <script type="text/javascript" language="javascript1.2">\r
 <!--\r