Back to index

salome-smesh  6.5.0
SMESH_controls.py
Go to the documentation of this file.
00001 #  -*- coding: iso-8859-1 -*-
00002 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00003 #
00004 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00005 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00006 #
00007 # This library is free software; you can redistribute it and/or
00008 # modify it under the terms of the GNU Lesser General Public
00009 # License as published by the Free Software Foundation; either
00010 # version 2.1 of the License.
00011 #
00012 # This library is distributed in the hope that it will be useful,
00013 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 # Lesser General Public License for more details.
00016 #
00017 # You should have received a copy of the GNU Lesser General Public
00018 # License along with this library; if not, write to the Free Software
00019 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00020 #
00021 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00022 #
00023 
00024 #  File   : SMESH_control.py
00025 #  Author : Sergey LITONIN
00026 #  Module : SMESH
00027 #
00028 import smesh
00029 import SMESH_mechanic
00030 
00031 salome = smesh.salome
00032 mesh   = SMESH_mechanic.mesh
00033 
00034 
00035 # ---- Criterion : AREA > 100
00036 
00037 # create group
00038 aGroup = mesh.MakeGroup("Area > 100", smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 100)
00039 
00040 # print result
00041 anIds = aGroup.GetIDs()
00042 print "Criterion: Area > 100 Nb = ", len( anIds )
00043 #for i in range( len( anIds ) ):
00044   #print anIds[ i ]
00045 
00046 
00047 # ----  Criterion : Taper > 3e-15
00048 
00049 # create group
00050 aGroup = mesh.MakeGroup("Taper > 3e-15", smesh.FACE, smesh.FT_Taper, smesh.FT_MoreThan, 3e-15)
00051 
00052 # print result
00053 anIds = aGroup.GetIDs()
00054 print "Criterion: Taper > 3e-15 Nb = ", len( anIds )
00055 #for i in range( len( anIds ) ):
00056   #print anIds[ i ]
00057 
00058 
00059 # ----  Criterion : ASPECT RATIO > 1.3
00060 
00061 # create group
00062 aGroup = mesh.MakeGroup("Aspect Ratio > 1.3", smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, 1.3)
00063 
00064 # print result
00065 anIds = aGroup.GetIDs()
00066 print "Criterion: Aspect Ratio > 1.3 Nb = ", len( anIds )
00067 #for i in range( len( anIds ) ):
00068   #print anIds[ i ]
00069 
00070 
00071 # ----  Criterion : MINIMUM ANGLE < 30
00072 
00073 # create group
00074 aGroup = mesh.MakeGroup("Minimum Angle < 30", smesh.FACE, smesh.FT_MinimumAngle, smesh.FT_LessThan, 30)
00075 
00076 # print result
00077 anIds = aGroup.GetIDs()
00078 print "Criterion: Minimum Angle < 30 Nb = ", len( anIds )
00079 #for i in range( len( anIds ) ):
00080   #print anIds[ i ]
00081 
00082 
00083 # ---- Criterion : Warp > 2e-13
00084 
00085 # create group
00086 aGroup = mesh.MakeGroup("Warp > 2e-13", smesh.FACE, smesh.FT_Warping, smesh.FT_MoreThan, 2e-13 )
00087 
00088 # print result
00089 anIds = aGroup.GetIDs()
00090 print "Criterion: Warp > 2e-13 Nb = ", len( anIds )
00091 #for i in range( len( anIds ) ):
00092   #print anIds[ i ]
00093 
00094 
00095 # ---- Criterion : Skew > 18
00096 
00097 # create group
00098 aGroup = mesh.MakeGroup("Skew > 18", smesh.FACE, smesh.FT_Skew, smesh.FT_MoreThan, 18 )
00099 
00100 # print result
00101 anIds = aGroup.GetIDs()
00102 print "Criterion: Skew > 18 Nb = ", len( anIds )
00103 #for i in range( len( anIds ) ):
00104   #print anIds[ i ]
00105 
00106 
00107 # Criterion : Length > 10
00108 
00109 # create group
00110 aGroup = mesh.MakeGroup("Length > 10", smesh.FACE, smesh.FT_Length, smesh.FT_MoreThan, 10 )
00111 
00112 # print result
00113 anIds = aGroup.GetIDs()
00114 print "Criterion: Length > 10 Nb = ", len( anIds )
00115 #for i in range( len( anIds ) ):
00116   #print anIds[ i ]
00117 
00118 
00119 # Criterion : Borders at multi-connections = 2
00120 
00121 # create group
00122 aGroup = mesh.MakeGroup("Borders at multi-connections = 2", smesh.EDGE, smesh.FT_MultiConnection, smesh.FT_EqualTo, 2)
00123 
00124 # print result
00125 anIds = aGroup.GetIDs()
00126 print "Criterion: Borders at multi-connections = 2 Nb = ", len( anIds )
00127 #for i in range( len( anIds ) ):
00128   #print anIds[ i ]
00129 
00130 
00131 # Criterion : Element Diameter 2D > 10
00132 
00133 # create group
00134 aGroup = mesh.MakeGroup("Element Diameter 2D > 10", smesh.FACE, smesh.FT_MaxElementLength2D, smesh.FT_MoreThan, 10 )
00135 
00136 # print result
00137 anIds = aGroup.GetIDs()
00138 print "Criterion: Element Diameter 2D > 10 Nb = ", len( anIds )
00139 #for i in range( len( anIds ) ):
00140   #print anIds[ i ]
00141 
00142 
00143 salome.sg.updateObjBrowser(1)