Salome HOME
0020889: EDF 1433 SMESH: SplitHexaToTetra: add the 24 tetras mode
[modules/smesh.git] / doc / salome / gui / SMESH / input / tui_quality_controls.doc
index e1b8b700e662893abfbcfbe16e7d1e3ce1127273..740c42247f584e2a7928a0402708b077550d845b 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,135 @@ for i in range(len(aBorders)):
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_length_2d
-<h2>Length 2D</h2>
+\section tui_free_nodes Free Nodes
+
+\code
+import salome
+import geompy
+
+import smesh
+
+# create box
+box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
+idbox = geompy.addToStudy(box, "box")
+
+# create a mesh
+mesh = smesh.Mesh(box, "Mesh_free_nodes")
+algo = mesh.Segment()
+algo.NumberOfSegments(10)
+algo = mesh.Triangle(smesh.MEFISTO)
+algo.MaxElementArea(150.)
+mesh.Compute() 
+
+# Remove some elements to obtain free nodes
+# Criterion : AREA < 80.
+area_margin = 80.
+
+aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, area_margin)
+
+anIds = mesh.GetIdsFromFilter(aFilter)
+
+mesh.RemoveElements(anIds)
+
+# criterion : free nodes
+aFilter = smesh.GetFilter(smesh.NODE, smesh.FT_FreeNodes) 
+anNodeIds = mesh.GetIdsFromFilter(aFilter)
+
+# create a group
+aGroup = mesh.CreateEmptyGroup(smesh.NODE, "Free_nodes")
+aGroup.Add(anNodeIds)
+
+# print the result
+print "Criterion: Free nodes Nb = ", len(anNodeIds)
+j = 1
+for i in range(len(anNodeIds)):
+  if j > 20: j = 1; print ""
+  print anNodeIds[i],
+  j = j + 1
+  pass
+print ""
+
+salome.sg.updateObjBrowser(1)
+\endcode
+
+\section tui_free_faces Free Faces
+
+\code
+import salome
+import geompy
+
+####### GEOM part ########
+
+Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
+Box_1_vertex_6 = geompy.GetSubShape(Box_1, [6])
+Box_1 = geompy.GetMainShape(Box_1_vertex_6)
+Box_1_vertex_16 = geompy.GetSubShape(Box_1, [16])
+Box_1 = geompy.GetMainShape(Box_1_vertex_16)
+Box_1_vertex_11 = geompy.GetSubShape(Box_1, [11])
+Box_1 = geompy.GetMainShape(Box_1_vertex_11)
+Plane_1 = geompy.MakePlaneThreePnt(Box_1_vertex_6, Box_1_vertex_16, Box_1_vertex_11, 2000)
+Partition_1 = geompy.MakePartition([Box_1], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
+
+Box_1_vertex_19 = geompy.GetSubShape(Box_1, [19])
+Box_1_vertex_21 = geompy.GetSubShape(Box_1, [21])
+Plane_2 = geompy.MakePlaneThreePnt(Box_1_vertex_16, Box_1_vertex_19, Box_1_vertex_21, 2000)
+
+geompy.addToStudy( Box_1, "Box_1" )
+geompy.addToStudyInFather( Box_1, Box_1_vertex_6, "Box_1:vertex_6" )
+geompy.addToStudyInFather( Box_1, Box_1_vertex_16, "Box_1:vertex_16" )
+geompy.addToStudyInFather( Box_1, Box_1_vertex_11, "Box_1:vertex_11" )
+geompy.addToStudy( Plane_1, "Plane_1" )
+geompy.addToStudy( Partition_1, "Partition_1" )
+geompy.addToStudyInFather( Box_1, Box_1_vertex_19, "Box_1:vertex_19" )
+geompy.addToStudyInFather( Box_1, Box_1_vertex_21, "Box_1:vertex_21" )
+geompy.addToStudy( Plane_2, "Plane_2" )
+
+###### SMESH part ######
+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)
+isDone = Mesh_1.Compute()
+
+# create a group of free faces
+aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_FreeFaces )
+aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
+
+aGroup = Mesh_1.CreateEmptyGroup(smesh.FACE, "Free_faces")
+aGroup.Add(aFaceIds)
+
+# print the result
+print "Criterion: Free nodes Nb = ", len(anNodeIds)
+j = 1
+for i in range(len(aFaceIds)):
+  if j > 20: j = 1; print ""
+  print anNodeIds[i],
+  j = j + 1
+  pass
+print ""
+
+#filter faces from plane 2
+aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_BelongToPlane, Plane_2)
+aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
+aGroup.Remove(aFaceIds)
+
+# create a group of shared faces (located on partition boundary inside box)
+aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_BelongToPlane, Plane_1)
+aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
+
+aGroup = Mesh_1.CreateEmptyGroup(smesh.FACE, "Shared_faces")
+aGroup.Add(aFaceIds)
+
+salome.sg.updateObjBrowser(1)
+\endcode
+
+\section tui_length_2d Length 2D
 
 \code
 import salome
@@ -238,9 +356,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
@@ -287,9 +403,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_area
-<h2>Area</h2>
+\section tui_area Area
 
 \code
 import SMESH_mechanic
@@ -322,9 +436,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)  
 \endcode
 
-<br>
-\anchor tui_taper
-<h2>Taper</h2>
+\section tui_taper Taper
 
 \code
 import SMESH_mechanic
@@ -357,9 +469,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
@@ -392,9 +502,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
@@ -428,9 +536,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_warping
-<h2>Warping</h2>
+\section tui_warping Warping
 
 \code
 import SMESH_mechanic
@@ -464,9 +570,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1) 
 \endcode
 
-<br>
-\anchor tui_skew
-<h2>Skew</h2>
+\section tui_skew Skew
 
 \code
 import SMESH_mechanic
@@ -499,9 +603,7 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1)
 \endcode
 
-<br>
-\anchor tui_aspect_ratio_3d
-<h2>Aspect Ratio 3D</h2>
+\section tui_aspect_ratio_3d Aspect Ratio 3D
 
 \code
 import SMESH_mechanic_tetra 
@@ -535,9 +637,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
@@ -572,4 +672,4 @@ aGroup.Add(anIds)
 salome.sg.updateObjBrowser(1) 
 \endcode
 
-*/
\ No newline at end of file
+*/