1 <!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
\r
6 <title>Constructing Meshes</title>
\r
7 <meta http-equiv="content-type" content="text/html; charset=windows-1252">
\r
8 <meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com"><style type="text/css">
\r
10 p.whs1 { margin-top:0pt; margin-bottom:0pt; font-family:'Lucida Console' , monospace; }
\r
11 p.whs2 { margin-top:0pt; margin-bottom:0pt; }
\r
12 p.whs3 { font-family:'Lucida Console' , monospace; margin-top:0px; margin-bottom:0px; }
\r
13 p.whs4 { margin-top:0px; margin-bottom:0px; }
\r
14 p.whs5 { margin-top:0px; margin-bottom:0px; font-family:'Times New Roman' , serif; }
\r
16 </style><script type="text/javascript" language="JavaScript">
\r
18 if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
\r
20 var strNSS = "<style type='text/css'>";
\r
21 strNSS += "p.whs1 {margin-top:1pt;margin-bottom:1pt; }";
\r
22 strNSS += "p.whs2 {margin-top:1pt;margin-bottom:1pt; }";
\r
23 strNSS += "p.whs3 {margin-top:1pt;margin-bottom:1pt; }";
\r
24 strNSS += "p.whs4 {margin-top:1pt;margin-bottom:1pt; }";
\r
25 strNSS += "p.whs5 {margin-top:1pt;margin-bottom:1pt; }";
\r
26 strNSS +="</style>";
\r
27 document.write(strNSS);
\r
31 <script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
\r
34 if (innerWidth != origWidth || innerHeight != origHeight)
\r
37 if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
\r
38 origWidth = innerWidth;
\r
39 origHeight = innerHeight;
\r
45 <style type="text/css">
\r
47 div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
\r
48 p.WebHelpNavBar { text-align:right; }
\r
50 </style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>
\r
51 <script type="text/javascript" language="javascript" src="whver.js"></script>
\r
52 <script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>
\r
53 <script type="text/javascript" language="javascript1.2" src="whutils.js"></script>
\r
54 <script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>
\r
55 <script type="text/javascript" language="javascript1.2">
\r
57 if (window.gbWhTopic)
\r
59 if (window.setRelStartPage)
\r
61 addTocInfo("MESH module\nTUI Scripts\nCreating Meshes");
\r
62 addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");
\r
63 addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");
\r
68 if (window.setRelStartPage)
\r
70 setRelStartPage("index.htm");
\r
80 document.location.reload();
\r
84 <body><script type="text/javascript" language="javascript1.2">
\r
86 if (window.writeIntopicBar)
\r
90 <h1>Creating Meshes</h1>
\r
92 <p>At first see <a href="smesh_py_introduction.htm">Example of 3d mesh generation</a>, using <b>smesh</b> package.
\r
93 <p>Other examples of python scripts will be also updated soon to use <b>smesh</b> package instead of direct usage of idl interface.
\r
95 <h3><a name=bookmark>Construction of a Mesh</a></h3>
\r
97 <p>Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use <b>smesh</b> package.
\r
100 <p class="whs1">import salome</p>
\r
102 <p class="whs1">import geompy</p>
\r
104 <p class="whs1">import StdMeshers</p>
\r
106 <p class="whs1">smesh = salome.lcc.FindOrLoadComponent("FactoryServer",
\r
107 "SMESH")</p>
\r
109 <p class="whs1">smeshgui = salome.ImportComponentGUI("SMESH")</p>
\r
111 <p class="whs1">smeshgui.Init(salome.myStudyId);</p>
\r
113 <p class="whs2"> </p>
\r
115 <p class="whs2"># create a box</p>
\r
117 <p class="whs1">box = geompy.MakeBox(0.,
\r
118 0., 0., 100., 200., 300.)</p>
\r
120 <p class="whs2"> </p>
\r
122 <p class="whs2"># add box to the study</p>
\r
124 <p class="whs1">idbox = geompy.addToStudy(box,
\r
125 "box")</p>
\r
127 <p class="whs2"> </p>
\r
129 <p class="whs2"># create a hypothesis</p>
\r
131 <p class="whs1">print "--------------------------
\r
132 create Hypothesis"</p>
\r
134 <p class="whs1">print "--------------------------
\r
135 NumberOfSegments"</p>
\r
137 <p class="whs1">numberOfSegments
\r
140 <p class="whs1">hypNbSeg = smesh.CreateHypothesis("NumberOfSegments",
\r
141 "libStdMeshersEngine.so")</p>
\r
143 <p class="whs1">hypNbSeg.SetNumberOfSegments(numberOfSegments)</p>
\r
145 <p class="whs1">print hypNbSeg.GetName()</p>
\r
147 <p class="whs1">print hypNbSeg.GetId()</p>
\r
149 <p class="whs1">print hypNbSeg.GetNumberOfSegments()</p>
\r
151 <p class="whs1">smeshgui.SetName(salome.ObjectToID(hypNbSeg),
\r
152 "NumberOfSegments_10")</p>
\r
154 <p class="whs1">print "--------------------------
\r
155 MaxElementArea"</p>
\r
157 <p class="whs1">maxElementArea =
\r
160 <p class="whs1">hypArea = smesh.CreateHypothesis("MaxElementArea",
\r
161 "libStdMeshersEngine.so")</p>
\r
163 <p class="whs1">hypArea.SetMaxElementArea(maxElementArea)</p>
\r
165 <p class="whs1">print hypArea.GetName()</p>
\r
167 <p class="whs1">print hypArea.GetId()</p>
\r
169 <p class="whs1">print hypArea.GetMaxElementArea()</p>
\r
171 <p class="whs1">smeshgui.SetName(salome.ObjectToID(hypArea),
\r
172 "MaxElementArea_500")</p>
\r
174 <p class="whs1">print "--------------------------
\r
175 MaxElementVolume"</p>
\r
177 <p class="whs1">maxElementVolume
\r
180 <p class="whs1">hypVolume = smesh.CreateHypothesis("MaxElementVolume",
\r
181 "libStdMeshersEngine.so")</p>
\r
183 <p class="whs1">hypVolume.SetMaxElementVolume(maxElementVolume)</p>
\r
185 <p class="whs1">print hypVolume.GetName()</p>
\r
187 <p class="whs1">print hypVolume.GetId()</p>
\r
189 <p class="whs1">print hypVolume.GetMaxElementVolume()</p>
\r
191 <p class="whs1">smeshgui.SetName(salome.ObjectToID(hypVolume),
\r
192 "MaxElementVolume_500")</p>
\r
194 <p class="whs2"> </p>
\r
196 <p class="whs2"># create algorithms</p>
\r
198 <p class="whs1">print "--------------------------
\r
199 create Algorithms"</p>
\r
201 <p class="whs1">print "--------------------------
\r
202 Regular_1D"</p>
\r
204 <p class="whs1">regular1D = smesh.CreateHypothesis("Regular_1D",
\r
205 "libStdMeshersEngine.so")</p>
\r
207 <p class="whs1">smeshgui.SetName(salome.ObjectToID(regular1D),
\r
208 "Wire Discretisation")</p>
\r
210 <p class="whs1">print "--------------------------
\r
211 MEFISTO_2D"</p>
\r
213 <p class="whs1">mefisto2D = smesh.CreateHypothesis("MEFISTO_2D",
\r
214 "libStdMeshersEngine.so")</p>
\r
216 <p class="whs1">smeshgui.SetName(salome.ObjectToID(mefisto2D),
\r
217 "MEFISTO_2D")</p>
\r
219 <p class="whs2"> </p>
\r
221 <p class="whs2"># initialize a mesh with
\r
224 <p class="whs1">mesh = smesh.CreateMesh(box)</p>
\r
226 <p class="whs1">smeshgui.SetName(salome.ObjectToID(mesh),
\r
227 "MeshBox")</p>
\r
229 <p class="whs2"> </p>
\r
231 <p class="whs2"># add the hypothesis to
\r
234 <p class="whs1">print "--------------------------
\r
235 add hypothesis to the box"</p>
\r
237 <p class="whs1">mesh.AddHypothesis(box,hypNbSeg)</p>
\r
239 <p class="whs1">mesh.AddHypothesis(box,hypArea)</p>
\r
241 <p class="whs1">mesh.AddHypothesis(box,hypVolume)</p>
\r
243 <p class="whs1">mesh.AddHypothesis(box,regular1D)</p>
\r
245 <p class="whs1">mesh.AddHypothesis(box,mefisto2D)</p>
\r
247 <p class="whs2"> </p>
\r
249 <p class="whs2"># compute the mesh</p>
\r
251 <p class="whs1">print "--------------------------
\r
252 compute the mesh of the box"</p>
\r
254 <p class="whs1">ret = smesh.Compute(mesh,box)</p>
\r
256 <p class="whs1">print ret</p>
\r
258 <p class="whs1">if ret == 0:</p>
\r
260 <p class="whs1"> print
\r
261 "probleme when computing the mesh"</p>
\r
263 <p class="whs1">salome.sg.updateObjBrowser(1)</p>
\r
265 <p class="whs1"> </p>
\r
267 <h3><a name=bookmark1>Construction of a Submesh</a></h3>
\r
269 <p class="whs3"> </p>
\r
271 <p class="whs3"><span style="font-family: 'Lucida Console', monospace;">from
\r
272 geompy import *</span></p>
\r
274 <p class="whs3">import smesh</p>
\r
276 <p class="whs4"> </p>
\r
278 <p class="whs4"># create vertices</p>
\r
280 <p class="whs3">Point111 = MakeVertex( 0, 0,
\r
283 <p class="whs3">Point211 = MakeVertex(10, 0,
\r
286 <p class="whs3">Point121 = MakeVertex( 0, 10, 0)</p>
\r
288 <p class="whs3">Point221 = MakeVertex(10, 10, 0)</p>
\r
290 <p class="whs3">Point112 = MakeVertex( 0, 0,
\r
293 <p class="whs3">Point212 = MakeVertex(10, 0,
\r
296 <p class="whs3">Point122 = MakeVertex( 0, 10, 10)</p>
\r
298 <p class="whs3">Point222 = MakeVertex(10, 10, 10)</p>
\r
300 <p class="whs4"> </p>
\r
302 <p class="whs4"># create edges</p>
\r
304 <p class="whs3">EdgeX111 = MakeEdge(Point111, Point211)</p>
\r
306 <p class="whs3">EdgeX121 = MakeEdge(Point121, Point221)</p>
\r
308 <p class="whs3">EdgeX112 = MakeEdge(Point112, Point212)</p>
\r
310 <p class="whs3">EdgeX122 = MakeEdge(Point122, Point222)</p>
\r
312 <p class="whs3">EdgeY11 = MakeEdge(Point111, Point121)</p>
\r
314 <p class="whs3">EdgeY21 = MakeEdge(Point211, Point221)</p>
\r
316 <p class="whs3">EdgeY12 = MakeEdge(Point112, Point122)</p>
\r
318 <p class="whs3">EdgeY22 = MakeEdge(Point212, Point222)</p>
\r
320 <p class="whs3">EdgeZ111 = MakeEdge(Point111, Point112)</p>
\r
322 <p class="whs3">EdgeZ211 = MakeEdge(Point211, Point212)</p>
\r
324 <p class="whs3">EdgeZ121 = MakeEdge(Point121, Point122)</p>
\r
326 <p class="whs3">EdgeZ221 = MakeEdge(Point221, Point222)</p>
\r
328 <p class="whs4"> </p>
\r
330 <p class="whs4"># create faces</p>
\r
332 <p class="whs3">FaceX11 = MakeQuad(EdgeY11, EdgeZ111,
\r
333 EdgeY12, EdgeZ121)</p>
\r
335 <p class="whs3">FaceX21 = MakeQuad(EdgeY21, EdgeZ211,
\r
336 EdgeY22, EdgeZ221)</p>
\r
338 <p class="whs3">FaceY111 = MakeQuad(EdgeX111, EdgeZ111,
\r
339 EdgeX112, EdgeZ211)</p>
\r
341 <p class="whs3">FaceY121 = MakeQuad(EdgeX121, EdgeZ121,
\r
342 EdgeX122, EdgeZ221)</p>
\r
344 <p class="whs3">FaceZ11 = MakeQuad(EdgeX111, EdgeY11,
\r
345 EdgeX121, EdgeY21)</p>
\r
347 <p class="whs3">FaceZ12 = MakeQuad(EdgeX112, EdgeY12,
\r
348 EdgeX122, EdgeY22)</p>
\r
350 <p class="whs4"> </p>
\r
352 <p class="whs4"># create a solid</p>
\r
354 <p class="whs3">Block = MakeHexa(FaceX11, FaceX21, FaceY111,
\r
355 FaceY121, FaceZ11, FaceZ12)</p>
\r
357 <p class="whs4"> </p>
\r
359 <p class="whs4"># create a compound</p>
\r
361 <p class="whs3">box = MakeCompound([Block])</p>
\r
363 <p class="whs4"> </p>
\r
365 <p class="whs4"># add in the study</p>
\r
367 <p class="whs3">box_id = addToStudy(box, "Box compound")</p>
\r
369 <p class="whs4"> </p>
\r
371 <p class="whs4"># create hexahedral mesh
\r
374 <p class="whs3">hexa = smesh.Mesh(box, "Box compound
\r
375 : hexahedrical mesh")</p>
\r
377 <p class="whs3">algo = hexa.Segment()</p>
\r
379 <p class="whs4"> </p>
\r
381 <p class="whs4"># define "NumberOfSegments"
\r
382 hypothesis to cut the edge in a fixed number of segments</p>
\r
384 <p class="whs3">algo.NumberOfSegments(4)</p>
\r
386 <p class="whs4"> </p>
\r
388 <p class="whs4"># creates a quadrangle
\r
389 2D algorithm for the faces</p>
\r
391 <p class="whs3">hexa.Quadrangle()</p>
\r
393 <p class="whs4"> </p>
\r
395 <p class="whs4"># construct a submesh with
\r
396 a local hypothesis</p>
\r
398 <p class="whs3">algo = hexa.Segment(EdgeX111)</p>
\r
400 <p class="whs4"> </p>
\r
402 <p class="whs4"># define "Arithmetic1D"
\r
403 hypothesis to cut an edge in several segments with increasing arithmetic
\r
406 <p class="whs3">algo.Arithmetic1D(1, 4)</p>
\r
408 <p class="whs4"> </p>
\r
410 <p class="whs4"># define "Propagation"
\r
411 hypothesis that propagates all other hypothesis on all edges on the opposite
\r
412 side in case of quadrangular faces</p>
\r
414 <p class="whs3">algo.Propagation()</p>
\r
416 <p class="whs4"> </p>
\r
418 <p class="whs4"># compute the mesh</p>
\r
420 <p class="whs3">hexa.Compute() </p>
\r
422 <p class="whs3"> </p>
\r
424 <h3><a name=bookmark2>Editing of a mesh</a></h3>
\r
426 <p>Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use <b>smesh</b> package.
\r
429 <p class="whs3"> </p>
\r
431 <p class="whs3"><span style="font-family: 'Lucida Console', monospace;">import
\r
434 <p class="whs3">import geompy</p>
\r
436 <p class="whs3">import SMESH</p>
\r
438 <p class="whs3">import StdMeshers</p>
\r
440 <p class="whs3"> </p>
\r
442 <p class="whs3">smesh = salome.lcc.FindOrLoadComponent("FactoryServer",
\r
443 "SMESH")</p>
\r
445 <p class="whs3">smesh.SetCurrentStudy(salome.myStudy)</p>
\r
447 <p class="whs3"> </p>
\r
449 <p class="whs3">box =
\r
450 geompy.MakeBox(0., 0., 0., 20., 20., 20.)</p>
\r
452 <p class="whs3">idbox = geompy.addToStudy(box, "box")</p>
\r
454 <p class="whs3"> </p>
\r
456 <p class="whs3">subShapeList = geompy.SubShapeAll(box,
\r
457 geompy.ShapeType["EDGE"])</p>
\r
459 <p class="whs3">edge =
\r
460 subShapeList[0]</p>
\r
462 <p class="whs3">name =
\r
463 geompy.SubShapeName(edge, box)</p>
\r
465 <p class="whs3">idedge = geompy.addToStudyInFather(box,
\r
468 <p class="whs3"> </p>
\r
470 <p class="whs3">box =
\r
471 salome.IDToObject(idbox)</p>
\r
473 <p class="whs3">edge = salome.IDToObject(idedge)</p>
\r
475 <p class="whs3"> </p>
\r
477 <p class="whs3">hyp1 = smesh.CreateHypothesis("NumberOfSegments",
\r
478 "libStdMeshersEngine.so")</p>
\r
480 <p class="whs3">hyp1.SetNumberOfSegments(3)</p>
\r
482 <p class="whs3">hyp2 = smesh.CreateHypothesis("MaxElementArea",
\r
483 "libStdMeshersEngine.so")</p>
\r
485 <p class="whs3">hyp2.SetMaxElementArea(10)</p>
\r
487 <p class="whs3">hyp3 = smesh.CreateHypothesis("Arithmetic1D",
\r
488 "libStdMeshersEngine.so")</p>
\r
490 <p class="whs3">hyp3.SetLength(1,1)</p>
\r
492 <p class="whs3">hyp3.SetLength(6,0)</p>
\r
494 <p class="whs3">hyp4 = smesh.CreateHypothesis("Propagation",
\r
495 "libStdMeshersEngine.so")</p>
\r
497 <p class="whs3"> </p>
\r
499 <p class="whs3">algo1 = smesh.CreateHypothesis("Regular_1D",
\r
500 "libStdMeshersEngine.so")</p>
\r
502 <p class="whs3">algo2 = smesh.CreateHypothesis("MEFISTO_2D",
\r
503 "libStdMeshersEngine.so")</p>
\r
505 <p class="whs3"> </p>
\r
507 <p class="whs3">mesh = smesh.CreateMesh(box)</p>
\r
509 <p class="whs3">mesh.AddHypothesis(box,hyp1)</p>
\r
511 <p class="whs3">mesh.AddHypothesis(box,hyp2)</p>
\r
513 <p class="whs3">mesh.AddHypothesis(box,algo1)</p>
\r
515 <p class="whs3">mesh.AddHypothesis(box,algo2)</p>
\r
517 <p class="whs3">mesh.AddHypothesis(edge,hyp3)</p>
\r
519 <p class="whs3">mesh.AddHypothesis(edge,hyp4)</p>
\r
521 <p class="whs3">mesh.AddHypothesis(edge,algo1)</p>
\r
523 <p class="whs3"> </p>
\r
525 <p class="whs3">smesh.Compute(mesh,box)</p>
\r
527 <p class="whs3">salome.sg.updateObjBrowser(1)</p>
\r
529 <p class="whs3"> </p>
\r
531 <p class="whs5"># remove a hypothesis</p>
\r
533 <p class="whs3">mesh.RemoveHypothesis(edge,hyp4)</p>
\r
535 <p class="whs3"> </p>
\r
537 <p class="whs3">smesh.Compute(mesh,box)</p>
\r
539 <p class="whs3">salome.sg.updateObjBrowser(1)</p>
\r
541 <p class="whs3"> </p>
\r
543 <p class="whs5"># change the value
\r
544 of the hypothesis</p>
\r
546 <p class="whs3">hyp2.SetMaxElementArea(2)</p>
\r
548 <p class="whs3">mesh.AddHypothesis(box,hyp2)</p>
\r
550 <p class="whs3"> </p>
\r
552 <p class="whs3">smesh.Compute(mesh,box)</p>
\r
554 <p class="whs3">salome.sg.updateObjBrowser(1) </p>
\r
556 <p class="whs4"> </p>
\r
558 <h3><a name=bookmark3>Export of a Mesh</a></h3>
\r
560 <p>Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use <b>smesh</b> package.
\r
563 <p class="whs4"> </p>
\r
565 <p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import
\r
568 <p class="whs1">import geompy</p>
\r
570 <p class="whs1">import StdMeshers</p>
\r
572 <p class="whs1">smesh = salome.lcc.FindOrLoadComponent("FactoryServer",
\r
573 "SMESH")</p>
\r
575 <p class="whs1">smeshgui = salome.ImportComponentGUI("SMESH")</p>
\r
577 <p class="whs1">smeshgui.Init(salome.myStudyId);</p>
\r
579 <p class="whs2"> </p>
\r
581 <p class="whs2"># create a box</p>
\r
583 <p class="whs1">box = geompy.MakeBox(0.,
\r
584 0., 0., 100., 200., 300.)</p>
\r
586 <p class="whs2"> </p>
\r
588 <p class="whs2"># add the box to the study</p>
\r
590 <p class="whs1">idbox = geompy.addToStudy(box,
\r
591 "box")</p>
\r
593 <p class="whs2"> </p>
\r
595 <p class="whs2"># create a hypothesis</p>
\r
597 <p class="whs1">print "--------------------------
\r
598 create Hypothesis"</p>
\r
600 <p class="whs1">print "--------------------------
\r
601 NumberOfSegments"</p>
\r
603 <p class="whs1">numberOfSegments
\r
606 <p class="whs1">hypNbSeg = smesh.CreateHypothesis("NumberOfSegments",
\r
607 "libStdMeshersEngine.so")</p>
\r
609 <p class="whs1">hypNbSeg.SetNumberOfSegments(numberOfSegments)</p>
\r
611 <p class="whs1">print hypNbSeg.GetName()</p>
\r
613 <p class="whs1">print hypNbSeg.GetId()</p>
\r
615 <p class="whs1">print hypNbSeg.GetNumberOfSegments()</p>
\r
617 <p class="whs1">smeshgui.SetName(salome.ObjectToID(hypNbSeg),
\r
618 "NumberOfSegments_10")</p>
\r
620 <p class="whs1">print "--------------------------
\r
621 MaxElementArea"</p>
\r
623 <p class="whs1">maxElementArea =
\r
626 <p class="whs1">hypArea = smesh.CreateHypothesis("MaxElementArea",
\r
627 "libStdMeshersEngine.so")</p>
\r
629 <p class="whs1">hypArea.SetMaxElementArea(maxElementArea)</p>
\r
631 <p class="whs1">print hypArea.GetName()</p>
\r
633 <p class="whs1">print hypArea.GetId()</p>
\r
635 <p class="whs1">print hypArea.GetMaxElementArea()</p>
\r
637 <p class="whs1">smeshgui.SetName(salome.ObjectToID(hypArea),
\r
638 "MaxElementArea_500")</p>
\r
640 <p class="whs1">print "--------------------------
\r
641 MaxElementVolume"</p>
\r
643 <p class="whs1">maxElementVolume
\r
646 <p class="whs1">hypVolume = smesh.CreateHypothesis("MaxElementVolume",
\r
647 "libStdMeshersEngine.so")</p>
\r
649 <p class="whs1">hypVolume.SetMaxElementVolume(maxElementVolume)</p>
\r
651 <p class="whs1">print hypVolume.GetName()</p>
\r
653 <p class="whs1">print hypVolume.GetId()</p>
\r
655 <p class="whs1">print hypVolume.GetMaxElementVolume()</p>
\r
657 <p class="whs1">smeshgui.SetName(salome.ObjectToID(hypVolume),
\r
658 "MaxElementVolume_500")</p>
\r
660 <p class="whs2"> </p>
\r
662 <p class="whs2"># create algorithms</p>
\r
664 <p class="whs1">print "--------------------------
\r
665 create Algorithms"</p>
\r
667 <p class="whs1">print "--------------------------
\r
668 Regular_1D"</p>
\r
670 <p class="whs1">regular1D = smesh.CreateHypothesis("Regular_1D",
\r
671 "libStdMeshersEngine.so")</p>
\r
673 <p class="whs1">smeshgui.SetName(salome.ObjectToID(regular1D),
\r
674 "Wire Discretisation")</p>
\r
676 <p class="whs1">print "--------------------------
\r
677 MEFISTO_2D"</p>
\r
679 <p class="whs1">mefisto2D = smesh.CreateHypothesis("MEFISTO_2D",
\r
680 "libStdMeshersEngine.so")</p>
\r
682 <p class="whs1">smeshgui.SetName(salome.ObjectToID(mefisto2D),
\r
683 "MEFISTO_2D")</p>
\r
685 <p class="whs2"> </p>
\r
687 <p class="whs2"># initialize a mesh with
\r
690 <p class="whs1">mesh = smesh.CreateMesh(box)</p>
\r
692 <p class="whs1">smeshgui.SetName(salome.ObjectToID(mesh),
\r
693 "MeshBox")</p>
\r
695 <p class="whs1"> </p>
\r
697 <p class="whs2"># add the hypothesis to
\r
700 <p class="whs1">print "--------------------------
\r
701 add hypothesis to the box"</p>
\r
703 <p class="whs1">mesh.AddHypothesis(box,hypNbSeg)</p>
\r
705 <p class="whs1">mesh.AddHypothesis(box,hypArea)</p>
\r
707 <p class="whs1">mesh.AddHypothesis(box,hypVolume)</p>
\r
709 <p class="whs1">mesh.AddHypothesis(box,regular1D)</p>
\r
711 <p class="whs1">mesh.AddHypothesis(box,mefisto2D)</p>
\r
713 <p class="whs2"> </p>
\r
715 <p class="whs2"># compute the mesh</p>
\r
717 <p class="whs1">print "--------------------------
\r
718 compute the mesh of the box"</p>
\r
720 <p class="whs1">ret = smesh.Compute(mesh,box)</p>
\r
722 <p class="whs1">print ret</p>
\r
724 <p class="whs1">if ret == 0:</p>
\r
726 <p class="whs1"> print
\r
727 "probleme when computing the mesh"</p>
\r
729 <p class="whs1">salome.sg.updateObjBrowser(1)</p>
\r
731 <p class="whs1">mesh.ExportMED("/tmp/meshMED.med",0)</p>
\r
733 <p class="whs2"> </p>
\r
735 <p class="whs4"> </p>
\r
737 <script type="text/javascript" language="javascript1.2">
\r
739 if (window.writeIntopicBar)
\r
740 writeIntopicBar(0);
\r