1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
4 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 # File : SMESH_control.py
25 # Author : Sergey LITONIN
32 mesh = SMESH_mechanic.mesh
35 # ---- Criterion : AREA > 100
38 aGroup = mesh.MakeGroup("Area > 100", smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 100)
41 anIds = aGroup.GetIDs()
42 print "Criterion: Area > 100 Nb = ", len( anIds )
43 #for i in range( len( anIds ) ):
47 # ---- Criterion : Taper > 3e-15
50 aGroup = mesh.MakeGroup("Taper > 3e-15", smesh.FACE, smesh.FT_Taper, smesh.FT_MoreThan, 3e-15)
53 anIds = aGroup.GetIDs()
54 print "Criterion: Taper > 3e-15 Nb = ", len( anIds )
55 #for i in range( len( anIds ) ):
59 # ---- Criterion : ASPECT RATIO > 1.3
62 aGroup = mesh.MakeGroup("Aspect Ratio > 1.3", smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, 1.3)
65 anIds = aGroup.GetIDs()
66 print "Criterion: Aspect Ratio > 1.3 Nb = ", len( anIds )
67 #for i in range( len( anIds ) ):
71 # ---- Criterion : MINIMUM ANGLE < 30
74 aGroup = mesh.MakeGroup("Minimum Angle < 30", smesh.FACE, smesh.FT_MinimumAngle, smesh.FT_LessThan, 30)
77 anIds = aGroup.GetIDs()
78 print "Criterion: Minimum Angle < 30 Nb = ", len( anIds )
79 #for i in range( len( anIds ) ):
83 # ---- Criterion : Warp > 2e-13
86 aGroup = mesh.MakeGroup("Warp > 2e-13", smesh.FACE, smesh.FT_Warping, smesh.FT_MoreThan, 2e-13 )
89 anIds = aGroup.GetIDs()
90 print "Criterion: Warp > 2e-13 Nb = ", len( anIds )
91 #for i in range( len( anIds ) ):
95 # ---- Criterion : Skew > 18
98 aGroup = mesh.MakeGroup("Skew > 18", smesh.FACE, smesh.FT_Skew, smesh.FT_MoreThan, 18 )
101 anIds = aGroup.GetIDs()
102 print "Criterion: Skew > 18 Nb = ", len( anIds )
103 #for i in range( len( anIds ) ):
107 # Criterion : Length > 10
110 aGroup = mesh.MakeGroup("Length > 10", smesh.FACE, smesh.FT_Length, smesh.FT_MoreThan, 10 )
113 anIds = aGroup.GetIDs()
114 print "Criterion: Length > 10 Nb = ", len( anIds )
115 #for i in range( len( anIds ) ):
119 # Criterion : Borders at multi-connections = 2
122 aGroup = mesh.MakeGroup("Borders at multi-connections = 2", smesh.EDGE, smesh.FT_MultiConnection, smesh.FT_EqualTo, 2)
125 anIds = aGroup.GetIDs()
126 print "Criterion: Borders at multi-connections = 2 Nb = ", len( anIds )
127 #for i in range( len( anIds ) ):
131 # Criterion : Element Diameter 2D > 10
134 aGroup = mesh.MakeGroup("Element Diameter 2D > 10", smesh.FACE, smesh.FT_MaxElementLength2D, smesh.FT_MoreThan, 10 )
137 anIds = aGroup.GetIDs()
138 print "Criterion: Element Diameter 2D > 10 Nb = ", len( anIds )
139 #for i in range( len( anIds ) ):
143 salome.sg.updateObjBrowser(1)