<!--\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
</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"> </p>\r
\r
\r
<p class="whs2"> </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"> </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"> </p>\r
+\r
+<p class="whs1">smeshgui = salome.ImportComponentGUI("SMESH")</p>\r
+\r
+<p class="whs1">smeshgui.Init(salome.myStudyId);</p>\r
+\r
+<p class="whs2"> </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"> </p>\r
+\r
+<p class="whs2"># add the box to the study</p>\r
+\r
+<p class="whs1">idbox = geompy.addToStudy(box, \r
+ "box")</p>\r
+\r
+<p class="whs2"> </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["FACE"])</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"> </p>\r
+\r
+<p class="whs2"># create a hypothesis</p>\r
+\r
+<p class="whs1">print "-------------------------- \r
+ create Hypothesis"</p>\r
+\r
+<p class="whs1"> </p>\r
+\r
+<p class="whs1">print "-------------------------- \r
+ NumberOfSegments"</p>\r
+\r
+<p class="whs1">numberOfSegments \r
+ = 7</p>\r
+\r
+<p class="whs1"> </p>\r
+\r
+<p class="whs1">hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", \r
+ "libStdMeshersEngine.so")</p>\r
+\r
+<p class="whs1">hypNbSeg.SetNumberOfSegments(numberOfSegments)</p>\r
+\r
+<p class="whs1"> </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"> </p>\r
+\r
+<p class="whs1">smeshgui.SetName(salome.ObjectToID(hypNbSeg), \r
+ "NumberOfSegments_10")</p>\r
+\r
+<p class="whs1"> </p>\r
+\r
+<p class="whs1">print "-------------------------- \r
+ MaxElementArea"</p>\r
+\r
+<p class="whs1">maxElementArea = \r
+ 800</p>\r
+\r
+<p class="whs1"> </p>\r
+\r
+<p class="whs1">hypArea = smesh.CreateHypothesis("MaxElementArea", \r
+ "libStdMeshersEngine.so")</p>\r
+\r
+<p class="whs1">hypArea.SetMaxElementArea(maxElementArea)</p>\r
+\r
+<p class="whs1"> </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"> </p>\r
+\r
+<p class="whs1">smeshgui.SetName(salome.ObjectToID(hypArea), \r
+ "MaxElementArea_500")</p>\r
+\r
+<p class="whs1"> </p>\r
+\r
+<p class="whs1">print "-------------------------- \r
+ MaxElementVolume"</p>\r
+\r
+<p class="whs1">maxElementVolume \r
+ = 900</p>\r
+\r
+<p class="whs1"> </p>\r
+\r
+<p class="whs1">hypVolume = smesh.CreateHypothesis("MaxElementVolume", \r
+ "libStdMeshersEngine.so")</p>\r
+\r
+<p class="whs1">hypVolume.SetMaxElementVolume(maxElementVolume)</p>\r
+\r
+<p class="whs2"> </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"> </p>\r
+\r
+<p class="whs1">smeshgui.SetName(salome.ObjectToID(hypVolume), \r
+ "MaxElementVolume_500")</p>\r
+\r
+<p class="whs2"> </p>\r
+\r
+<p class="whs2"># create algorithms</p>\r
+\r
+<p class="whs1">print "-------------------------- \r
+ create Algorithms"</p>\r
+\r
+<p class="whs1"> </p>\r
+\r
+<p class="whs1">print "-------------------------- \r
+ Regular_1D"</p>\r
+\r
+<p class="whs1">regular1D = smesh.CreateHypothesis("Regular_1D", \r
+ "libStdMeshersEngine.so")</p>\r
+\r
+<p class="whs1">smeshgui.SetName(salome.ObjectToID(regular1D), \r
+ "Wire Discretisation")</p>\r
+\r
+<p class="whs1"> </p>\r
+\r
+<p class="whs1">print "-------------------------- \r
+ Quadrangle_2D"</p>\r
+\r
+<p class="whs1">quad2D = smesh.CreateHypothesis("Quadrangle_2D", \r
+ "libStdMeshersEngine.so")</p>\r
+\r
+<p class="whs1">smeshgui.SetName(salome.ObjectToID(quad2D), \r
+ "Quadrangle_2D")</p>\r
+\r
+<p class="whs2"> </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
+ "MeshBox")</p>\r
+\r
+<p class="whs2"> </p>\r
+\r
+<p class="whs2"># add a hypothesis to the \r
+ box</p>\r
+\r
+<p class="whs1">print "-------------------------- \r
+ add hypothesis 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
+\r
+<p class="whs2"> </p>\r
+\r
+<p class="whs2"># compute the mesh</p>\r
+\r
+<p class="whs1">print "-------------------------- \r
+ compute the mesh of the box"</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"> print \r
+ "probleme when computing the mesh"</p>\r
+\r
+<p class="whs2"> </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["FACE"])</p>\r
+\r
+<p class="whs1">geompy.AddObject(aGeomGroup1, \r
+ 1)</p>\r
+\r
+<p class="whs1"> </p>\r
+\r
+<p class="whs1">aGeomGroup2 = geompy.CreateGroup(face \r
+ , geompy.ShapeType["EDGE"])</p>\r
+\r
+<p class="whs1"> </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"> </p>\r
+\r
+<p class="whs1">geompy.addToStudy(aGeomGroup1, \r
+ "Group on Faces")</p>\r
+\r
+<p class="whs1">geompy.addToStudy(aGeomGroup2, \r
+ "Group on Edges")</p>\r
+\r
+<p class="whs1"> </p>\r
+\r
+<p class="whs1">aSmeshGroup1 = mesh.CreateGroupFromGEOM(SMESH.FACE, \r
+ "SMESHGroup1", aGeomGroup1)</p>\r
+\r
+<p class="whs1">aSmeshGroup2 = mesh.CreateGroupFromGEOM(SMESH.EDGE, \r
+ "SMESHGroup2", aGeomGroup2)</p>\r
+\r
+<p class="whs1"> </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"> </p>\r
+\r
<h3><a name=bookmark1>Edit a Group</a></h3>\r
\r
<p class="whs1">import SMESH</p>\r
\r
<p class="whs2"> </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"> <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
\r
<p class="whs1"> </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"> </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"> </p>\r
+\r
<h3><a name=bookmark3>Intersection of two groups</a></h3>\r
\r
<p class="whs1">import SMESH</p>\r
\r
<p class="whs2"> </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"> <img src="pics/intersect_groups2.png" x-maintain-ratio="TRUE" width="319px" height="351px" border="0" class="img_whs10"> <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
\r
<p class="whs1"> </p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs2"><img src="pics/cut_groups1.png" x-maintain-ratio="TRUE" width="318px" height="355px" border="0" class="img_whs12"> <img src="pics/cut_groups2.png" x-maintain-ratio="TRUE" width="318px" height="355px" border="0" class="img_whs13"> <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