X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=doc%2Fsalome%2Fgui%2FSMESH%2Finput%2Ftui_quality_controls.doc;h=1434c9b07230ba47bfc3d6ffb5905b8cdb1543cc;hp=e1b8b700e662893abfbcfbe16e7d1e3ce1127273;hb=287b2ac10eee586fb10a950958023b05aa008407;hpb=79b1ac2b6df9117f16f11d444b1f165d477a1813 diff --git a/doc/salome/gui/SMESH/input/tui_quality_controls.doc b/doc/salome/gui/SMESH/input/tui_quality_controls.doc index e1b8b700e..1434c9b07 100644 --- a/doc/salome/gui/SMESH/input/tui_quality_controls.doc +++ b/doc/salome/gui/SMESH/input/tui_quality_controls.doc @@ -2,574 +2,72 @@ \page tui_quality_controls_page Quality Controls -
-\anchor tui_free_borders -

Free Borders

+\tableofcontents -\code -import salome -import geompy +\section tui_free_borders Free Borders +\tui_script{quality_controls_ex01.py} -import smesh +\section tui_borders_at_multiconnection Borders at Multiconnection +\tui_script{quality_controls_ex02.py} -# create open shell: a box without one plane -box = geompy.MakeBox(0., 0., 0., 20., 20., 15.) -FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"]) -FaceList.remove(FaceList[5]) -box = geompy.MakeShell(FaceList) -idbox = geompy.addToStudy(box, "box") +\section tui_length_1d Length 1D +\tui_script{quality_controls_ex03.py} -# create a mesh -mesh = smesh.Mesh(box, "Mesh_free_borders") -algo = mesh.Segment() -algo.NumberOfSegments(5) -algo = mesh.Triangle() -algo.MaxElementArea(20.) -mesh.Compute() +\section tui_free_edges Free Edges +\tui_script{quality_controls_ex04.py} -# criterion : free borders -aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_FreeBorders) -anIds = mesh.GetIdsFromFilter(aFilter) +\section tui_free_nodes Free Nodes +\tui_script{quality_controls_ex05.py} -# print the result -print "Criterion: Free borders Nb = ", len(anIds) -j = 1 -for i in range(len(anIds)): - if j > 20: j = 1; print "" - print anIds[i], - j = j + 1 - pass -print "" +\section tui_free_faces Free Faces +\tui_script{quality_controls_ex06.py} -# create a group -aGroup = mesh.CreateGroup(SMESH.EDGE, "Free borders") -aGroup.Add(anIds) +\section tui_bare_border_faces Bare border faces +\tui_script{quality_controls_ex07.py} -salome.sg.updateObjBrowser(1) -\endcode +\section tui_bare_border_volumes Bare border volumes +\tui_script{quality_controls_ex08.py} -
-\anchor tui_borders_at_multiconnection -

Borders at Multiconnection

+\section tui_over_constrained_faces Over-constrained faces +\tui_script{quality_controls_ex09.py} -\code -import salome -import geompy +\section tui_over_constrained_volumes Over-constrained volumes +\tui_script{quality_controls_ex10.py} -import smesh -import SMESH +\section tui_length_2d Length 2D +\tui_script{quality_controls_ex11.py} -# create open shell: a box without one plane -box = geompy.MakeBox(0., 0., 0., 20., 20., 15.) -FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"]) -FaceList.remove(FaceList[5]) -box = geompy.MakeShell(FaceList) -idbox = geompy.addToStudy(box, "box") +\section tui_borders_at_multiconnection_2d Borders at Multiconnection 2D +\tui_script{quality_controls_ex12.py} -# create a mesh -mesh = smesh.Mesh(box, "Mesh_borders_at_multi-connections") -algo = mesh.Segment() -algo.NumberOfSegments(5) -algo = mesh.Triangle() -algo.MaxElementArea(20.) -mesh.Compute() +\section tui_area Area +\tui_script{quality_controls_ex13.py} -# Criterion : Borders at multi-connection -nb_conn = 2 +\section tui_taper Taper +\tui_script{quality_controls_ex14.py} -aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_MultiConnection, smesh.FT_EqualTo, nb_conn) -anIds = mesh.GetIdsFromFilter(aFilter) +\section tui_aspect_ratio Aspect Ratio +\tui_script{quality_controls_ex15.py} -# print the result -print "Criterion: Borders at multi-connections Nb = ", len(anIds) -j = 1 -for i in range(len(anIds)): - if j > 20: j = 1; print "" - print anIds[i], - j = j + 1 - pass -print "" +\section tui_minimum_angle Minimum Angle +\tui_script{quality_controls_ex16.py} -# create a group -aGroup = mesh.CreateGroup(SMESH.EDGE, "Borders at multi-connections") -aGroup.Add(anIds) +\section tui_warping Warping +\tui_script{quality_controls_ex17.py} -salome.sg.updateObjBrowser(1) -\endcode +\section tui_skew Skew +\tui_script{quality_controls_ex18.py} -
-\anchor tui_length_1d -

Length 1D

+\section tui_max_element_length_2d Element Diameter 2D +\tui_script{quality_controls_ex19.py} -\code -import salome -import geompy +\section tui_aspect_ratio_3d Aspect Ratio 3D +\tui_script{quality_controls_ex20.py} -import smesh +\section tui_volume Volume +\tui_script{quality_controls_ex21.py} -# create open shell: a box without one plane -box = geompy.MakeBox(0., 0., 0., 20., 20., 15.) -FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"]) -FaceList.remove(FaceList[5]) -box = geompy.MakeShell(FaceList) -idbox = geompy.addToStudy(box, "box") +\section tui_max_element_length_3d Element Diameter 3D +\tui_script{quality_controls_ex22.py} -# create a mesh -mesh = smesh.Mesh(box, "Mesh_Length_1D") -algo = mesh.Segment() -algo.NumberOfSegments(5) -algo = mesh.Triangle() -algo.MaxElementArea(20.) -mesh.Compute() - -# Criterion : Length > 3. -length_margin = 3. - -aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_Length, smesh.FT_MoreThan, length_margin) -anIds = mesh.GetIdsFromFilter(aFilter) - -# print the result -print "Criterion: Edges length > ", length_margin, " Nb = ", len(anIds) -j = 1 -for i in range(len(anIds)): - if j > 20: j = 1; print "" - print anIds[i], - j = j + 1 - pass -print "" - -# create a group -aGroup = mesh.CreateGroup(SMESH.EDGE, "Edges with length > " + `length_margin`) -aGroup.Add(anIds) - -salome.sg.updateObjBrowser(1) -\endcode - -
-\anchor tui_free_edges -

Free Edges

- -\code -import SMESH_mechanic - -smesh = SMESH_mechanic.smesh -mesh = SMESH_mechanic.mesh -salome = SMESH_mechanic.salome - -aFilterMgr = smesh.CreateFilterManager() - -# Remove some elements to obtain free edges -# Criterion : AREA > 95. -area_margin = 95. - -aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, area_margin) - -anIds = mesh.GetIdsFromFilter(aFilter) - -mesh.RemoveElements(anIds) - -# Criterion : Free Edges -aBorders = mesh.GetFreeBorders() - -# create groups -aGroupF = mesh.CreateGroup(SMESH.FACE, "Faces with free edges") -aGroupN = mesh.CreateGroup(SMESH.NODE, "Nodes on free edges") - -# fill groups with elements, corresponding to the criterion -print "" -print "Criterion: Free edges Nb = ", len(aBorders) -for i in range(len(aBorders)): - aBorder = aBorders[i] - print "Face # ", aBorder.myElemId, " : Edge between nodes (", - print aBorder.myPnt1, ", ", aBorder.myPnt2, ")" - - aGroupF.Add([aBorder.myElemId]) - aGroupN.Add([aBorder.myPnt1, aBorder.myPnt2]) - -salome.sg.updateObjBrowser(1) -\endcode - -
-\anchor tui_length_2d -

Length 2D

- -\code -import salome -import geompy - -import smesh - -# create open shell: a box without one plane -box = geompy.MakeBox(0., 0., 0., 20., 20., 15.) -FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"]) -FaceList.remove(FaceList[5]) -box = geompy.MakeShell(FaceList) -idbox = geompy.addToStudy(box, "box") - -# create a mesh -mesh = smesh.Mesh(box, "Mesh_Length_2D") -algo = mesh.Segment() -algo.NumberOfSegments(5) -algo = mesh.Triangle() -algo.MaxElementArea(20.) -mesh.Compute() - -# Criterion : Length 2D > 5.7 -length_margin = 5.7 - -aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Length2D, smesh.FT_MoreThan, length_margin) - -anIds = mesh.GetIdsFromFilter(aFilter) - -# print the result -print "Criterion: Edges length 2D > ", length_margin, " Nb = ", len(anIds) -j = 1 -for i in range(len(anIds)): - if j > 20: j = 1; print "" - print anIds[i], - j = j + 1 - pass -print "" - -# create a group -aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Faces with length 2D > " + `length_margin`) -aGroup.Add(anIds) - -salome.sg.updateObjBrowser(1) -\endcode - -
-\anchor tui_borders_at_multiconnection_2d -

Borders at Multiconnection 2D

- -\code -import salome -import geompy - -import smesh - -# create a compound of two glued boxes -box1 = geompy.MakeBox(0., 0., 0., 20., 20., 15.) -box2 = geompy.MakeTranslation(box1, 0., 20., 0) -comp = geompy.MakeCompound([box1, box2]) -box = geompy.MakeGlueFaces(comp, 0.000001) -idbox = geompy.addToStudy(box, "box") - -# create a mesh -mesh = smesh.Mesh(box, "Box compound : 2D triangle mesh") -algo = mesh.Segment() -algo.NumberOfSegments(5) -algo = mesh.Triangle() -algo.MaxElementArea(20.) -mesh.Compute() - -# Criterion : MULTI-CONNECTION 2D = 3 -nb_conn = 3 - -aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MultiConnection2D, smesh.FT_EqualTo, nb_conn) - -anIds = mesh.GetIdsFromFilter(aFilter) - -# print the result -print "Criterion: Borders at multi-connection 2D = ", nb_conn, " Nb = ", len(anIds) -j = 1 -for i in range(len(anIds)): - if j > 20: j = 1; print "" - print anIds[i], - j = j + 1 - pass -print "" - -# create a group -aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Borders at multi-connection 2D = " + `nb_conn`) -aGroup.Add(anIds) - -salome.sg.updateObjBrowser(1) -\endcode - -
-\anchor tui_area -

Area

- -\code -import SMESH_mechanic - -smesh = SMESH_mechanic.smesh -mesh = SMESH_mechanic.mesh -salome = SMESH_mechanic.salome - -# Criterion : AREA > 100. -area_margin = 100. - -aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, area_margin) - -anIds = mesh.GetIdsFromFilter(aFilter) - -# print the result -print "Criterion: Area > ", area_margin, " Nb = ", len(anIds) -j = 1 -for i in range(len(anIds)): - if j > 20: j = 1; print "" - print anIds[i], - j = j + 1 - pass -print "" - -# create a group -aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Area > " + `area_margin`) -aGroup.Add(anIds) - -salome.sg.updateObjBrowser(1) -\endcode - -
-\anchor tui_taper -

Taper

- -\code -import SMESH_mechanic - -smesh = SMESH_mechanic.smesh -mesh = SMESH_mechanic.mesh -salome = SMESH_mechanic.salome - -# Criterion : Taper > 3e-20 -taper_margin = 3e-20 - -aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Taper, smesh.FT_MoreThan, taper_margin) - -anIds = mesh.GetIdsFromFilter(aFilter) - -# print the result -print "Criterion: Taper > ", taper_margin, " Nb = ", len(anIds) -j = 1 -for i in range(len(anIds)): - if j > 20: j = 1; print "" - print anIds[i], - j = j + 1 - pass -print "" - -# create a group -aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Taper > " + `taper_margin`) -aGroup.Add(anIds) - -salome.sg.updateObjBrowser(1) -\endcode - -
-\anchor tui_aspect_ratio -

Aspect Ratio

- -\code -import SMESH_mechanic - -smesh = SMESH_mechanic.smesh -mesh = SMESH_mechanic.mesh -salome = SMESH_mechanic.salome - -# Criterion : ASPECT RATIO > 1.8 -ar_margin = 1.8 - -aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, ar_margin) - -anIds = mesh.GetIdsFromFilter(aFilter) - -# print the result -print "Criterion: Aspect Ratio > ", ar_margin, " Nb = ", len(anIds) -j = 1 -for i in range(len(anIds)): - if j > 20: j = 1; print "" - print anIds[i], - j = j + 1 - pass -print "" - -# create a group -aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Aspect Ratio > " + `ar_margin`) -aGroup.Add(anIds) - -salome.sg.updateObjBrowser(1) -\endcode - -
-\anchor tui_minimum_angle -

Minimum Angle

- -\code -import SMESH_mechanic - -smesh = SMESH_mechanic.smesh -mesh = SMESH_mechanic.mesh -salome = SMESH_mechanic.salome - -# Criterion : MINIMUM ANGLE < 35. -min_angle = 35. - -aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MinimumAngle, smesh.FT_LessThan, min_angle) - -anIds = mesh.GetIdsFromFilter(aFilter) - -# print the result -print "Criterion: Minimum Angle < ", min_angle, " Nb = ", len(anIds) -j = 1 -for i in range(len(anIds)): - if j > 20: j = 1; print "" - print anIds[i], - j = j + 1 - pass -print "" - -# create a group -aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Minimum Angle < " + `min_angle`) - -aGroup.Add(anIds) - -salome.sg.updateObjBrowser(1) -\endcode - -
-\anchor tui_warping -

Warping

- -\code -import SMESH_mechanic - -smesh = SMESH_mechanic.smesh -mesh = SMESH_mechanic.mesh -salome = SMESH_mechanic.salome - -# Criterion : WARP ANGLE > 1e-15 -wa_margin = 1e-15 - -aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Warping, smesh.FT_MoreThan, wa_margin) - -anIds = mesh.GetIdsFromFilter(aFilter) - -# print the result -print "Criterion: Warp > ", wa_margin, " Nb = ", len(anIds) -j = 1 -for i in range(len(anIds)): - if j > 20: j = 1; print "" - print anIds[i], - j = j + 1 - pass -print "" - -# create a group -aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Warp > " + `wa_margin`) - -aGroup.Add(anIds) - -salome.sg.updateObjBrowser(1) -\endcode - -
-\anchor tui_skew -

Skew

- -\code -import SMESH_mechanic - -smesh = SMESH_mechanic.smesh -mesh = SMESH_mechanic.mesh -salome = SMESH_mechanic.salome - -# Criterion : Skew > 38. -skew_margin = 38. - -aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Skew, smesh.FT_MoreThan, skew_margin) - -anIds = mesh.GetIdsFromFilter(aFilter) - -# print the result -print "Criterion: Skew > ", skew_margin, " Nb = ", len(anIds) -j = 1 -for i in range(len(anIds)): - if j > 20: j = 1; print "" - print anIds[i], - j = j + 1 - pass -print "" - -# create a group -aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Skew > " + `skew_margin`) -aGroup.Add(anIds) - -salome.sg.updateObjBrowser(1) -\endcode - -
-\anchor tui_aspect_ratio_3d -

Aspect Ratio 3D

- -\code -import SMESH_mechanic_tetra - -smesh = SMESH_mechanic_tetra.smesh -mesh = SMESH_mechanic_tetra.mesh -salome = SMESH_mechanic_tetra.salome - -# Criterion : ASPECT RATIO 3D > 4.5 -ar_margin = 4.5 - -aFilter = smesh.GetFilter(smesh.VOLUME, smesh.FT_AspectRatio3D, smesh.FT_MoreThan, ar_margin) - -anIds = mesh.GetIdsFromFilter(aFilter) - -# print the result -print "Criterion: Aspect Ratio 3D > ", ar_margin, " Nb = ", len(anIds) -j = 1 -for i in range(len(anIds)): - if j > 20: j = 1; print "" - print anIds[i], - j = j + 1 - pass -print "" - -# create a group -aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, "Aspect Ratio 3D > " + `ar_margin`) - -aGroup.Add(anIds) - -salome.sg.updateObjBrowser(1) -\endcode - -
-\anchor tui_volume -

Volume

- -\code -import SMESH_mechanic_tetra - -smesh = SMESH_mechanic_tetra.smesh -mesh = SMESH_mechanic_tetra.mesh -salome = SMESH_mechanic_tetra.salome - -# Criterion : VOLUME < 7. -volume_margin = 7. - -aFilter = smesh.GetFilter(smesh.VOLUME, smesh.FT_Volume3D, smesh.FT_LessThan, volume_margin) - -anIds = mesh.GetIdsFromFilter(aFilter) - -# print the result -print "" -print "Criterion: Volume < ", volume_margin, " Nb = ", len(anIds) -j = 1 -for i in range(len(anIds)): - if j > 20: j = 1; print "" - print anIds[i], - j = j + 1 - pass -print "" - -# create a group -aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, "Volume < " + `volume_margin`) - -aGroup.Add(anIds) - -salome.sg.updateObjBrowser(1) -\endcode - -*/ \ No newline at end of file +*/