Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/smesh.git] / doc / salome / gui / SMESH / input / tui_quality_controls.doc
index 57d52c69e7a3d04c657d9ade576a4986dc7f72a5..bc99172aaec77fceb5ec25b114f2eb7d1caf1939 100644 (file)
@@ -2,9 +2,7 @@
 
 \page tui_quality_controls_page Quality Controls
 
-<br>
-\anchor tui_free_borders
-<h2>Free Borders</h2>
+\section tui_free_borders Free Borders
 
 \code
 import salome
@@ -48,9 +46,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_borders_at_multiconnection
-<h2>Borders at Multiconnection</h2>
+\section tui_borders_at_multiconnection Borders at Multiconnection
 
 \code
 import salome
@@ -97,9 +93,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_length_1d
-<h2>Length 1D</h2>
+\section tui_length_1d Length 1D
 
 \code
 import salome
@@ -145,9 +139,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_free_edges
-<h2>Free Edges</h2>
+\section tui_free_edges Free Edges
 
 \code
 import SMESH_mechanic
@@ -189,9 +181,7 @@ for i in range(len(aBorders)):
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_free_nodes
-<h2>Free Nodes</h2>
+\section tui_free_nodes Free Nodes
 
 \code
 import salome
@@ -242,10 +232,7 @@ print ""
 salome.sg.updateObjBrowser(1)
 \endcode
 
-
-<br>
-\anchor tui_free_faces
-<h2>Free Faces</h2>
+\section tui_free_faces Free Faces
 
 \code
 import salome
@@ -281,13 +268,12 @@ geompy.addToStudy( Plane_2, "Plane_2" )
 import smesh
 
 import StdMeshers
-import NETGENPlugin
 
 Mesh_1 = smesh.Mesh(Partition_1)
 Regular_1D = Mesh_1.Segment()
 Max_Size_1 = Regular_1D.MaxSize(34.641)
 MEFISTO_2D = Mesh_1.Triangle()
-Tetrahedron_Netgen = Mesh_1.Tetrahedron(algo=smesh.NETGEN)
+Tetrahedronn = Mesh_1.Tetrahedron()
 isDone = Mesh_1.Compute()
 
 # create a group of free faces
@@ -298,11 +284,11 @@ aGroup = Mesh_1.CreateEmptyGroup(smesh.FACE, "Free_faces")
 aGroup.Add(aFaceIds)
 
 # print the result
-print "Criterion: Free nodes Nb = ", len(anNodeIds)
+print "Criterion: Free faces Nb = ", len(aFaceIds)
 j = 1
 for i in range(len(aFaceIds)):
   if j > 20: j = 1; print ""
-  print anNodeIds[i],
+  print aFaceIds[i],
   j = j + 1
   pass
 print ""
@@ -322,10 +308,91 @@ aGroup.Add(aFaceIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
+\section tui_bare_border_faces Bare border faces
+
+\code
+from smesh import *
+SetCurrentStudy(salome.myStudy)
+
+box = geompy.MakeBoxDXDYDZ(100, 100, 100)
+geompy.addToStudy( box, "box" )
+
+mesh = smesh.Mesh(box)
+mesh.Segment().NumberOfSegments(3)
+mesh.Quadrangle()
+mesh.Compute()
+
+# remove 2 faces
+allFaces = mesh.GetElementsByType(FACE)
+mesh.RemoveElements( allFaces[0:2])
+
+bareGroup = mesh.MakeGroup("bare faces", FACE, FT_BareBorderFace)
+assert(bareGroup.Size() == 3)
+\endcode
+
+\section tui_bare_border_volumes Bare border volumes
+
+\code
+from smesh import *
+SetCurrentStudy(salome.myStudy)
+
+box = geompy.MakeBoxDXDYDZ(100, 30, 10)
+# the smallest face of the box
+face = geompy.SubShapeAllSorted( box, geompy.ShapeType["FACE"])[0]
+
+geompy.addToStudy( box, "box" )
+geompy.addToStudyInFather( box, face, "face" )
+
+mesh = Mesh(box)
+mesh.AutomaticHexahedralization();
+
+# remove half of mesh faces from the smallest face
+faceFaces = mesh.GetSubMeshElementsId(face)
+faceToRemove = faceFaces[: len(faceFaces)/2]
+mesh.RemoveElements( faceToRemove )
+
+# make a group of volumes missing the removed faces
+bareGroup = mesh.MakeGroup("bare volumes", VOLUME, FT_BareBorderVolume)
+assert(bareGroup.Size() == len( faceToRemove))
+\endcode
+
+\section tui_over_constrained_faces Over-constrained faces
+\code
+from smesh import *
+SetCurrentStudy(salome.myStudy)
+
+mesh = Mesh()
+faceFilter = GetFilter(FACE,FT_OverConstrainedFace)
+
+#make an edge
+n1 = mesh.AddNode(0,0,0)
+n2 = mesh.AddNode(10,0,0)
+edge = mesh.AddEdge([n1,n2])
+assert( not mesh.GetIdsFromFilter( faceFilter ))
 
-<br>
-\anchor tui_length_2d
-<h2>Length 2D</h2>
+# make faces 
+mesh.ExtrusionSweep([edge], MakeDirStruct(0,7,0), 5)
+assert( 2 == len( mesh.GetIdsFromFilter( faceFilter )))
+\endcode
+
+\section tui_over_constrained_volumes Over-constrained volumes
+\code
+from smesh import *
+SetCurrentStudy(salome.myStudy)
+
+mesh = Mesh()
+volumeFilter = GetFilter(VOLUME,FT_OverConstrainedVolume)
+
+# make volumes by extrusion of one face
+n1 = mesh.AddNode(0,0,0)
+n2 = mesh.AddNode(10,0,0)
+edge = mesh.AddEdge([n1,n2])
+mesh.ExtrusionSweep([edge], MakeDirStruct(0,7,0), 1)
+mesh.ExtrusionSweep( mesh.GetElementsByType(FACE), MakeDirStruct(0,0,5), 7)
+assert( 2 == len( mesh.GetIdsFromFilter( volumeFilter )))
+\endcode
+
+\section tui_length_2d Length 2D
 
 \code
 import salome
@@ -372,9 +439,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_borders_at_multiconnection_2d
-<h2>Borders at Multiconnection 2D</h2>
+\section tui_borders_at_multiconnection_2d Borders at Multiconnection 2D
 
 \code
 import salome
@@ -421,9 +486,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_area
-<h2>Area</h2>
+\section tui_area Area
 
 \code
 import SMESH_mechanic
@@ -456,9 +519,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)  
 \endcode
 
-<br>
-\anchor tui_taper
-<h2>Taper</h2>
+\section tui_taper Taper
 
 \code
 import SMESH_mechanic
@@ -491,9 +552,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_aspect_ratio
-<h2>Aspect Ratio</h2>
+\section tui_aspect_ratio Aspect Ratio
 
 \code
 import SMESH_mechanic
@@ -526,9 +585,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_minimum_angle
-<h2>Minimum Angle</h2>
+\section tui_minimum_angle Minimum Angle
 
 \code
 import SMESH_mechanic
@@ -562,9 +619,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_warping
-<h2>Warping</h2>
+\section tui_warping Warping
 
 \code
 import SMESH_mechanic
@@ -598,9 +653,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1) 
 \endcode
 
-<br>
-\anchor tui_skew
-<h2>Skew</h2>
+\section tui_skew Skew
 
 \code
 import SMESH_mechanic
@@ -633,9 +686,40 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_aspect_ratio_3d
-<h2>Aspect Ratio 3D</h2>
+\section tui_max_element_length_2d Element Diameter 2D
+
+\code
+import SMESH_mechanic
+
+smesh  = SMESH_mechanic.smesh
+mesh   = SMESH_mechanic.mesh
+salome = SMESH_mechanic.salome
+
+# Criterion : ELEMENT DIAMETER 2D > 10
+mel_2d_margin = 10
+
+aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MaxElementLength2D, smesh.FT_MoreThan, mel_2d_margin)
+
+anIds = mesh.GetIdsFromFilter(aFilter) 
+
+# print the result
+print "Criterion: Element Diameter 2D Ratio > ", mel_2d_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, "Element Diameter 2D > " + `mel_2d_margin`)
+aGroup.Add(anIds)
+
+salome.sg.updateObjBrowser(1)
+\endcode
+
+\section tui_aspect_ratio_3d Aspect Ratio 3D
 
 \code
 import SMESH_mechanic_tetra 
@@ -669,9 +753,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_volume
-<h2>Volume</h2>
+\section tui_volume Volume
 
 \code
 import SMESH_mechanic_tetra
@@ -706,4 +788,37 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1) 
 \endcode
 
+\section tui_max_element_length_3d Element Diameter 3D
+
+\code
+import SMESH_mechanic_tetra
+
+smesh  = SMESH_mechanic_tetra.smesh
+mesh   = SMESH_mechanic_tetra.mesh
+salome = SMESH_mechanic_tetra.salome
+
+# Criterion : ELEMENT DIAMETER 3D > 10
+mel_3d_margin = 10
+
+aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MaxElementLength3D, smesh.FT_MoreThan, mel_3d_margin)
+
+anIds = mesh.GetIdsFromFilter(aFilter) 
+
+# print the result
+print "Criterion: Element Diameter 3D Ratio > ", mel_3d_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, "Element Diameter 3D > " + `mel_3d_margin`)
+aGroup.Add(anIds)
+
+salome.sg.updateObjBrowser(1)
+\endcode
+
 */