3 \page tui_quality_controls_page Quality Controls
6 \anchor tui_free_borders
15 # create open shell: a box without one plane
16 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
17 FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
18 FaceList.remove(FaceList[5])
19 box = geompy.MakeShell(FaceList)
20 idbox = geompy.addToStudy(box, "box")
23 mesh = smesh.Mesh(box, "Mesh_free_borders")
25 algo.NumberOfSegments(5)
26 algo = mesh.Triangle()
27 algo.MaxElementArea(20.)
30 # criterion : free borders
31 aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_FreeBorders)
32 anIds = mesh.GetIdsFromFilter(aFilter)
35 print "Criterion: Free borders Nb = ", len(anIds)
37 for i in range(len(anIds)):
38 if j > 20: j = 1; print ""
45 aGroup = mesh.CreateGroup(SMESH.EDGE, "Free borders")
48 salome.sg.updateObjBrowser(1)
52 \anchor tui_borders_at_multiconnection
53 <h2>Borders at Multiconnection</h2>
62 # create open shell: a box without one plane
63 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
64 FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
65 FaceList.remove(FaceList[5])
66 box = geompy.MakeShell(FaceList)
67 idbox = geompy.addToStudy(box, "box")
70 mesh = smesh.Mesh(box, "Mesh_borders_at_multi-connections")
72 algo.NumberOfSegments(5)
73 algo = mesh.Triangle()
74 algo.MaxElementArea(20.)
77 # Criterion : Borders at multi-connection
80 aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_MultiConnection, smesh.FT_EqualTo, nb_conn)
81 anIds = mesh.GetIdsFromFilter(aFilter)
84 print "Criterion: Borders at multi-connections Nb = ", len(anIds)
86 for i in range(len(anIds)):
87 if j > 20: j = 1; print ""
94 aGroup = mesh.CreateGroup(SMESH.EDGE, "Borders at multi-connections")
97 salome.sg.updateObjBrowser(1)
101 \anchor tui_length_1d
110 # create open shell: a box without one plane
111 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
112 FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
113 FaceList.remove(FaceList[5])
114 box = geompy.MakeShell(FaceList)
115 idbox = geompy.addToStudy(box, "box")
118 mesh = smesh.Mesh(box, "Mesh_Length_1D")
119 algo = mesh.Segment()
120 algo.NumberOfSegments(5)
121 algo = mesh.Triangle()
122 algo.MaxElementArea(20.)
125 # Criterion : Length > 3.
128 aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_Length, smesh.FT_MoreThan, length_margin)
129 anIds = mesh.GetIdsFromFilter(aFilter)
132 print "Criterion: Edges length > ", length_margin, " Nb = ", len(anIds)
134 for i in range(len(anIds)):
135 if j > 20: j = 1; print ""
142 aGroup = mesh.CreateGroup(SMESH.EDGE, "Edges with length > " + `length_margin`)
145 salome.sg.updateObjBrowser(1)
149 \anchor tui_free_edges
153 import SMESH_mechanic
155 smesh = SMESH_mechanic.smesh
156 mesh = SMESH_mechanic.mesh
157 salome = SMESH_mechanic.salome
159 aFilterMgr = smesh.CreateFilterManager()
161 # Remove some elements to obtain free edges
162 # Criterion : AREA > 95.
165 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, area_margin)
167 anIds = mesh.GetIdsFromFilter(aFilter)
169 mesh.RemoveElements(anIds)
171 # Criterion : Free Edges
172 aBorders = mesh.GetFreeBorders()
175 aGroupF = mesh.CreateGroup(SMESH.FACE, "Faces with free edges")
176 aGroupN = mesh.CreateGroup(SMESH.NODE, "Nodes on free edges")
178 # fill groups with elements, corresponding to the criterion
180 print "Criterion: Free edges Nb = ", len(aBorders)
181 for i in range(len(aBorders)):
182 aBorder = aBorders[i]
183 print "Face # ", aBorder.myElemId, " : Edge between nodes (",
184 print aBorder.myPnt1, ", ", aBorder.myPnt2, ")"
186 aGroupF.Add([aBorder.myElemId])
187 aGroupN.Add([aBorder.myPnt1, aBorder.myPnt2])
189 salome.sg.updateObjBrowser(1)
193 \anchor tui_free_nodes
203 box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
204 idbox = geompy.addToStudy(box, "box")
207 mesh = smesh.Mesh(box, "Mesh_free_nodes")
208 algo = mesh.Segment()
209 algo.NumberOfSegments(10)
210 algo = mesh.Triangle(smesh.MEFISTO)
211 algo.MaxElementArea(150.)
214 # Remove some elements to obtain free nodes
215 # Criterion : AREA < 80.
218 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, area_margin)
220 anIds = mesh.GetIdsFromFilter(aFilter)
222 mesh.RemoveElements(anIds)
224 # criterion : free nodes
225 aFilter = smesh.GetFilter(smesh.NODE, smesh.FT_FreeNodes)
226 anNodeIds = mesh.GetIdsFromFilter(aFilter)
229 aGroup = mesh.CreateEmptyGroup(smesh.NODE, "Free_nodes")
230 aGroup.Add(anNodeIds)
233 print "Criterion: Free nodes Nb = ", len(anNodeIds)
235 for i in range(len(anNodeIds)):
236 if j > 20: j = 1; print ""
242 salome.sg.updateObjBrowser(1)
247 \anchor tui_free_faces
254 ####### GEOM part ########
256 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
257 Box_1_vertex_6 = geompy.GetSubShape(Box_1, [6])
258 Box_1 = geompy.GetMainShape(Box_1_vertex_6)
259 Box_1_vertex_16 = geompy.GetSubShape(Box_1, [16])
260 Box_1 = geompy.GetMainShape(Box_1_vertex_16)
261 Box_1_vertex_11 = geompy.GetSubShape(Box_1, [11])
262 Box_1 = geompy.GetMainShape(Box_1_vertex_11)
263 Plane_1 = geompy.MakePlaneThreePnt(Box_1_vertex_6, Box_1_vertex_16, Box_1_vertex_11, 2000)
264 Partition_1 = geompy.MakePartition([Box_1], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
266 Box_1_vertex_19 = geompy.GetSubShape(Box_1, [19])
267 Box_1_vertex_21 = geompy.GetSubShape(Box_1, [21])
268 Plane_2 = geompy.MakePlaneThreePnt(Box_1_vertex_16, Box_1_vertex_19, Box_1_vertex_21, 2000)
270 geompy.addToStudy( Box_1, "Box_1" )
271 geompy.addToStudyInFather( Box_1, Box_1_vertex_6, "Box_1:vertex_6" )
272 geompy.addToStudyInFather( Box_1, Box_1_vertex_16, "Box_1:vertex_16" )
273 geompy.addToStudyInFather( Box_1, Box_1_vertex_11, "Box_1:vertex_11" )
274 geompy.addToStudy( Plane_1, "Plane_1" )
275 geompy.addToStudy( Partition_1, "Partition_1" )
276 geompy.addToStudyInFather( Box_1, Box_1_vertex_19, "Box_1:vertex_19" )
277 geompy.addToStudyInFather( Box_1, Box_1_vertex_21, "Box_1:vertex_21" )
278 geompy.addToStudy( Plane_2, "Plane_2" )
280 ###### SMESH part ######
286 Mesh_1 = smesh.Mesh(Partition_1)
287 Regular_1D = Mesh_1.Segment()
288 Max_Size_1 = Regular_1D.MaxSize(34.641)
289 MEFISTO_2D = Mesh_1.Triangle()
290 Tetrahedron_Netgen = Mesh_1.Tetrahedron(algo=smesh.NETGEN)
291 isDone = Mesh_1.Compute()
293 # create a group of free faces
294 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_FreeFaces )
295 aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
297 aGroup = Mesh_1.CreateEmptyGroup(smesh.FACE, "Free_faces")
301 print "Criterion: Free nodes Nb = ", len(anNodeIds)
303 for i in range(len(aFaceIds)):
304 if j > 20: j = 1; print ""
310 #filter faces from plane 2
311 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_BelongToPlane, Plane_2)
312 aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
313 aGroup.Remove(aFaceIds)
315 # create a group of shared faces (located on partition boundary inside box)
316 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_BelongToPlane, Plane_1)
317 aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
319 aGroup = Mesh_1.CreateEmptyGroup(smesh.FACE, "Shared_faces")
322 salome.sg.updateObjBrowser(1)
327 \anchor tui_length_2d
336 # create open shell: a box without one plane
337 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
338 FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
339 FaceList.remove(FaceList[5])
340 box = geompy.MakeShell(FaceList)
341 idbox = geompy.addToStudy(box, "box")
344 mesh = smesh.Mesh(box, "Mesh_Length_2D")
345 algo = mesh.Segment()
346 algo.NumberOfSegments(5)
347 algo = mesh.Triangle()
348 algo.MaxElementArea(20.)
351 # Criterion : Length 2D > 5.7
354 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Length2D, smesh.FT_MoreThan, length_margin)
356 anIds = mesh.GetIdsFromFilter(aFilter)
359 print "Criterion: Edges length 2D > ", length_margin, " Nb = ", len(anIds)
361 for i in range(len(anIds)):
362 if j > 20: j = 1; print ""
369 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Faces with length 2D > " + `length_margin`)
372 salome.sg.updateObjBrowser(1)
376 \anchor tui_borders_at_multiconnection_2d
377 <h2>Borders at Multiconnection 2D</h2>
385 # create a compound of two glued boxes
386 box1 = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
387 box2 = geompy.MakeTranslation(box1, 0., 20., 0)
388 comp = geompy.MakeCompound([box1, box2])
389 box = geompy.MakeGlueFaces(comp, 0.000001)
390 idbox = geompy.addToStudy(box, "box")
393 mesh = smesh.Mesh(box, "Box compound : 2D triangle mesh")
394 algo = mesh.Segment()
395 algo.NumberOfSegments(5)
396 algo = mesh.Triangle()
397 algo.MaxElementArea(20.)
400 # Criterion : MULTI-CONNECTION 2D = 3
403 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MultiConnection2D, smesh.FT_EqualTo, nb_conn)
405 anIds = mesh.GetIdsFromFilter(aFilter)
408 print "Criterion: Borders at multi-connection 2D = ", nb_conn, " Nb = ", len(anIds)
410 for i in range(len(anIds)):
411 if j > 20: j = 1; print ""
418 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Borders at multi-connection 2D = " + `nb_conn`)
421 salome.sg.updateObjBrowser(1)
429 import SMESH_mechanic
431 smesh = SMESH_mechanic.smesh
432 mesh = SMESH_mechanic.mesh
433 salome = SMESH_mechanic.salome
435 # Criterion : AREA > 100.
438 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, area_margin)
440 anIds = mesh.GetIdsFromFilter(aFilter)
443 print "Criterion: Area > ", area_margin, " Nb = ", len(anIds)
445 for i in range(len(anIds)):
446 if j > 20: j = 1; print ""
453 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Area > " + `area_margin`)
456 salome.sg.updateObjBrowser(1)
464 import SMESH_mechanic
466 smesh = SMESH_mechanic.smesh
467 mesh = SMESH_mechanic.mesh
468 salome = SMESH_mechanic.salome
470 # Criterion : Taper > 3e-20
473 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Taper, smesh.FT_MoreThan, taper_margin)
475 anIds = mesh.GetIdsFromFilter(aFilter)
478 print "Criterion: Taper > ", taper_margin, " Nb = ", len(anIds)
480 for i in range(len(anIds)):
481 if j > 20: j = 1; print ""
488 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Taper > " + `taper_margin`)
491 salome.sg.updateObjBrowser(1)
495 \anchor tui_aspect_ratio
496 <h2>Aspect Ratio</h2>
499 import SMESH_mechanic
501 smesh = SMESH_mechanic.smesh
502 mesh = SMESH_mechanic.mesh
503 salome = SMESH_mechanic.salome
505 # Criterion : ASPECT RATIO > 1.8
508 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, ar_margin)
510 anIds = mesh.GetIdsFromFilter(aFilter)
513 print "Criterion: Aspect Ratio > ", ar_margin, " Nb = ", len(anIds)
515 for i in range(len(anIds)):
516 if j > 20: j = 1; print ""
523 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Aspect Ratio > " + `ar_margin`)
526 salome.sg.updateObjBrowser(1)
530 \anchor tui_minimum_angle
531 <h2>Minimum Angle</h2>
534 import SMESH_mechanic
536 smesh = SMESH_mechanic.smesh
537 mesh = SMESH_mechanic.mesh
538 salome = SMESH_mechanic.salome
540 # Criterion : MINIMUM ANGLE < 35.
543 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MinimumAngle, smesh.FT_LessThan, min_angle)
545 anIds = mesh.GetIdsFromFilter(aFilter)
548 print "Criterion: Minimum Angle < ", min_angle, " Nb = ", len(anIds)
550 for i in range(len(anIds)):
551 if j > 20: j = 1; print ""
558 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Minimum Angle < " + `min_angle`)
562 salome.sg.updateObjBrowser(1)
570 import SMESH_mechanic
572 smesh = SMESH_mechanic.smesh
573 mesh = SMESH_mechanic.mesh
574 salome = SMESH_mechanic.salome
576 # Criterion : WARP ANGLE > 1e-15
579 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Warping, smesh.FT_MoreThan, wa_margin)
581 anIds = mesh.GetIdsFromFilter(aFilter)
584 print "Criterion: Warp > ", wa_margin, " Nb = ", len(anIds)
586 for i in range(len(anIds)):
587 if j > 20: j = 1; print ""
594 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Warp > " + `wa_margin`)
598 salome.sg.updateObjBrowser(1)
606 import SMESH_mechanic
608 smesh = SMESH_mechanic.smesh
609 mesh = SMESH_mechanic.mesh
610 salome = SMESH_mechanic.salome
612 # Criterion : Skew > 38.
615 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Skew, smesh.FT_MoreThan, skew_margin)
617 anIds = mesh.GetIdsFromFilter(aFilter)
620 print "Criterion: Skew > ", skew_margin, " Nb = ", len(anIds)
622 for i in range(len(anIds)):
623 if j > 20: j = 1; print ""
630 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Skew > " + `skew_margin`)
633 salome.sg.updateObjBrowser(1)
637 \anchor tui_aspect_ratio_3d
638 <h2>Aspect Ratio 3D</h2>
641 import SMESH_mechanic_tetra
643 smesh = SMESH_mechanic_tetra.smesh
644 mesh = SMESH_mechanic_tetra.mesh
645 salome = SMESH_mechanic_tetra.salome
647 # Criterion : ASPECT RATIO 3D > 4.5
650 aFilter = smesh.GetFilter(smesh.VOLUME, smesh.FT_AspectRatio3D, smesh.FT_MoreThan, ar_margin)
652 anIds = mesh.GetIdsFromFilter(aFilter)
655 print "Criterion: Aspect Ratio 3D > ", ar_margin, " Nb = ", len(anIds)
657 for i in range(len(anIds)):
658 if j > 20: j = 1; print ""
665 aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, "Aspect Ratio 3D > " + `ar_margin`)
669 salome.sg.updateObjBrowser(1)
677 import SMESH_mechanic_tetra
679 smesh = SMESH_mechanic_tetra.smesh
680 mesh = SMESH_mechanic_tetra.mesh
681 salome = SMESH_mechanic_tetra.salome
683 # Criterion : VOLUME < 7.
686 aFilter = smesh.GetFilter(smesh.VOLUME, smesh.FT_Volume3D, smesh.FT_LessThan, volume_margin)
688 anIds = mesh.GetIdsFromFilter(aFilter)
692 print "Criterion: Volume < ", volume_margin, " Nb = ", len(anIds)
694 for i in range(len(anIds)):
695 if j > 20: j = 1; print ""
702 aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, "Volume < " + `volume_margin`)
706 salome.sg.updateObjBrowser(1)