Salome HOME
Merging with WPdev
[modules/smesh.git] / doc / salome / gui / SMESH / defining_hypotheses_tui.htm
index 144d565306daff4dc3cbc1ad97e1e94b6d40a016..420dc0a8bc505d561e40b56cbcf04f0c4c642d4b 100755 (executable)
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Defining hypotheses TUI</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"><style>\r
-<!--\r
-P { margin-top:0pt; margin-bottom:0pt; }\r
-LI.kadov-P {  }\r
--->\r
-</style><style type="text/css">\r
-<!--\r
-p.whs1 { font-weight:bold; }\r
-p.whs2 { font-family:'Lucida Console' , monospace; }\r
-p.whs3 { font-family:'Times New Roman' , serif; }\r
-p.whs4 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }\r
-p.whs5 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }\r
-p.whs6 { margin-top:0pt; margin-bottom:0pt; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs4 {margin-top:1pt;margin-bottom:1pt; }";\r
-  strNSS += "p.whs5 {margin-top:1pt;margin-bottom:1pt; }";\r
-  strNSS += "p.whs6 {margin-top:1pt;margin-bottom:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("MESH module\nTUI Scripts\nDefining Hypotheses");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1>Defining Hypotheses and Algorithms</h1>\r
-\r
-<h3>Defining 1D Hypotheses</h3>\r
-\r
-<p class="whs1"><a name=bookmark>1D Arithmetic</a></p>\r
-\r
-<p>&nbsp;</p>\r
-\r
-<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import \r
- geompy</span></p>\r
-\r
-<p class="whs2">import smesh</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a box</p>\r
-\r
-<p class="whs2">box = geompy.MakeBoxDXDYDZ(10., \r
- 10., 10.)</p>\r
-\r
-<p class="whs2">geompy.addToStudy(box, \r
- &quot;Box&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a hexahedral \r
- mesh on the box</p>\r
-\r
-<p class="whs2">hexa = smesh.Mesh(box, \r
- &quot;Box : hexahedrical mesh&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a Regular 1D \r
- algorithm for edges</p>\r
-\r
-<p class="whs2">algo1D = hexa.Segment()</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># define &quot;Arithmetic1D&quot; \r
- hypothesis to cut all edges in several segments with increasing arithmetic \r
- length </p>\r
-\r
-<p class="whs2">algo1D.Arithmetic1D(1, \r
- 4)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a quadrangle \r
- 2D algorithm for faces</p>\r
-\r
-<p class="whs2">hexa.Quadrangle()</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a hexahedron \r
- 3D algorithm for solids</p>\r
-\r
-<p class="whs2">hexa.Hexahedron()</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># compute the mesh</p>\r
-\r
-<p class="whs2">hexa.Compute() </p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<h4><a name=bookmark9>Deflection 1D and Number of Segments</a></h4>\r
-\r
-<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import \r
- geompy</span></p>\r
-\r
-<p class="whs2">import smesh</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a face from \r
- arc and straight segment</p>\r
-\r
-<p class="whs2">px = geompy.MakeVertex(100., \r
- 0. &nbsp;, 0. \r
- &nbsp;)</p>\r
-\r
-<p class="whs2">py = geompy.MakeVertex(0. \r
- &nbsp;, 100., \r
- 0. &nbsp;)</p>\r
-\r
-<p class="whs2">pz = geompy.MakeVertex(0. \r
- &nbsp;, 0. &nbsp;, \r
- 100.)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">exy = geompy.MakeEdge(px, \r
- py)</p>\r
-\r
-<p class="whs2">arc = geompy.MakeArc(py, \r
- pz, px)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">wire = geompy.MakeWire([exy, \r
- arc])</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs2">isPlanarFace = 1</p>\r
-\r
-<p class="whs2">face1 = geompy.MakeFace(wire, \r
- isPlanarFace)</p>\r
-\r
-<p class="whs2">geompy.addToStudy(face1,&quot;Face1&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># get edges from the \r
- face</p>\r
-\r
-<p class="whs2">e_straight,e_arc = \r
- geompy.SubShapeAll(face1, geompy.ShapeType[&quot;EDGE&quot;])</p>\r
-\r
-<p class="whs2">geompy.addToStudyInFather(face1, \r
- e_arc, &quot;Arc Edge&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create hexahedral mesh</p>\r
-\r
-<p class="whs2">hexa = smesh.Mesh(face1, \r
- &quot;Face : triangle mesh&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># define &quot;NumberOfSegments&quot; \r
- hypothesis to cut a straight edge in a fixed number of segments</p>\r
-\r
-<p class="whs2">algo1D = hexa.Segment()</p>\r
-\r
-<p class="whs2">algo1D.NumberOfSegments(6)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># define &quot;MaxElementArea&quot; \r
- hypothesis</p>\r
-\r
-<p class="whs2">algo2D = hexa.Triangle()</p>\r
-\r
-<p class="whs2">algo2D.MaxElementArea(70.0)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># define a local &quot;Deflection1D&quot; \r
- hypothesis on the arc</p>\r
-\r
-<p class="whs2">algo_local = hexa.Segment(e_arc)</p>\r
-\r
-<p class="whs2">algo_local.Deflection1D(1.0)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># compute the mesh</p>\r
-\r
-<p class="whs2">hexa.Compute() </p>\r
-\r
-<h4><a name=bookmark2>Start and End Length</a></h4>\r
-\r
-<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">from \r
- geompy import *</span></p>\r
-\r
-<p class="whs2">import smesh</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a box</p>\r
-\r
-<p class="whs2">box = MakeBoxDXDYDZ(10., \r
- 10., 10.)</p>\r
-\r
-<p class="whs2">addToStudy(box, &quot;Box&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># get one edge of the \r
- box to put local hypothesis on</p>\r
-\r
-<p class="whs2">p5 = MakeVertex(5., \r
- 0., 0.)</p>\r
-\r
-<p class="whs2">EdgeX = GetEdgeNearPoint(box, \r
- p5)</p>\r
-\r
-<p class="whs2">addToStudyInFather(box, \r
- EdgeX, &quot;Edge [0,0,0 - 10,0,0]&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a hexahedral \r
- mesh on the box</p>\r
-\r
-<p class="whs2">hexa = smesh.Mesh(box, \r
- &quot;Box : hexahedrical mesh&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># set algorithms</p>\r
-\r
-<p class="whs2">algo1D = hexa.Segment()</p>\r
-\r
-<p class="whs2">hexa.Quadrangle()</p>\r
-\r
-<p class="whs2">hexa.Hexahedron()</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># define &quot;NumberOfSegments&quot; \r
- hypothesis to cut an edge in a fixed number of segments</p>\r
-\r
-<p class="whs2">algo1D.NumberOfSegments(4)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a local hypothesis</p>\r
-\r
-<p class="whs2">algo_local = hexa.Segment(EdgeX)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># define &quot;StartEndLength&quot; \r
- hypothesis to cut an edge in several segments with increasing geometric \r
- length</p>\r
-\r
-<p class="whs2">algo_local.StartEndLength(1, \r
- 6)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># define &quot;Propagation&quot; \r
- hypothesis that propagates all other hypothesis</p>\r
-\r
-<p class="whs3"># on all edges on the \r
- opposite side in case of quadrangular faces</p>\r
-\r
-<p class="whs2">algo_local.Propagation()</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># compute the mesh</p>\r
-\r
-<p class="whs2">hexa.Compute() </p>\r
-\r
-<h4><a name=bookmark3>Average Length</a></h4>\r
-\r
-<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">from \r
- geompy import *</span></p>\r
-\r
-<p class="whs2">import smesh</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a box</p>\r
-\r
-<p class="whs2">box = MakeBoxDXDYDZ(10., \r
- 10., 10.)</p>\r
-\r
-<p class="whs2">addToStudy(box, &quot;Box&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># get one edge of the \r
- box to put local hypothesis on</p>\r
-\r
-<p class="whs2">p5 = MakeVertex(5., \r
- 0., 0.)</p>\r
-\r
-<p class="whs2">EdgeX = GetEdgeNearPoint(box, \r
- p5)</p>\r
-\r
-<p class="whs2">addToStudyInFather(box, \r
- EdgeX, &quot;Edge [0,0,0 - 10,0,0]&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a hexahedral \r
- mesh on the box</p>\r
-\r
-<p class="whs2">hexa = smesh.Mesh(box, \r
- &quot;Box : hexahedrical mesh&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># set algorithms</p>\r
-\r
-<p class="whs2">algo1D = hexa.Segment()</p>\r
-\r
-<p class="whs2">hexa.Quadrangle()</p>\r
-\r
-<p class="whs2">hexa.Hexahedron()</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># define &quot;NumberOfSegments&quot; \r
- hypothesis to cut all edges in a fixed number of segments</p>\r
-\r
-<p class="whs2">algo1D.NumberOfSegments(4)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a sub-mesh</p>\r
-\r
-<p class="whs2">algo_local = hexa.Segment(EdgeX)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># define &quot;LocalLength&quot; \r
- hypothesis to cut an edge in several segments with the same length</p>\r
-\r
-<p class="whs2">algo_local.LocalLength(2.)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># define &quot;Propagation&quot; \r
- hypothesis that propagates all other hypothesis</p>\r
-\r
-<p class="whs3"># on all edges on the \r
- opposite side in case of quadrangular faces</p>\r
-\r
-<p class="whs2">algo_local.Propagation()</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># compute the mesh</p>\r
-\r
-<p class="whs2">hexa.Compute() </p>\r
-\r
-<h3>Defining 2D and 3D hypotheses</h3>\r
-\r
-<h4><a name=bookmark4>Maximum Element Area</a></h4>\r
-\r
-<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import \r
- smesh</span></p>\r
-\r
-<p class="whs4">import salome</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5"># create a face</p>\r
-\r
-<p class="whs4">px &nbsp;&nbsp;= \r
- geompy.MakeVertex(100., 0. &nbsp;, \r
- 0. &nbsp;)</p>\r
-\r
-<p class="whs4">py &nbsp;&nbsp;= \r
- geompy.MakeVertex(0. &nbsp;, \r
- 100., 0. &nbsp;)</p>\r
-\r
-<p class="whs4">pz &nbsp;&nbsp;= \r
- geompy.MakeVertex(0. &nbsp;, \r
- 0. &nbsp;, 100.)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs4">vxy = geompy.MakeVector(px, \r
- py)</p>\r
-\r
-<p class="whs4">arc = geompy.MakeArc(py, \r
- pz, px)</p>\r
-\r
-<p class="whs4">wire = geompy.MakeWire([vxy, \r
- arc])</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs4">isPlanarFace = 1</p>\r
-\r
-<p class="whs4">face = geompy.MakeFace(wire, \r
- isPlanarFace)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5"># add the face in the \r
- study</p>\r
-\r
-<p class="whs4">id_face = geompy.addToStudy(face, \r
- &quot;Face to be meshed&quot;)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5"># create a mesh</p>\r
-\r
-<p class="whs4">tria_mesh = smesh.Mesh(face, \r
- &quot;Face : triangulation&quot;)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5"># define 1D meshing:</p>\r
-\r
-<p class="whs4">algo = tria_mesh.Segment()</p>\r
-\r
-<p class="whs4">algo.NumberOfSegments(20)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5"># define 2D meshing:</p>\r
-\r
-<p class="whs5">&nbsp;</p>\r
-\r
-<p class="whs5"># assign triangulation \r
- algorithm</p>\r
-\r
-<p class="whs4">algo = tria_mesh.Triangle()</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5"># apply &quot;Max Element \r
- Area&quot; hypothesis to each triangle</p>\r
-\r
-<p class="whs4">algo.MaxElementArea(100)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5"># compute the mesh</p>\r
-\r
-<p class="whs4">tria_mesh.Compute() \r
- &nbsp;</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<h4><a name=bookmark5>Maximum Element Volume</a></h4>\r
-\r
-<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import \r
- geompy</span></p>\r
-\r
-<p class="whs4">import smesh</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5"># create a cylinder</p>\r
-\r
-<p class="whs4">cyl = geompy.MakeCylinderRH(30., \r
- 50.)</p>\r
-\r
-<p class="whs4">geompy.addToStudy(cyl, \r
- &quot;cyl&quot;)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5"># create a mesh on \r
- the cylinder</p>\r
-\r
-<p class="whs4">tetra = smesh.Mesh(cyl, \r
- &quot;Cylinder : tetrahedrical mesh&quot;)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5"># assign algorithms</p>\r
-\r
-<p class="whs4">algo1D = tetra.Segment()</p>\r
-\r
-<p class="whs4">algo2D = tetra.Triangle()</p>\r
-\r
-<p class="whs4">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5"># assign 1D and 2D \r
- hypotheses</p>\r
-\r
-<p class="whs4">algo1D.NumberOfSegments(7)</p>\r
-\r
-<p class="whs4">algo2D.MaxElementArea(150.)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5"># assign Max Element \r
- Volume hypothesis</p>\r
-\r
-<p class="whs4">algo3D.MaxElementVolume(200.)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5"># compute the mesh</p>\r
-\r
-<p class="whs4">ret = tetra.Compute()</p>\r
-\r
-<p class="whs4">if ret == 0:</p>\r
-\r
-<p class="whs4">&nbsp;&nbsp;&nbsp;&nbsp;print \r
- &quot;probleme when computing the mesh&quot;</p>\r
-\r
-<p class="whs4">else:</p>\r
-\r
-<p class="whs4">&nbsp;&nbsp;&nbsp;&nbsp;print \r
- &quot;Computation succeded&quot; </p>\r
-\r
-<h4><a name=bookmark6>Length from Edges</a></h4>\r
-\r
-<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import \r
- geompy</span></p>\r
-\r
-<p class="whs2">import smesh</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create sketchers</p>\r
-\r
-<p class="whs2">sketcher1 = geompy.MakeSketcher(&quot;Sketcher:F \r
- 0 0:TT 70 0:TT 70 70:TT 0 70:WW&quot;)</p>\r
-\r
-<p class="whs2">sketcher2 = geompy.MakeSketcher(&quot;Sketcher:F \r
- 20 20:TT 50 20:TT 50 50:TT 20 50:WW&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a face from \r
- two wires</p>\r
-\r
-<p class="whs2">isPlanarFace = 1</p>\r
-\r
-<p class="whs2">face1 = geompy.MakeFaces([sketcher1, \r
- sketcher2], isPlanarFace)</p>\r
-\r
-<p class="whs2">geompy.addToStudy(face1, \r
- &quot;Face1&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a mesh</p>\r
-\r
-<p class="whs2">tria = smesh.Mesh(face1, \r
- &quot;Face : triangle 2D mesh&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># Define 1D meshing</p>\r
-\r
-<p class="whs2">algo1D = tria.Segment()</p>\r
-\r
-<p class="whs2">algo1D.NumberOfSegments(2)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create and assign the \r
- algorithm for 2D meshing with triangles</p>\r
-\r
-<p class="whs2">algo2D = tria.Triangle()</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create and assign &quot;LengthFromEdges&quot; \r
- hypothesis to build triangles<span style="font-family: 'Times New Roman', serif;"> \r
- based on the length of the edges taken from the wire</span></p>\r
-\r
-<p class="whs2">algo2D.LengthFromEdges()</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># compute the mesh</p>\r
-\r
-<p class="whs2">tria.Compute() </p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<h3>Defining Additional Hypotheses</h3>\r
-\r
-<h4><a name=bookmark7>Propagation</a></h4>\r
-\r
-<p class="whs2">from geompy import \r
- *</p>\r
-\r
-<p class="whs2">import smesh</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a box</p>\r
-\r
-<p class="whs2">box = MakeBoxDXDYDZ(10., \r
- 10., 10.)</p>\r
-\r
-<p class="whs2">addToStudy(box, &quot;Box&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># get one edge of the \r
- box to put local hypothesis on</p>\r
-\r
-<p class="whs2">p5 = MakeVertex(5., \r
- 0., 0.)</p>\r
-\r
-<p class="whs2">EdgeX = GetEdgeNearPoint(box, \r
- p5)</p>\r
-\r
-<p class="whs2">addToStudyInFather(box, \r
- EdgeX, &quot;Edge [0,0,0 - 10,0,0]&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a hexahedral \r
- mesh on the box</p>\r
-\r
-<p class="whs2">hexa = smesh.Mesh(box, \r
- &quot;Box : hexahedrical mesh&quot;)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># set global algorithms \r
- and hypotheses</p>\r
-\r
-<p class="whs2">algo1D = hexa.Segment()</p>\r
-\r
-<p class="whs2">hexa.Quadrangle()</p>\r
-\r
-<p class="whs2">hexa.Hexahedron()</p>\r
-\r
-<p class="whs2">algo1D.NumberOfSegments(4)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># create a sub-mesh with \r
- local 1D hypothesis and propagation</p>\r
-\r
-<p class="whs2">algo_local = hexa.Segment(EdgeX)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># define &quot;Arithmetic1D&quot; \r
- hypothesis to cut an edge in several segments with increasing length</p>\r
-\r
-<p class="whs2">algo_local.Arithmetic1D(1, \r
- 4)</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># define &quot;Propagation&quot; \r
- hypothesis that propagates all other 1D hypotheses</p>\r
-\r
-<p class="whs3"># from all edges on the \r
- opposite side of a face in case of quadrangular faces</p>\r
-\r
-<p class="whs2">algo_local.Propagation()</p>\r
-\r
-<p class="whs2">&nbsp;</p>\r
-\r
-<p class="whs3"># compute the mesh</p>\r
-\r
-<p><span style="font-family: 'Lucida Console', monospace;">hexa.Compute()</span> \r
- </p>\r
-\r
-<h3><a name=bookmark8>Defining Meshing Algorithms</a></h3>\r
-\r
-<p class="whs4">import geompy</p>\r
-\r
-<p class="whs4">import smesh</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># create a box</p>\r
-\r
-<p class="whs4">box = geompy.MakeBoxDXDYDZ(10., \r
- 10., 10.)</p>\r
-\r
-<p class="whs4">geompy.addToStudy(box, \r
- &quot;Box&quot;)</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs6"># 1. Create a hexahedral \r
- mesh on the box</p>\r
-\r
-<p class="whs4">hexa = smesh.Mesh(box, \r
- &quot;Box : hexahedrical mesh&quot;)</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># create a Regular 1D algorithm \r
- for edges</p>\r
-\r
-<p class="whs4">algo1D = hexa.Segment()</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># create a quadrangle 2D \r
- algorithm for faces</p>\r
-\r
-<p class="whs4">algo2D = hexa.Quadrangle()</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># create a hexahedron 3D \r
- algorithm for solids</p>\r
-\r
-<p class="whs4">algo3D = hexa.Hexahedron()</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># define hypotheses</p>\r
-\r
-<p class="whs4">algo1D.Arithmetic1D(1, \r
- 4)</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># compute the mesh</p>\r
-\r
-<p class="whs4">hexa.Compute()</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># 2. Create a tetrahedral \r
- mesh on the box</p>\r
-\r
-<p class="whs4">tetra = smesh.Mesh(box, \r
- &quot;Box : tetrahedrical mesh&quot;)</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># create a Regular 1D algorithm \r
- for edges</p>\r
-\r
-<p class="whs4">algo1D = tetra.Segment()</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># create a Mefisto 2D algorithm \r
- for faces</p>\r
-\r
-<p class="whs4">algo2D = tetra.Triangle()</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># create a Netgen 3D algorithm \r
- for solids</p>\r
-\r
-<p class="whs4">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># define hypotheses</p>\r
-\r
-<p class="whs4">algo1D.Arithmetic1D(1, \r
- 4)</p>\r
-\r
-<p class="whs4">algo2D.LengthFromEdges()</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># compute the mesh</p>\r
-\r
-<p class="whs4">tetra.Compute()</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># 3. Create a tetrahedral \r
- mesh on the box with NETGEN_2D3D algorithm</p>\r
-\r
-<p class="whs4">tetraN = smesh.Mesh(box, \r
- &quot;Box : tetrahedrical mesh by NETGEN_2D3D&quot;)</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># create a Netgen_2D3D \r
- algorithm for solids</p>\r
-\r
-<p class="whs4">is3D = 1</p>\r
-\r
-<p class="whs4">algo3D = tetraN.Netgen(is3D)</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># define hypotheses</p>\r
-\r
-<p class="whs4">n23_params = algo3D.Parameters()</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"># compute the mesh</p>\r
-\r
-<p class="whs4">tetraN.Compute() \r
- </p>\r
-\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
+<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
+
+<html>
+
+<head>
+<title>Defining hypotheses TUI</title>
+<meta http-equiv="content-type" content="text/html; charset=windows-1252">
+<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"><style>
+<!--
+P { margin-top:0pt; margin-bottom:0pt; }
+LI.kadov-P {  }
+-->
+</style><style type="text/css">
+<!--
+p.whs1 { font-weight:bold; }
+p.whs2 { font-family:'Lucida Console' , monospace; }
+p.whs3 { font-family:'Times New Roman' , serif; }
+p.whs4 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }
+p.whs5 { margin-top:0pt; margin-bottom:0pt; font-family:'Times New Roman' , serif; }
+p.whs6 { margin-top:0pt; margin-bottom:0pt; }
+-->
+</style><script type="text/javascript" language="JavaScript">
+<!--
+if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
+{
+  var strNSS = "<style type='text/css'>";
+  strNSS += "p.whs4 {margin-top:1pt;margin-bottom:1pt; }";
+  strNSS += "p.whs5 {margin-top:1pt;margin-bottom:1pt; }";
+  strNSS += "p.whs6 {margin-top:1pt;margin-bottom:1pt; }";
+  strNSS +="</style>";
+  document.write(strNSS);
+}
+//-->
+</script>
+<script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
+<!--
+function reDo() {
+  if (innerWidth != origWidth || innerHeight != origHeight)
+     location.reload();
+}
+if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
+       origWidth = innerWidth;
+       origHeight = innerHeight;
+       onresize = reDo;
+}
+onerror = null; 
+//-->
+</script>
+<style type="text/css">
+<!--
+div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
+p.WebHelpNavBar { text-align:right; }
+-->
+</style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>
+<script type="text/javascript" language="javascript" src="whver.js"></script>
+<script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>
+<script type="text/javascript" language="javascript1.2" src="whutils.js"></script>
+<script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>
+<script type="text/javascript" language="javascript1.2">
+<!--
+if (window.gbWhTopic)
+{
+       if (window.setRelStartPage)
+       {
+       addTocInfo("MESH module\nTUI Scripts\nDefining Hypotheses");
+addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");
+addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");
+
+       }
+
+
+       if (window.setRelStartPage)
+       {
+       setRelStartPage("index.htm");
+
+               autoSync(1);
+               sendSyncInfo();
+               sendAveInfoOut();
+       }
+
+}
+else
+       if (window.gbIE4)
+               document.location.reload();
+//-->
+</script>
+</head>
+<body><script type="text/javascript" language="javascript1.2">
+<!--
+if (window.writeIntopicBar)
+       writeIntopicBar(4);
+//-->
+</script>
+<h1>Defining Hypotheses and Algorithms</h1>
+
+<h3>Defining 1D Hypotheses</h3>
+
+<p class="whs1"><a name=bookmark>1D Arithmetic</a></p>
+
+<p>&nbsp;</p>
+
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import 
+ geompy</span></p>
+
+<p class="whs2">import smesh</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a box</p>
+
+<p class="whs2">box = geompy.MakeBoxDXDYDZ(10., 
+ 10., 10.)</p>
+
+<p class="whs2">geompy.addToStudy(box, 
+ &quot;Box&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a hexahedral 
+ mesh on the box</p>
+
+<p class="whs2">hexa = smesh.Mesh(box, 
+ &quot;Box : hexahedrical mesh&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a Regular 1D 
+ algorithm for edges</p>
+
+<p class="whs2">algo1D = hexa.Segment()</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># define &quot;Arithmetic1D&quot; 
+ hypothesis to cut all edges in several segments with increasing arithmetic 
+ length </p>
+
+<p class="whs2">algo1D.Arithmetic1D(1, 
+ 4)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a quadrangle 
+ 2D algorithm for faces</p>
+
+<p class="whs2">hexa.Quadrangle()</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a hexahedron 
+ 3D algorithm for solids</p>
+
+<p class="whs2">hexa.Hexahedron()</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># compute the mesh</p>
+
+<p class="whs2">hexa.Compute() </p>
+
+<p class="whs2">&nbsp;</p>
+
+<h4><a name=bookmark9>Deflection 1D and Number of Segments</a></h4>
+
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import 
+ geompy</span></p>
+
+<p class="whs2">import smesh</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a face from 
+ arc and straight segment</p>
+
+<p class="whs2">px = geompy.MakeVertex(100., 
+ 0. &nbsp;, 0. 
+ &nbsp;)</p>
+
+<p class="whs2">py = geompy.MakeVertex(0. 
+ &nbsp;, 100., 
+ 0. &nbsp;)</p>
+
+<p class="whs2">pz = geompy.MakeVertex(0. 
+ &nbsp;, 0. &nbsp;, 
+ 100.)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs2">exy = geompy.MakeEdge(px, 
+ py)</p>
+
+<p class="whs2">arc = geompy.MakeArc(py, 
+ pz, px)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs2">wire = geompy.MakeWire([exy, 
+ arc])</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs2">isPlanarFace = 1</p>
+
+<p class="whs2">face1 = geompy.MakeFace(wire, 
+ isPlanarFace)</p>
+
+<p class="whs2">geompy.addToStudy(face1,&quot;Face1&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># get edges from the 
+ face</p>
+
+<p class="whs2">e_straight,e_arc = 
+ geompy.SubShapeAll(face1, geompy.ShapeType[&quot;EDGE&quot;])</p>
+
+<p class="whs2">geompy.addToStudyInFather(face1, 
+ e_arc, &quot;Arc Edge&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create hexahedral mesh</p>
+
+<p class="whs2">hexa = smesh.Mesh(face1, 
+ &quot;Face : triangle mesh&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># define &quot;NumberOfSegments&quot; 
+ hypothesis to cut a straight edge in a fixed number of segments</p>
+
+<p class="whs2">algo1D = hexa.Segment()</p>
+
+<p class="whs2">algo1D.NumberOfSegments(6)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># define &quot;MaxElementArea&quot; 
+ hypothesis</p>
+
+<p class="whs2">algo2D = hexa.Triangle()</p>
+
+<p class="whs2">algo2D.MaxElementArea(70.0)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># define a local &quot;Deflection1D&quot; 
+ hypothesis on the arc</p>
+
+<p class="whs2">algo_local = hexa.Segment(e_arc)</p>
+
+<p class="whs2">algo_local.Deflection1D(1.0)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># compute the mesh</p>
+
+<p class="whs2">hexa.Compute() </p>
+
+<h4><a name=bookmark2>Start and End Length</a></h4>
+
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">from 
+ geompy import *</span></p>
+
+<p class="whs2">import smesh</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a box</p>
+
+<p class="whs2">box = MakeBoxDXDYDZ(10., 
+ 10., 10.)</p>
+
+<p class="whs2">addToStudy(box, &quot;Box&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># get one edge of the 
+ box to put local hypothesis on</p>
+
+<p class="whs2">p5 = MakeVertex(5., 
+ 0., 0.)</p>
+
+<p class="whs2">EdgeX = GetEdgeNearPoint(box, 
+ p5)</p>
+
+<p class="whs2">addToStudyInFather(box, 
+ EdgeX, &quot;Edge [0,0,0 - 10,0,0]&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a hexahedral 
+ mesh on the box</p>
+
+<p class="whs2">hexa = smesh.Mesh(box, 
+ &quot;Box : hexahedrical mesh&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># set algorithms</p>
+
+<p class="whs2">algo1D = hexa.Segment()</p>
+
+<p class="whs2">hexa.Quadrangle()</p>
+
+<p class="whs2">hexa.Hexahedron()</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># define &quot;NumberOfSegments&quot; 
+ hypothesis to cut an edge in a fixed number of segments</p>
+
+<p class="whs2">algo1D.NumberOfSegments(4)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a local hypothesis</p>
+
+<p class="whs2">algo_local = hexa.Segment(EdgeX)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># define &quot;StartEndLength&quot; 
+ hypothesis to cut an edge in several segments with increasing geometric 
+ length</p>
+
+<p class="whs2">algo_local.StartEndLength(1, 
+ 6)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># define &quot;Propagation&quot; 
+ hypothesis that propagates all other hypothesis</p>
+
+<p class="whs3"># on all edges on the 
+ opposite side in case of quadrangular faces</p>
+
+<p class="whs2">algo_local.Propagation()</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># compute the mesh</p>
+
+<p class="whs2">hexa.Compute() </p>
+
+<h4><a name=bookmark3>Average Length</a></h4>
+
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">from 
+ geompy import *</span></p>
+
+<p class="whs2">import smesh</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a box</p>
+
+<p class="whs2">box = MakeBoxDXDYDZ(10., 
+ 10., 10.)</p>
+
+<p class="whs2">addToStudy(box, &quot;Box&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># get one edge of the 
+ box to put local hypothesis on</p>
+
+<p class="whs2">p5 = MakeVertex(5., 
+ 0., 0.)</p>
+
+<p class="whs2">EdgeX = GetEdgeNearPoint(box, 
+ p5)</p>
+
+<p class="whs2">addToStudyInFather(box, 
+ EdgeX, &quot;Edge [0,0,0 - 10,0,0]&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a hexahedral 
+ mesh on the box</p>
+
+<p class="whs2">hexa = smesh.Mesh(box, 
+ &quot;Box : hexahedrical mesh&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># set algorithms</p>
+
+<p class="whs2">algo1D = hexa.Segment()</p>
+
+<p class="whs2">hexa.Quadrangle()</p>
+
+<p class="whs2">hexa.Hexahedron()</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># define &quot;NumberOfSegments&quot; 
+ hypothesis to cut all edges in a fixed number of segments</p>
+
+<p class="whs2">algo1D.NumberOfSegments(4)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a sub-mesh</p>
+
+<p class="whs2">algo_local = hexa.Segment(EdgeX)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># define &quot;LocalLength&quot; 
+ hypothesis to cut an edge in several segments with the same length</p>
+
+<p class="whs2">algo_local.LocalLength(2.)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># define &quot;Propagation&quot; 
+ hypothesis that propagates all other hypothesis</p>
+
+<p class="whs3"># on all edges on the 
+ opposite side in case of quadrangular faces</p>
+
+<p class="whs2">algo_local.Propagation()</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># compute the mesh</p>
+
+<p class="whs2">hexa.Compute() </p>
+
+<h3>Defining 2D and 3D hypotheses</h3>
+
+<h4><a name=bookmark4>Maximum Element Area</a></h4>
+
+<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import 
+ geompy</span></p>
+
+<p class="whs4">import smesh</p>
+
+<p class="whs4">import salome </p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs5"># create a face</p>
+
+<p class="whs4">px &nbsp;&nbsp;= 
+ geompy.MakeVertex(100., 0. &nbsp;, 
+ 0. &nbsp;)</p>
+
+<p class="whs4">py &nbsp;&nbsp;= 
+ geompy.MakeVertex(0. &nbsp;, 
+ 100., 0. &nbsp;)</p>
+
+<p class="whs4">pz &nbsp;&nbsp;= 
+ geompy.MakeVertex(0. &nbsp;, 
+ 0. &nbsp;, 100.)</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs4">vxy = geompy.MakeVector(px, 
+ py)</p>
+
+<p class="whs4">arc = geompy.MakeArc(py, 
+ pz, px)</p>
+
+<p class="whs4">wire = geompy.MakeWire([vxy, 
+ arc])</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs4">isPlanarFace = 1</p>
+
+<p class="whs4">face = geompy.MakeFace(wire, 
+ isPlanarFace)</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs5"># add the face in the 
+ study</p>
+
+<p class="whs4">id_face = geompy.addToStudy(face, 
+ &quot;Face to be meshed&quot;)</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs5"># create a mesh</p>
+
+<p class="whs4">tria_mesh = smesh.Mesh(face, 
+ &quot;Face : triangulation&quot;)</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs5"># define 1D meshing:</p>
+
+<p class="whs4">algo = tria_mesh.Segment()</p>
+
+<p class="whs4">algo.NumberOfSegments(20)</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs5"># define 2D meshing:</p>
+
+<p class="whs5">&nbsp;</p>
+
+<p class="whs5"># assign triangulation 
+ algorithm</p>
+
+<p class="whs4">algo = tria_mesh.Triangle()</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs5"># apply &quot;Max Element 
+ Area&quot; hypothesis to each triangle</p>
+
+<p class="whs4">algo.MaxElementArea(100)</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs5"># compute the mesh</p>
+
+<p class="whs4">tria_mesh.Compute() 
+ &nbsp;</p>
+
+<p class="whs4">&nbsp;</p>
+
+<h4><a name=bookmark5>Maximum Element Volume</a></h4>
+
+<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import 
+ geompy</span></p>
+
+<p class="whs4">import smesh</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs5"># create a cylinder</p>
+
+<p class="whs4">cyl = geompy.MakeCylinderRH(30., 
+ 50.)</p>
+
+<p class="whs4">geompy.addToStudy(cyl, 
+ &quot;cyl&quot;)</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs5"># create a mesh on 
+ the cylinder</p>
+
+<p class="whs4">tetra = smesh.Mesh(cyl, 
+ &quot;Cylinder : tetrahedrical mesh&quot;)</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs5"># assign algorithms</p>
+
+<p class="whs4">algo1D = tetra.Segment()</p>
+
+<p class="whs4">algo2D = tetra.Triangle()</p>
+
+<p class="whs4">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs5"># assign 1D and 2D 
+ hypotheses</p>
+
+<p class="whs4">algo1D.NumberOfSegments(7)</p>
+
+<p class="whs4">algo2D.MaxElementArea(150.)</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs5"># assign Max Element 
+ Volume hypothesis</p>
+
+<p class="whs4">algo3D.MaxElementVolume(200.)</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs5"># compute the mesh</p>
+
+<p class="whs4">ret = tetra.Compute()</p>
+
+<p class="whs4">if ret == 0:</p>
+
+<p class="whs4">&nbsp;&nbsp;&nbsp;&nbsp;print 
+ &quot;probleme when computing the mesh&quot;</p>
+
+<p class="whs4">else:</p>
+
+<p class="whs4">&nbsp;&nbsp;&nbsp;&nbsp;print 
+ &quot;Computation succeded&quot; </p>
+
+<h4><a name=bookmark6>Length from Edges</a></h4>
+
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import 
+ geompy</span></p>
+
+<p class="whs2">import smesh</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create sketchers</p>
+
+<p class="whs2">sketcher1 = geompy.MakeSketcher(&quot;Sketcher:F 
+ 0 0:TT 70 0:TT 70 70:TT 0 70:WW&quot;)</p>
+
+<p class="whs2">sketcher2 = geompy.MakeSketcher(&quot;Sketcher:F 
+ 20 20:TT 50 20:TT 50 50:TT 20 50:WW&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a face from 
+ two wires</p>
+
+<p class="whs2">isPlanarFace = 1</p>
+
+<p class="whs2">face1 = geompy.MakeFaces([sketcher1, 
+ sketcher2], isPlanarFace)</p>
+
+<p class="whs2">geompy.addToStudy(face1, 
+ &quot;Face1&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a mesh</p>
+
+<p class="whs2">tria = smesh.Mesh(face1, 
+ &quot;Face : triangle 2D mesh&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># Define 1D meshing</p>
+
+<p class="whs2">algo1D = tria.Segment()</p>
+
+<p class="whs2">algo1D.NumberOfSegments(2)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create and assign the 
+ algorithm for 2D meshing with triangles</p>
+
+<p class="whs2">algo2D = tria.Triangle()</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create and assign &quot;LengthFromEdges&quot; 
+ hypothesis to build triangles<span style="font-family: 'Times New Roman', serif;"> 
+ based on the length of the edges taken from the wire</span></p>
+
+<p class="whs2">algo2D.LengthFromEdges()</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># compute the mesh</p>
+
+<p class="whs2">tria.Compute() </p>
+
+<p class="whs2">&nbsp;</p>
+
+<h3>Defining Additional Hypotheses</h3>
+
+<h4><a name=bookmark7>Propagation</a></h4>
+
+<p class="whs2">from geompy import 
+ *</p>
+
+<p class="whs2">import smesh</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a box</p>
+
+<p class="whs2">box = MakeBoxDXDYDZ(10., 
+ 10., 10.)</p>
+
+<p class="whs2">addToStudy(box, &quot;Box&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># get one edge of the 
+ box to put local hypothesis on</p>
+
+<p class="whs2">p5 = MakeVertex(5., 
+ 0., 0.)</p>
+
+<p class="whs2">EdgeX = GetEdgeNearPoint(box, 
+ p5)</p>
+
+<p class="whs2">addToStudyInFather(box, 
+ EdgeX, &quot;Edge [0,0,0 - 10,0,0]&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a hexahedral 
+ mesh on the box</p>
+
+<p class="whs2">hexa = smesh.Mesh(box, 
+ &quot;Box : hexahedrical mesh&quot;)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># set global algorithms 
+ and hypotheses</p>
+
+<p class="whs2">algo1D = hexa.Segment()</p>
+
+<p class="whs2">hexa.Quadrangle()</p>
+
+<p class="whs2">hexa.Hexahedron()</p>
+
+<p class="whs2">algo1D.NumberOfSegments(4)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># create a sub-mesh with 
+ local 1D hypothesis and propagation</p>
+
+<p class="whs2">algo_local = hexa.Segment(EdgeX)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># define &quot;Arithmetic1D&quot; 
+ hypothesis to cut an edge in several segments with increasing length</p>
+
+<p class="whs2">algo_local.Arithmetic1D(1, 
+ 4)</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># define &quot;Propagation&quot; 
+ hypothesis that propagates all other 1D hypotheses</p>
+
+<p class="whs3"># from all edges on the 
+ opposite side of a face in case of quadrangular faces</p>
+
+<p class="whs2">algo_local.Propagation()</p>
+
+<p class="whs2">&nbsp;</p>
+
+<p class="whs3"># compute the mesh</p>
+
+<p><span style="font-family: 'Lucida Console', monospace;">hexa.Compute()</span> 
+ </p>
+
+<h3><a name=bookmark8>Defining Meshing Algorithms</a></h3>
+
+<p class="whs4">import geompy</p>
+
+<p class="whs4">import smesh</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># create a box</p>
+
+<p class="whs4">box = geompy.MakeBoxDXDYDZ(10., 
+ 10., 10.)</p>
+
+<p class="whs4">geompy.addToStudy(box, 
+ &quot;Box&quot;)</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs6"># 1. Create a hexahedral 
+ mesh on the box</p>
+
+<p class="whs4">hexa = smesh.Mesh(box, 
+ &quot;Box : hexahedrical mesh&quot;)</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># create a Regular 1D algorithm 
+ for edges</p>
+
+<p class="whs4">algo1D = hexa.Segment()</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># create a quadrangle 2D 
+ algorithm for faces</p>
+
+<p class="whs4">algo2D = hexa.Quadrangle()</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># create a hexahedron 3D 
+ algorithm for solids</p>
+
+<p class="whs4">algo3D = hexa.Hexahedron()</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># define hypotheses</p>
+
+<p class="whs4">algo1D.Arithmetic1D(1, 
+ 4)</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># compute the mesh</p>
+
+<p class="whs4">hexa.Compute()</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># 2. Create a tetrahedral 
+ mesh on the box</p>
+
+<p class="whs4">tetra = smesh.Mesh(box, 
+ &quot;Box : tetrahedrical mesh&quot;)</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># create a Regular 1D algorithm 
+ for edges</p>
+
+<p class="whs4">algo1D = tetra.Segment()</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># create a Mefisto 2D algorithm 
+ for faces</p>
+
+<p class="whs4">algo2D = tetra.Triangle()</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># create a Netgen 3D algorithm 
+ for solids</p>
+
+<p class="whs4">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># define hypotheses</p>
+
+<p class="whs4">algo1D.Arithmetic1D(1, 
+ 4)</p>
+
+<p class="whs4">algo2D.LengthFromEdges()</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># compute the mesh</p>
+
+<p class="whs4">tetra.Compute()</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># 3. Create a tetrahedral 
+ mesh on the box with NETGEN_2D3D algorithm</p>
+
+<p class="whs4">tetraN = smesh.Mesh(box, 
+ &quot;Box : tetrahedrical mesh by NETGEN_2D3D&quot;)</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># create a Netgen_2D3D 
+ algorithm for solids</p>
+
+<p class="whs4">algo3D = tetraN.Tetrahedron(smesh.FULL_NETGEN) 
+ </p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># define hypotheses</p>
+
+<p class="whs4">n23_params = algo3D.Parameters()</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"># compute the mesh</p>
+
+<p class="whs4">tetraN.Compute() 
+ </p>
+
+<script type="text/javascript" language="javascript1.2">
+<!--
+if (window.writeIntopicBar)
+       writeIntopicBar(0);
+//-->
+</script>
+</body>
+</html>