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 <h3><a name=bookmark>Construction of a Mesh</a></h3>
\r
94 <p class="whs1">import salome</p>
\r
96 <p class="whs1">import geompy</p>
\r
98 <p class="whs1">import StdMeshers</p>
\r
100 <p class="whs1">smesh = salome.lcc.FindOrLoadComponent("FactoryServer",
\r
101 "SMESH")</p>
\r
103 <p class="whs1">smeshgui = salome.ImportComponentGUI("SMESH")</p>
\r
105 <p class="whs1">smeshgui.Init(salome.myStudyId);</p>
\r
107 <p class="whs2"> </p>
\r
109 <p class="whs2"># create a box</p>
\r
111 <p class="whs1">box = geompy.MakeBox(0.,
\r
112 0., 0., 100., 200., 300.)</p>
\r
114 <p class="whs2"> </p>
\r
116 <p class="whs2"># add box to the study</p>
\r
118 <p class="whs1">idbox = geompy.addToStudy(box,
\r
119 "box")</p>
\r
121 <p class="whs2"> </p>
\r
123 <p class="whs2"># create a hypothesis</p>
\r
125 <p class="whs1">print "--------------------------
\r
126 create Hypothesis"</p>
\r
128 <p class="whs1">print "--------------------------
\r
129 NumberOfSegments"</p>
\r
131 <p class="whs1">numberOfSegments
\r
134 <p class="whs1">hypNbSeg = smesh.CreateHypothesis("NumberOfSegments",
\r
135 "libStdMeshersEngine.so")</p>
\r
137 <p class="whs1">hypNbSeg.SetNumberOfSegments(numberOfSegments)</p>
\r
139 <p class="whs1">print hypNbSeg.GetName()</p>
\r
141 <p class="whs1">print hypNbSeg.GetId()</p>
\r
143 <p class="whs1">print hypNbSeg.GetNumberOfSegments()</p>
\r
145 <p class="whs1">smeshgui.SetName(salome.ObjectToID(hypNbSeg),
\r
146 "NumberOfSegments_10")</p>
\r
148 <p class="whs1">print "--------------------------
\r
149 MaxElementArea"</p>
\r
151 <p class="whs1">maxElementArea =
\r
154 <p class="whs1">hypArea = smesh.CreateHypothesis("MaxElementArea",
\r
155 "libStdMeshersEngine.so")</p>
\r
157 <p class="whs1">hypArea.SetMaxElementArea(maxElementArea)</p>
\r
159 <p class="whs1">print hypArea.GetName()</p>
\r
161 <p class="whs1">print hypArea.GetId()</p>
\r
163 <p class="whs1">print hypArea.GetMaxElementArea()</p>
\r
165 <p class="whs1">smeshgui.SetName(salome.ObjectToID(hypArea),
\r
166 "MaxElementArea_500")</p>
\r
168 <p class="whs1">print "--------------------------
\r
169 MaxElementVolume"</p>
\r
171 <p class="whs1">maxElementVolume
\r
174 <p class="whs1">hypVolume = smesh.CreateHypothesis("MaxElementVolume",
\r
175 "libStdMeshersEngine.so")</p>
\r
177 <p class="whs1">hypVolume.SetMaxElementVolume(maxElementVolume)</p>
\r
179 <p class="whs1">print hypVolume.GetName()</p>
\r
181 <p class="whs1">print hypVolume.GetId()</p>
\r
183 <p class="whs1">print hypVolume.GetMaxElementVolume()</p>
\r
185 <p class="whs1">smeshgui.SetName(salome.ObjectToID(hypVolume),
\r
186 "MaxElementVolume_500")</p>
\r
188 <p class="whs2"> </p>
\r
190 <p class="whs2"># create algorithms</p>
\r
192 <p class="whs1">print "--------------------------
\r
193 create Algorithms"</p>
\r
195 <p class="whs1">print "--------------------------
\r
196 Regular_1D"</p>
\r
198 <p class="whs1">regular1D = smesh.CreateHypothesis("Regular_1D",
\r
199 "libStdMeshersEngine.so")</p>
\r
201 <p class="whs1">smeshgui.SetName(salome.ObjectToID(regular1D),
\r
202 "Wire Discretisation")</p>
\r
204 <p class="whs1">print "--------------------------
\r
205 MEFISTO_2D"</p>
\r
207 <p class="whs1">mefisto2D = smesh.CreateHypothesis("MEFISTO_2D",
\r
208 "libStdMeshersEngine.so")</p>
\r
210 <p class="whs1">smeshgui.SetName(salome.ObjectToID(mefisto2D),
\r
211 "MEFISTO_2D")</p>
\r
213 <p class="whs2"> </p>
\r
215 <p class="whs2"># initialize a mesh with
\r
218 <p class="whs1">mesh = smesh.CreateMesh(box)</p>
\r
220 <p class="whs1">smeshgui.SetName(salome.ObjectToID(mesh),
\r
221 "MeshBox")</p>
\r
223 <p class="whs2"> </p>
\r
225 <p class="whs2"># add the hypothesis to
\r
228 <p class="whs1">print "--------------------------
\r
229 add hypothesis to the box"</p>
\r
231 <p class="whs1">mesh.AddHypothesis(box,hypNbSeg)</p>
\r
233 <p class="whs1">mesh.AddHypothesis(box,hypArea)</p>
\r
235 <p class="whs1">mesh.AddHypothesis(box,hypVolume)</p>
\r
237 <p class="whs1">mesh.AddHypothesis(box,regular1D)</p>
\r
239 <p class="whs1">mesh.AddHypothesis(box,mefisto2D)</p>
\r
241 <p class="whs2"> </p>
\r
243 <p class="whs2"># compute the mesh</p>
\r
245 <p class="whs1">print "--------------------------
\r
246 compute the mesh of the box"</p>
\r
248 <p class="whs1">ret = smesh.Compute(mesh,box)</p>
\r
250 <p class="whs1">print ret</p>
\r
252 <p class="whs1">if ret == 0:</p>
\r
254 <p class="whs1"> print
\r
255 "probleme when computing the mesh"</p>
\r
257 <p class="whs1">salome.sg.updateObjBrowser(1)</p>
\r
259 <p class="whs1"> </p>
\r
261 <h3><a name=bookmark1>Construction of a Submesh</a></h3>
\r
263 <p class="whs3"> </p>
\r
265 <p class="whs3"><span style="font-family: 'Lucida Console', monospace;">from
\r
266 geompy import *</span></p>
\r
268 <p class="whs3">import smesh</p>
\r
270 <p class="whs4"> </p>
\r
272 <p class="whs4"># create vertices</p>
\r
274 <p class="whs3">Point111 = MakeVertex( 0, 0,
\r
277 <p class="whs3">Point211 = MakeVertex(10, 0,
\r
280 <p class="whs3">Point121 = MakeVertex( 0, 10, 0)</p>
\r
282 <p class="whs3">Point221 = MakeVertex(10, 10, 0)</p>
\r
284 <p class="whs3">Point112 = MakeVertex( 0, 0,
\r
287 <p class="whs3">Point212 = MakeVertex(10, 0,
\r
290 <p class="whs3">Point122 = MakeVertex( 0, 10, 10)</p>
\r
292 <p class="whs3">Point222 = MakeVertex(10, 10, 10)</p>
\r
294 <p class="whs4"> </p>
\r
296 <p class="whs4"># create edges</p>
\r
298 <p class="whs3">EdgeX111 = MakeEdge(Point111, Point211)</p>
\r
300 <p class="whs3">EdgeX121 = MakeEdge(Point121, Point221)</p>
\r
302 <p class="whs3">EdgeX112 = MakeEdge(Point112, Point212)</p>
\r
304 <p class="whs3">EdgeX122 = MakeEdge(Point122, Point222)</p>
\r
306 <p class="whs3">EdgeY11 = MakeEdge(Point111, Point121)</p>
\r
308 <p class="whs3">EdgeY21 = MakeEdge(Point211, Point221)</p>
\r
310 <p class="whs3">EdgeY12 = MakeEdge(Point112, Point122)</p>
\r
312 <p class="whs3">EdgeY22 = MakeEdge(Point212, Point222)</p>
\r
314 <p class="whs3">EdgeZ111 = MakeEdge(Point111, Point112)</p>
\r
316 <p class="whs3">EdgeZ211 = MakeEdge(Point211, Point212)</p>
\r
318 <p class="whs3">EdgeZ121 = MakeEdge(Point121, Point122)</p>
\r
320 <p class="whs3">EdgeZ221 = MakeEdge(Point221, Point222)</p>
\r
322 <p class="whs4"> </p>
\r
324 <p class="whs4"># create faces</p>
\r
326 <p class="whs3">FaceX11 = MakeQuad(EdgeY11, EdgeZ111,
\r
327 EdgeY12, EdgeZ121)</p>
\r
329 <p class="whs3">FaceX21 = MakeQuad(EdgeY21, EdgeZ211,
\r
330 EdgeY22, EdgeZ221)</p>
\r
332 <p class="whs3">FaceY111 = MakeQuad(EdgeX111, EdgeZ111,
\r
333 EdgeX112, EdgeZ211)</p>
\r
335 <p class="whs3">FaceY121 = MakeQuad(EdgeX121, EdgeZ121,
\r
336 EdgeX122, EdgeZ221)</p>
\r
338 <p class="whs3">FaceZ11 = MakeQuad(EdgeX111, EdgeY11,
\r
339 EdgeX121, EdgeY21)</p>
\r
341 <p class="whs3">FaceZ12 = MakeQuad(EdgeX112, EdgeY12,
\r
342 EdgeX122, EdgeY22)</p>
\r
344 <p class="whs4"> </p>
\r
346 <p class="whs4"># create a solid</p>
\r
348 <p class="whs3">Block = MakeHexa(FaceX11, FaceX21, FaceY111,
\r
349 FaceY121, FaceZ11, FaceZ12)</p>
\r
351 <p class="whs4"> </p>
\r
353 <p class="whs4"># create a compound</p>
\r
355 <p class="whs3">box = MakeCompound([Block])</p>
\r
357 <p class="whs4"> </p>
\r
359 <p class="whs4"># add in the study</p>
\r
361 <p class="whs3">box_id = addToStudy(box, "Box compound")</p>
\r
363 <p class="whs4"> </p>
\r
365 <p class="whs4"># create hexahedral mesh
\r
368 <p class="whs3">hexa = smesh.Mesh(box, "Box compound
\r
369 : hexahedrical mesh")</p>
\r
371 <p class="whs3">algo = hexa.Segment()</p>
\r
373 <p class="whs4"> </p>
\r
375 <p class="whs4"># define "NumberOfSegments"
\r
376 hypothesis to cut the edge in a fixed number of segments</p>
\r
378 <p class="whs3">algo.NumberOfSegments(4)</p>
\r
380 <p class="whs4"> </p>
\r
382 <p class="whs4"># creates a quadrangle
\r
383 2D algorithm for the faces</p>
\r
385 <p class="whs3">hexa.Quadrangle()</p>
\r
387 <p class="whs4"> </p>
\r
389 <p class="whs4"># construct a submesh with
\r
390 a local hypothesis</p>
\r
392 <p class="whs3">algo = hexa.Segment(EdgeX111)</p>
\r
394 <p class="whs4"> </p>
\r
396 <p class="whs4"># define "Arithmetic1D"
\r
397 hypothesis to cut an edge in several segments with increasing arithmetic
\r
400 <p class="whs3">algo.Arithmetic1D(1, 4)</p>
\r
402 <p class="whs4"> </p>
\r
404 <p class="whs4"># define "Propagation"
\r
405 hypothesis that propagates all other hypothesis on all edges on the opposite
\r
406 side in case of quadrangular faces</p>
\r
408 <p class="whs3">algo.Propagation()</p>
\r
410 <p class="whs4"> </p>
\r
412 <p class="whs4"># compute the mesh</p>
\r
414 <p class="whs3">hexa.Compute() </p>
\r
416 <p class="whs3"> </p>
\r
418 <h3><a name=bookmark2>Editing of a mesh</a></h3>
\r
420 <p class="whs3"> </p>
\r
422 <p class="whs3"><span style="font-family: 'Lucida Console', monospace;">import
\r
425 <p class="whs3">import geompy</p>
\r
427 <p class="whs3">import SMESH</p>
\r
429 <p class="whs3">import StdMeshers</p>
\r
431 <p class="whs3"> </p>
\r
433 <p class="whs3">smesh = salome.lcc.FindOrLoadComponent("FactoryServer",
\r
434 "SMESH")</p>
\r
436 <p class="whs3">smesh.SetCurrentStudy(salome.myStudy)</p>
\r
438 <p class="whs3"> </p>
\r
440 <p class="whs3">box =
\r
441 geompy.MakeBox(0., 0., 0., 20., 20., 20.)</p>
\r
443 <p class="whs3">idbox = geompy.addToStudy(box, "box")</p>
\r
445 <p class="whs3"> </p>
\r
447 <p class="whs3">subShapeList = geompy.SubShapeAll(box,
\r
448 geompy.ShapeType["EDGE"])</p>
\r
450 <p class="whs3">edge =
\r
451 subShapeList[0]</p>
\r
453 <p class="whs3">name =
\r
454 geompy.SubShapeName(edge, box)</p>
\r
456 <p class="whs3">idedge = geompy.addToStudyInFather(box,
\r
459 <p class="whs3"> </p>
\r
461 <p class="whs3">box =
\r
462 salome.IDToObject(idbox)</p>
\r
464 <p class="whs3">edge = salome.IDToObject(idedge)</p>
\r
466 <p class="whs3"> </p>
\r
468 <p class="whs3">hyp1 = smesh.CreateHypothesis("NumberOfSegments",
\r
469 "libStdMeshersEngine.so")</p>
\r
471 <p class="whs3">hyp1.SetNumberOfSegments(3)</p>
\r
473 <p class="whs3">hyp2 = smesh.CreateHypothesis("MaxElementArea",
\r
474 "libStdMeshersEngine.so")</p>
\r
476 <p class="whs3">hyp2.SetMaxElementArea(10)</p>
\r
478 <p class="whs3">hyp3 = smesh.CreateHypothesis("Arithmetic1D",
\r
479 "libStdMeshersEngine.so")</p>
\r
481 <p class="whs3">hyp3.SetLength(1,1)</p>
\r
483 <p class="whs3">hyp3.SetLength(6,0)</p>
\r
485 <p class="whs3">hyp4 = smesh.CreateHypothesis("Propagation",
\r
486 "libStdMeshersEngine.so")</p>
\r
488 <p class="whs3"> </p>
\r
490 <p class="whs3">algo1 = smesh.CreateHypothesis("Regular_1D",
\r
491 "libStdMeshersEngine.so")</p>
\r
493 <p class="whs3">algo2 = smesh.CreateHypothesis("MEFISTO_2D",
\r
494 "libStdMeshersEngine.so")</p>
\r
496 <p class="whs3"> </p>
\r
498 <p class="whs3">mesh = smesh.CreateMesh(box)</p>
\r
500 <p class="whs3">mesh.AddHypothesis(box,hyp1)</p>
\r
502 <p class="whs3">mesh.AddHypothesis(box,hyp2)</p>
\r
504 <p class="whs3">mesh.AddHypothesis(box,algo1)</p>
\r
506 <p class="whs3">mesh.AddHypothesis(box,algo2)</p>
\r
508 <p class="whs3">mesh.AddHypothesis(edge,hyp3)</p>
\r
510 <p class="whs3">mesh.AddHypothesis(edge,hyp4)</p>
\r
512 <p class="whs3">mesh.AddHypothesis(edge,algo1)</p>
\r
514 <p class="whs3"> </p>
\r
516 <p class="whs3">smesh.Compute(mesh,box)</p>
\r
518 <p class="whs3">salome.sg.updateObjBrowser(1)</p>
\r
520 <p class="whs3"> </p>
\r
522 <p class="whs5"># remove a hypothesis</p>
\r
524 <p class="whs3">mesh.RemoveHypothesis(edge,hyp4)</p>
\r
526 <p class="whs3"> </p>
\r
528 <p class="whs3">smesh.Compute(mesh,box)</p>
\r
530 <p class="whs3">salome.sg.updateObjBrowser(1)</p>
\r
532 <p class="whs3"> </p>
\r
534 <p class="whs5"># change the value
\r
535 of the hypothesis</p>
\r
537 <p class="whs3">hyp2.SetMaxElementArea(2)</p>
\r
539 <p class="whs3">mesh.AddHypothesis(box,hyp2)</p>
\r
541 <p class="whs3"> </p>
\r
543 <p class="whs3">smesh.Compute(mesh,box)</p>
\r
545 <p class="whs3">salome.sg.updateObjBrowser(1) </p>
\r
547 <p class="whs4"> </p>
\r
549 <h3><a name=bookmark3>Export of a Mesh</a></h3>
\r
551 <p class="whs4"> </p>
\r
553 <p class="whs1"><span style="font-family: 'Lucida Console', monospace;">import
\r
556 <p class="whs1">import geompy</p>
\r
558 <p class="whs1">import StdMeshers</p>
\r
560 <p class="whs1">smesh = salome.lcc.FindOrLoadComponent("FactoryServer",
\r
561 "SMESH")</p>
\r
563 <p class="whs1">smeshgui = salome.ImportComponentGUI("SMESH")</p>
\r
565 <p class="whs1">smeshgui.Init(salome.myStudyId);</p>
\r
567 <p class="whs2"> </p>
\r
569 <p class="whs2"># create a box</p>
\r
571 <p class="whs1">box = geompy.MakeBox(0.,
\r
572 0., 0., 100., 200., 300.)</p>
\r
574 <p class="whs2"> </p>
\r
576 <p class="whs2"># add the box to the study</p>
\r
578 <p class="whs1">idbox = geompy.addToStudy(box,
\r
579 "box")</p>
\r
581 <p class="whs2"> </p>
\r
583 <p class="whs2"># create a hypothesis</p>
\r
585 <p class="whs1">print "--------------------------
\r
586 create Hypothesis"</p>
\r
588 <p class="whs1">print "--------------------------
\r
589 NumberOfSegments"</p>
\r
591 <p class="whs1">numberOfSegments
\r
594 <p class="whs1">hypNbSeg = smesh.CreateHypothesis("NumberOfSegments",
\r
595 "libStdMeshersEngine.so")</p>
\r
597 <p class="whs1">hypNbSeg.SetNumberOfSegments(numberOfSegments)</p>
\r
599 <p class="whs1">print hypNbSeg.GetName()</p>
\r
601 <p class="whs1">print hypNbSeg.GetId()</p>
\r
603 <p class="whs1">print hypNbSeg.GetNumberOfSegments()</p>
\r
605 <p class="whs1">smeshgui.SetName(salome.ObjectToID(hypNbSeg),
\r
606 "NumberOfSegments_10")</p>
\r
608 <p class="whs1">print "--------------------------
\r
609 MaxElementArea"</p>
\r
611 <p class="whs1">maxElementArea =
\r
614 <p class="whs1">hypArea = smesh.CreateHypothesis("MaxElementArea",
\r
615 "libStdMeshersEngine.so")</p>
\r
617 <p class="whs1">hypArea.SetMaxElementArea(maxElementArea)</p>
\r
619 <p class="whs1">print hypArea.GetName()</p>
\r
621 <p class="whs1">print hypArea.GetId()</p>
\r
623 <p class="whs1">print hypArea.GetMaxElementArea()</p>
\r
625 <p class="whs1">smeshgui.SetName(salome.ObjectToID(hypArea),
\r
626 "MaxElementArea_500")</p>
\r
628 <p class="whs1">print "--------------------------
\r
629 MaxElementVolume"</p>
\r
631 <p class="whs1">maxElementVolume
\r
634 <p class="whs1">hypVolume = smesh.CreateHypothesis("MaxElementVolume",
\r
635 "libStdMeshersEngine.so")</p>
\r
637 <p class="whs1">hypVolume.SetMaxElementVolume(maxElementVolume)</p>
\r
639 <p class="whs1">print hypVolume.GetName()</p>
\r
641 <p class="whs1">print hypVolume.GetId()</p>
\r
643 <p class="whs1">print hypVolume.GetMaxElementVolume()</p>
\r
645 <p class="whs1">smeshgui.SetName(salome.ObjectToID(hypVolume),
\r
646 "MaxElementVolume_500")</p>
\r
648 <p class="whs2"> </p>
\r
650 <p class="whs2"># create algorithms</p>
\r
652 <p class="whs1">print "--------------------------
\r
653 create Algorithms"</p>
\r
655 <p class="whs1">print "--------------------------
\r
656 Regular_1D"</p>
\r
658 <p class="whs1">regular1D = smesh.CreateHypothesis("Regular_1D",
\r
659 "libStdMeshersEngine.so")</p>
\r
661 <p class="whs1">smeshgui.SetName(salome.ObjectToID(regular1D),
\r
662 "Wire Discretisation")</p>
\r
664 <p class="whs1">print "--------------------------
\r
665 MEFISTO_2D"</p>
\r
667 <p class="whs1">mefisto2D = smesh.CreateHypothesis("MEFISTO_2D",
\r
668 "libStdMeshersEngine.so")</p>
\r
670 <p class="whs1">smeshgui.SetName(salome.ObjectToID(mefisto2D),
\r
671 "MEFISTO_2D")</p>
\r
673 <p class="whs2"> </p>
\r
675 <p class="whs2"># initialize a mesh with
\r
678 <p class="whs1">mesh = smesh.CreateMesh(box)</p>
\r
680 <p class="whs1">smeshgui.SetName(salome.ObjectToID(mesh),
\r
681 "MeshBox")</p>
\r
683 <p class="whs1"> </p>
\r
685 <p class="whs2"># add the hypothesis to
\r
688 <p class="whs1">print "--------------------------
\r
689 add hypothesis to the box"</p>
\r
691 <p class="whs1">mesh.AddHypothesis(box,hypNbSeg)</p>
\r
693 <p class="whs1">mesh.AddHypothesis(box,hypArea)</p>
\r
695 <p class="whs1">mesh.AddHypothesis(box,hypVolume)</p>
\r
697 <p class="whs1">mesh.AddHypothesis(box,regular1D)</p>
\r
699 <p class="whs1">mesh.AddHypothesis(box,mefisto2D)</p>
\r
701 <p class="whs2"> </p>
\r
703 <p class="whs2"># compute the mesh</p>
\r
705 <p class="whs1">print "--------------------------
\r
706 compute the mesh of the box"</p>
\r
708 <p class="whs1">ret = smesh.Compute(mesh,box)</p>
\r
710 <p class="whs1">print ret</p>
\r
712 <p class="whs1">if ret == 0:</p>
\r
714 <p class="whs1"> print
\r
715 "probleme when computing the mesh"</p>
\r
717 <p class="whs1">salome.sg.updateObjBrowser(1)</p>
\r
719 <p class="whs1">mesh.ExportMED("/tmp/meshMED.med",0)</p>
\r
721 <p class="whs2"> </p>
\r
723 <p class="whs4"> </p>
\r
725 <script type="text/javascript" language="javascript1.2">
\r
727 if (window.writeIntopicBar)
\r
728 writeIntopicBar(0);
\r