Salome HOME
fc496dcde0f507966b4509ccefe66dd655d9e00d
[modules/smesh.git] / doc / salome / gui / SMESH / input / tui_quality_controls.doc
1 /*!
2
3 \page tui_quality_controls_page Quality Controls
4
5 \section tui_free_borders Free Borders
6
7 \code
8 import salome
9 import geompy
10
11 import smesh
12
13 # create open shell: a box without one plane
14 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
15 FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
16 FaceList.remove(FaceList[5])
17 box = geompy.MakeShell(FaceList)
18 idbox = geompy.addToStudy(box, "box")
19
20 # create a mesh
21 mesh = smesh.Mesh(box, "Mesh_free_borders")
22 algo = mesh.Segment()
23 algo.NumberOfSegments(5)
24 algo = mesh.Triangle()
25 algo.MaxElementArea(20.)
26 mesh.Compute() 
27
28 # criterion : free borders
29 aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_FreeBorders) 
30 anIds = mesh.GetIdsFromFilter(aFilter)
31
32 # print the result
33 print "Criterion: Free borders Nb = ", len(anIds)
34 j = 1
35 for i in range(len(anIds)):
36   if j > 20: j = 1; print ""
37   print anIds[i],
38   j = j + 1
39   pass
40 print ""
41
42 # create a group
43 aGroup = mesh.CreateGroup(SMESH.EDGE, "Free borders")
44 aGroup.Add(anIds)
45
46 salome.sg.updateObjBrowser(1)
47 \endcode
48
49 \section tui_borders_at_multiconnection Borders at Multiconnection
50
51 \code
52 import salome
53 import geompy
54
55 import smesh
56 import SMESH
57
58 # create open shell: a box without one plane
59 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
60 FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
61 FaceList.remove(FaceList[5])
62 box = geompy.MakeShell(FaceList)
63 idbox = geompy.addToStudy(box, "box")
64
65 # create a mesh
66 mesh = smesh.Mesh(box, "Mesh_borders_at_multi-connections")
67 algo = mesh.Segment()
68 algo.NumberOfSegments(5)
69 algo = mesh.Triangle()
70 algo.MaxElementArea(20.)
71 mesh.Compute() 
72
73 # Criterion : Borders at multi-connection
74 nb_conn = 2
75
76 aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_MultiConnection, smesh.FT_EqualTo, nb_conn)
77 anIds = mesh.GetIdsFromFilter(aFilter)
78
79 # print the result
80 print "Criterion: Borders at multi-connections Nb = ", len(anIds)
81 j = 1
82 for i in range(len(anIds)):
83   if j > 20: j = 1; print ""
84   print anIds[i],
85   j = j + 1
86   pass
87 print ""
88
89 # create a group
90 aGroup = mesh.CreateGroup(SMESH.EDGE, "Borders at multi-connections")
91 aGroup.Add(anIds)
92
93 salome.sg.updateObjBrowser(1)
94 \endcode
95
96 \section tui_length_1d Length 1D
97
98 \code
99 import salome
100 import geompy
101
102 import smesh
103
104 # create open shell: a box without one plane
105 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
106 FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
107 FaceList.remove(FaceList[5])
108 box = geompy.MakeShell(FaceList)
109 idbox = geompy.addToStudy(box, "box")
110
111 # create a mesh
112 mesh = smesh.Mesh(box, "Mesh_Length_1D")
113 algo = mesh.Segment()
114 algo.NumberOfSegments(5)
115 algo = mesh.Triangle()
116 algo.MaxElementArea(20.)
117 mesh.Compute() 
118
119 # Criterion : Length > 3.
120 length_margin = 3.
121
122 aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_Length, smesh.FT_MoreThan, length_margin)
123 anIds = mesh.GetIdsFromFilter(aFilter) 
124
125 # print the result
126 print "Criterion: Edges length > ", length_margin, " Nb = ", len(anIds)
127 j = 1
128 for i in range(len(anIds)):
129   if j > 20: j = 1; print ""
130   print anIds[i],
131   j = j + 1
132   pass
133 print ""
134
135 # create a group
136 aGroup = mesh.CreateGroup(SMESH.EDGE, "Edges with length > " + `length_margin`)
137 aGroup.Add(anIds)
138
139 salome.sg.updateObjBrowser(1)
140 \endcode
141
142 \section tui_free_edges Free Edges
143
144 \code
145 import SMESH_mechanic
146
147 smesh  = SMESH_mechanic.smesh
148 mesh   = SMESH_mechanic.mesh
149 salome = SMESH_mechanic.salome
150
151 aFilterMgr = smesh.CreateFilterManager()
152
153 # Remove some elements to obtain free edges
154 # Criterion : AREA > 95.
155 area_margin = 95.
156
157 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, area_margin)
158
159 anIds = mesh.GetIdsFromFilter(aFilter)
160
161 mesh.RemoveElements(anIds)
162
163 # Criterion : Free Edges
164 aBorders = mesh.GetFreeBorders() 
165
166 # create groups
167 aGroupF = mesh.CreateGroup(SMESH.FACE, "Faces with free edges")
168 aGroupN = mesh.CreateGroup(SMESH.NODE, "Nodes on free edges")
169
170 # fill groups with elements, corresponding to the criterion
171 print ""
172 print "Criterion: Free edges Nb = ", len(aBorders)
173 for i in range(len(aBorders)):
174   aBorder = aBorders[i]
175   print "Face # ", aBorder.myElemId, " : Edge between nodes (",
176   print aBorder.myPnt1, ", ", aBorder.myPnt2, ")"
177
178   aGroupF.Add([aBorder.myElemId])
179   aGroupN.Add([aBorder.myPnt1, aBorder.myPnt2])
180
181 salome.sg.updateObjBrowser(1)
182 \endcode
183
184 \section tui_free_nodes Free Nodes
185
186 \code
187 import salome
188 import geompy
189
190 import smesh
191
192 # create box
193 box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
194 idbox = geompy.addToStudy(box, "box")
195
196 # create a mesh
197 mesh = smesh.Mesh(box, "Mesh_free_nodes")
198 algo = mesh.Segment()
199 algo.NumberOfSegments(10)
200 algo = mesh.Triangle(smesh.MEFISTO)
201 algo.MaxElementArea(150.)
202 mesh.Compute() 
203
204 # Remove some elements to obtain free nodes
205 # Criterion : AREA < 80.
206 area_margin = 80.
207
208 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, area_margin)
209
210 anIds = mesh.GetIdsFromFilter(aFilter)
211
212 mesh.RemoveElements(anIds)
213
214 # criterion : free nodes
215 aFilter = smesh.GetFilter(smesh.NODE, smesh.FT_FreeNodes) 
216 anNodeIds = mesh.GetIdsFromFilter(aFilter)
217
218 # create a group
219 aGroup = mesh.CreateEmptyGroup(smesh.NODE, "Free_nodes")
220 aGroup.Add(anNodeIds)
221
222 # print the result
223 print "Criterion: Free nodes Nb = ", len(anNodeIds)
224 j = 1
225 for i in range(len(anNodeIds)):
226   if j > 20: j = 1; print ""
227   print anNodeIds[i],
228   j = j + 1
229   pass
230 print ""
231
232 salome.sg.updateObjBrowser(1)
233 \endcode
234
235 \section tui_free_faces Free Faces
236
237 \code
238 import salome
239 import geompy
240
241 ####### GEOM part ########
242
243 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
244 Box_1_vertex_6 = geompy.GetSubShape(Box_1, [6])
245 Box_1 = geompy.GetMainShape(Box_1_vertex_6)
246 Box_1_vertex_16 = geompy.GetSubShape(Box_1, [16])
247 Box_1 = geompy.GetMainShape(Box_1_vertex_16)
248 Box_1_vertex_11 = geompy.GetSubShape(Box_1, [11])
249 Box_1 = geompy.GetMainShape(Box_1_vertex_11)
250 Plane_1 = geompy.MakePlaneThreePnt(Box_1_vertex_6, Box_1_vertex_16, Box_1_vertex_11, 2000)
251 Partition_1 = geompy.MakePartition([Box_1], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
252
253 Box_1_vertex_19 = geompy.GetSubShape(Box_1, [19])
254 Box_1_vertex_21 = geompy.GetSubShape(Box_1, [21])
255 Plane_2 = geompy.MakePlaneThreePnt(Box_1_vertex_16, Box_1_vertex_19, Box_1_vertex_21, 2000)
256
257 geompy.addToStudy( Box_1, "Box_1" )
258 geompy.addToStudyInFather( Box_1, Box_1_vertex_6, "Box_1:vertex_6" )
259 geompy.addToStudyInFather( Box_1, Box_1_vertex_16, "Box_1:vertex_16" )
260 geompy.addToStudyInFather( Box_1, Box_1_vertex_11, "Box_1:vertex_11" )
261 geompy.addToStudy( Plane_1, "Plane_1" )
262 geompy.addToStudy( Partition_1, "Partition_1" )
263 geompy.addToStudyInFather( Box_1, Box_1_vertex_19, "Box_1:vertex_19" )
264 geompy.addToStudyInFather( Box_1, Box_1_vertex_21, "Box_1:vertex_21" )
265 geompy.addToStudy( Plane_2, "Plane_2" )
266
267 ###### SMESH part ######
268 import smesh
269
270 import StdMeshers
271 import NETGENPlugin
272
273 Mesh_1 = smesh.Mesh(Partition_1)
274 Regular_1D = Mesh_1.Segment()
275 Max_Size_1 = Regular_1D.MaxSize(34.641)
276 MEFISTO_2D = Mesh_1.Triangle()
277 Tetrahedron_Netgen = Mesh_1.Tetrahedron(algo=smesh.NETGEN)
278 isDone = Mesh_1.Compute()
279
280 # create a group of free faces
281 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_FreeFaces )
282 aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
283
284 aGroup = Mesh_1.CreateEmptyGroup(smesh.FACE, "Free_faces")
285 aGroup.Add(aFaceIds)
286
287 # print the result
288 print "Criterion: Free nodes Nb = ", len(anNodeIds)
289 j = 1
290 for i in range(len(aFaceIds)):
291   if j > 20: j = 1; print ""
292   print anNodeIds[i],
293   j = j + 1
294   pass
295 print ""
296
297 #filter faces from plane 2
298 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_BelongToPlane, Plane_2)
299 aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
300 aGroup.Remove(aFaceIds)
301
302 # create a group of shared faces (located on partition boundary inside box)
303 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_BelongToPlane, Plane_1)
304 aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
305
306 aGroup = Mesh_1.CreateEmptyGroup(smesh.FACE, "Shared_faces")
307 aGroup.Add(aFaceIds)
308
309 salome.sg.updateObjBrowser(1)
310 \endcode
311
312 \section tui_length_2d Length 2D
313
314 \code
315 import salome
316 import geompy
317
318 import smesh
319
320 # create open shell: a box without one plane
321 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
322 FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
323 FaceList.remove(FaceList[5])
324 box = geompy.MakeShell(FaceList)
325 idbox = geompy.addToStudy(box, "box")
326
327 # create a mesh
328 mesh = smesh.Mesh(box, "Mesh_Length_2D")
329 algo = mesh.Segment()
330 algo.NumberOfSegments(5)
331 algo = mesh.Triangle()
332 algo.MaxElementArea(20.)
333 mesh.Compute()
334
335 # Criterion : Length 2D > 5.7
336 length_margin = 5.7
337
338 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Length2D, smesh.FT_MoreThan, length_margin)
339
340 anIds = mesh.GetIdsFromFilter(aFilter)
341
342 # print the result
343 print "Criterion: Edges length 2D > ", length_margin, " Nb = ", len(anIds)
344 j = 1
345 for i in range(len(anIds)):
346   if j > 20: j = 1; print ""
347   print anIds[i],
348   j = j + 1
349   pass
350 print ""
351
352 # create a group
353 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Faces with length 2D > " + `length_margin`)
354 aGroup.Add(anIds)
355
356 salome.sg.updateObjBrowser(1)
357 \endcode
358
359 \section tui_borders_at_multiconnection_2d Borders at Multiconnection 2D
360
361 \code
362 import salome
363 import geompy
364
365 import smesh
366
367 # create a compound of two glued boxes
368 box1 = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
369 box2 = geompy.MakeTranslation(box1, 0., 20., 0)
370 comp = geompy.MakeCompound([box1, box2])
371 box = geompy.MakeGlueFaces(comp, 0.000001)
372 idbox = geompy.addToStudy(box, "box")
373
374 # create a mesh
375 mesh = smesh.Mesh(box, "Box compound : 2D triangle mesh")
376 algo = mesh.Segment()
377 algo.NumberOfSegments(5)
378 algo = mesh.Triangle()
379 algo.MaxElementArea(20.)
380 mesh.Compute() 
381
382 # Criterion : MULTI-CONNECTION 2D = 3
383 nb_conn = 3
384
385 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MultiConnection2D, smesh.FT_EqualTo, nb_conn)
386
387 anIds = mesh.GetIdsFromFilter(aFilter) 
388
389 # print the result
390 print "Criterion: Borders at multi-connection 2D = ", nb_conn, " Nb = ", len(anIds)
391 j = 1
392 for i in range(len(anIds)):
393   if j > 20: j = 1; print ""
394   print anIds[i],
395   j = j + 1
396   pass
397 print ""
398
399 # create a group
400 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Borders at multi-connection 2D = " + `nb_conn`)
401 aGroup.Add(anIds)
402
403 salome.sg.updateObjBrowser(1)
404 \endcode
405
406 \section tui_area Area
407
408 \code
409 import SMESH_mechanic
410
411 smesh  = SMESH_mechanic.smesh
412 mesh   = SMESH_mechanic.mesh
413 salome = SMESH_mechanic.salome
414
415 # Criterion : AREA > 100.
416 area_margin = 100.
417
418 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, area_margin)
419
420 anIds = mesh.GetIdsFromFilter(aFilter) 
421
422 # print the result
423 print "Criterion: Area > ", area_margin, " Nb = ", len(anIds)
424 j = 1
425 for i in range(len(anIds)):
426   if j > 20: j = 1; print ""
427   print anIds[i],
428   j = j + 1
429   pass
430 print ""
431
432 # create a group
433 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Area > " + `area_margin`)
434 aGroup.Add(anIds)
435
436 salome.sg.updateObjBrowser(1)  
437 \endcode
438
439 \section tui_taper Taper
440
441 \code
442 import SMESH_mechanic
443
444 smesh  = SMESH_mechanic.smesh
445 mesh   = SMESH_mechanic.mesh
446 salome = SMESH_mechanic.salome
447
448 # Criterion : Taper > 3e-20
449 taper_margin = 3e-20
450
451 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Taper, smesh.FT_MoreThan, taper_margin)
452
453 anIds = mesh.GetIdsFromFilter(aFilter) 
454
455 # print the result
456 print "Criterion: Taper > ", taper_margin, " Nb = ", len(anIds)
457 j = 1
458 for i in range(len(anIds)):
459   if j > 20: j = 1; print ""
460   print anIds[i],
461   j = j + 1
462   pass
463 print ""
464
465 # create a group
466 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Taper > " + `taper_margin`)
467 aGroup.Add(anIds)
468
469 salome.sg.updateObjBrowser(1)
470 \endcode
471
472 \section tui_aspect_ratio Aspect Ratio
473
474 \code
475 import SMESH_mechanic
476
477 smesh  = SMESH_mechanic.smesh
478 mesh   = SMESH_mechanic.mesh
479 salome = SMESH_mechanic.salome
480
481 # Criterion : ASPECT RATIO > 1.8
482 ar_margin = 1.8
483
484 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, ar_margin)
485
486 anIds = mesh.GetIdsFromFilter(aFilter) 
487
488 # print the result
489 print "Criterion: Aspect Ratio > ", ar_margin, " Nb = ", len(anIds)
490 j = 1
491 for i in range(len(anIds)):
492   if j > 20: j = 1; print ""
493   print anIds[i],
494   j = j + 1
495   pass
496 print ""
497
498 # create a group
499 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Aspect Ratio > " + `ar_margin`)
500 aGroup.Add(anIds)
501
502 salome.sg.updateObjBrowser(1)
503 \endcode
504
505 \section tui_minimum_angle Minimum Angle
506
507 \code
508 import SMESH_mechanic
509
510 smesh  = SMESH_mechanic.smesh
511 mesh   = SMESH_mechanic.mesh
512 salome = SMESH_mechanic.salome
513
514 # Criterion : MINIMUM ANGLE < 35.
515 min_angle = 35.
516
517 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MinimumAngle, smesh.FT_LessThan, min_angle)
518
519 anIds = mesh.GetIdsFromFilter(aFilter) 
520
521 # print the result
522 print "Criterion: Minimum Angle < ", min_angle, " Nb = ", len(anIds)
523 j = 1
524 for i in range(len(anIds)):
525   if j > 20: j = 1; print ""
526   print anIds[i],
527   j = j + 1
528   pass
529 print ""
530
531 # create a group
532 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Minimum Angle < " + `min_angle`)
533
534 aGroup.Add(anIds)
535
536 salome.sg.updateObjBrowser(1)
537 \endcode
538
539 \section tui_warping Warping
540
541 \code
542 import SMESH_mechanic
543
544 smesh  = SMESH_mechanic.smesh
545 mesh   = SMESH_mechanic.mesh
546 salome = SMESH_mechanic.salome
547
548 # Criterion : WARP ANGLE > 1e-15
549 wa_margin = 1e-15
550
551 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Warping, smesh.FT_MoreThan, wa_margin)
552
553 anIds = mesh.GetIdsFromFilter(aFilter) 
554
555 # print the result
556 print "Criterion: Warp > ", wa_margin, " Nb = ", len(anIds)
557 j = 1
558 for i in range(len(anIds)):
559   if j > 20: j = 1; print ""
560   print anIds[i],
561   j = j + 1
562   pass
563 print ""
564
565 # create a group
566 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Warp > " + `wa_margin`)
567
568 aGroup.Add(anIds)
569
570 salome.sg.updateObjBrowser(1) 
571 \endcode
572
573 \section tui_skew Skew
574
575 \code
576 import SMESH_mechanic
577
578 smesh  = SMESH_mechanic.smesh
579 mesh   = SMESH_mechanic.mesh
580 salome = SMESH_mechanic.salome
581
582 # Criterion : Skew > 38.
583 skew_margin = 38.
584
585 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Skew, smesh.FT_MoreThan, skew_margin)
586
587 anIds = mesh.GetIdsFromFilter(aFilter)
588
589 # print the result
590 print "Criterion: Skew > ", skew_margin, " Nb = ", len(anIds)
591 j = 1
592 for i in range(len(anIds)):
593   if j > 20: j = 1; print ""
594   print anIds[i],
595   j = j + 1
596   pass
597 print ""
598
599 # create a group
600 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Skew > " + `skew_margin`)
601 aGroup.Add(anIds)
602
603 salome.sg.updateObjBrowser(1)
604 \endcode
605
606 \section tui_max_element_length_2d Element Diameter 2D
607
608 \code
609 import SMESH_mechanic
610
611 smesh  = SMESH_mechanic.smesh
612 mesh   = SMESH_mechanic.mesh
613 salome = SMESH_mechanic.salome
614
615 # Criterion : ELEMENT DIAMETER 2D > 10
616 mel_2d_margin = 10
617
618 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MaxElementLength2D, smesh.FT_MoreThan, mel_2d_margin)
619
620 anIds = mesh.GetIdsFromFilter(aFilter) 
621
622 # print the result
623 print "Criterion: Element Diameter 2D Ratio > ", mel_2d_margin, " Nb = ", len(anIds)
624 j = 1
625 for i in range(len(anIds)):
626   if j > 20: j = 1; print ""
627   print anIds[i],
628   j = j + 1
629   pass
630 print ""
631
632 # create a group
633 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Element Diameter 2D > " + `mel_2d_margin`)
634 aGroup.Add(anIds)
635
636 salome.sg.updateObjBrowser(1)
637 \endcode
638
639 \section tui_aspect_ratio_3d Aspect Ratio 3D
640
641 \code
642 import SMESH_mechanic_tetra 
643
644 smesh  = SMESH_mechanic_tetra.smesh
645 mesh   = SMESH_mechanic_tetra.mesh
646 salome = SMESH_mechanic_tetra.salome
647
648 # Criterion : ASPECT RATIO 3D > 4.5
649 ar_margin = 4.5
650
651 aFilter = smesh.GetFilter(smesh.VOLUME, smesh.FT_AspectRatio3D, smesh.FT_MoreThan, ar_margin)
652
653 anIds = mesh.GetIdsFromFilter(aFilter) 
654
655 # print the result
656 print "Criterion: Aspect Ratio 3D > ", ar_margin, " Nb = ", len(anIds)
657 j = 1
658 for i in range(len(anIds)):
659   if j > 20: j = 1; print ""
660   print anIds[i],
661   j = j + 1
662   pass
663 print ""
664
665 # create a group
666 aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, "Aspect Ratio 3D > " + `ar_margin`)
667
668 aGroup.Add(anIds)
669
670 salome.sg.updateObjBrowser(1)
671 \endcode
672
673 \section tui_volume Volume
674
675 \code
676 import SMESH_mechanic_tetra
677
678 smesh  = SMESH_mechanic_tetra.smesh
679 mesh   = SMESH_mechanic_tetra.mesh
680 salome = SMESH_mechanic_tetra.salome
681
682 # Criterion : VOLUME < 7.
683 volume_margin = 7.
684
685 aFilter = smesh.GetFilter(smesh.VOLUME, smesh.FT_Volume3D, smesh.FT_LessThan, volume_margin)
686
687 anIds = mesh.GetIdsFromFilter(aFilter) 
688
689 # print the result
690 print ""
691 print "Criterion: Volume < ", volume_margin, " Nb = ", len(anIds)
692 j = 1
693 for i in range(len(anIds)):
694   if j > 20: j = 1; print ""
695   print anIds[i],
696   j = j + 1
697   pass
698 print ""
699
700 # create a group
701 aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, "Volume < " + `volume_margin`)
702
703 aGroup.Add(anIds)
704
705 salome.sg.updateObjBrowser(1) 
706 \endcode
707
708 \section tui_max_element_length_3d Element Diameter 3D
709
710 \code
711 import SMESH_mechanic_tetra
712
713 smesh  = SMESH_mechanic_tetra.smesh
714 mesh   = SMESH_mechanic_tetra.mesh
715 salome = SMESH_mechanic_tetra.salome
716
717 # Criterion : ELEMENT DIAMETER 3D > 10
718 mel_3d_margin = 10
719
720 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MaxElementLength3D, smesh.FT_MoreThan, mel_3d_margin)
721
722 anIds = mesh.GetIdsFromFilter(aFilter) 
723
724 # print the result
725 print "Criterion: Element Diameter 3D Ratio > ", mel_3d_margin, " Nb = ", len(anIds)
726 j = 1
727 for i in range(len(anIds)):
728   if j > 20: j = 1; print ""
729   print anIds[i],
730   j = j + 1
731   pass
732 print ""
733
734 # create a group
735 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Element Diameter 3D > " + `mel_3d_margin`)
736 aGroup.Add(anIds)
737
738 salome.sg.updateObjBrowser(1)
739 \endcode
740
741 */