Version: 6.3.1
Functions

Creating groups

Grouping elements
Collaboration diagram for Creating groups:

Functions

def smeshDC::Mesh.CreateEmptyGroup
 Creates an empty mesh group.
def smeshDC::Mesh.Group
 Creates a mesh group based on the geometric object grp and gives a name,
if this parameter is not defined the name is the same as the geometric group name
Note: Works like GroupOnGeom().
def smeshDC::Mesh.GroupOnGeom
 Creates a mesh group based on the geometrical object grp and gives a name,
if this parameter is not defined the name is the same as the geometrical group name.
def smeshDC::Mesh.MakeGroupByIds
 Creates a mesh group by the given ids of elements.
def smeshDC::Mesh.MakeGroup
 Creates a mesh group by the given conditions.
def smeshDC::Mesh.MakeGroupByCriterion
 Creates a mesh group by the given criterion.
def smeshDC::Mesh.MakeGroupByCriteria
 Creates a mesh group by the given criteria (list of criteria)
def smeshDC::Mesh.MakeGroupByFilter
 Creates a mesh group by the given filter.
def smeshDC::Mesh.GetGroups
 Gets the list of groups existing in the mesh.
def smeshDC::Mesh.NbGroups
 Gets the number of groups existing in the mesh.
def smeshDC::Mesh.GetGroupNames
 Gets the list of names of groups existing in the mesh.

Function Documentation

def smeshDC.Mesh.CreateEmptyGroup (   self,
  elementType,
  name 
) [inherited]

Creates an empty mesh group.

Parameters:
elementTypethe type of elements in the group
namethe name of the mesh group
Returns:
SMESH_Group

Definition at line 1716 of file smeshDC.py.

01717                                                  :
01718         return self.mesh.CreateGroup(elementType, name)

def smeshDC.Mesh.GetGroupNames (   self) [inherited]

Gets the list of names of groups existing in the mesh.

Returns:
list of strings

Definition at line 1886 of file smeshDC.py.

01887                            :
01888         groups = self.GetGroups()
01889         names = []
01890         for group in groups:
01891             names.append(group.GetName())
01892         return names

def smeshDC.Mesh.GetGroups (   self) [inherited]

Gets the list of groups existing in the mesh.

Returns:
a sequence of SMESH_GroupBase

Definition at line 1874 of file smeshDC.py.

01875                        :
01876         return self.mesh.GetGroups()

def smeshDC.Mesh.Group (   self,
  grp,
  name = "" 
) [inherited]

Creates a mesh group based on the geometric object grp and gives a name,
if this parameter is not defined the name is the same as the geometric group name
Note: Works like GroupOnGeom().

Parameters:
grpa geometric group, a vertex, an edge, a face or a solid
namethe name of the mesh group
Returns:
SMESH_GroupOnGeom

Definition at line 1727 of file smeshDC.py.

01728                                  :
01729         return self.GroupOnGeom(grp, name)

def smeshDC.Mesh.GroupOnGeom (   self,
  grp,
  name = "",
  typ = None 
) [inherited]

Creates a mesh group based on the geometrical object grp and gives a name,
if this parameter is not defined the name is the same as the geometrical group name.

Parameters:
grpa geometrical group, a vertex, an edge, a face or a solid
namethe name of the mesh group
typthe type of elements in the group. If not set, it is automatically detected by the type of the geometry
Returns:
SMESH_GroupOnGeom

Definition at line 1739 of file smeshDC.py.

01740                                                  :
01741         AssureGeomPublished( self, grp, name )
01742         if name == "":
01743             name = grp.GetName()
01744         if not typ:
01745             typ = self._groupTypeFromShape( grp )
01746         return self.mesh.CreateGroupFromGEOM(typ, name, grp)

def smeshDC.Mesh.MakeGroup (   self,
  groupName,
  elementType,
  CritType = FT_Undefined,
  Compare = FT_EqualTo,
  Treshold = "",
  UnaryOp = FT_Undefined,
  Tolerance = 1e-07 
) [inherited]

Creates a mesh group by the given conditions.

Parameters:
groupNamethe name of the mesh group
elementTypethe type of elements in the group
CritTypethe type of criterion( FT_Taper, FT_Area, FT_RangeOfIds, FT_LyingOnGeom etc. )
Comparebelongs to {FT_LessThan, FT_MoreThan, FT_EqualTo}
Tresholdthe threshold value (range of id ids as string, shape, numeric)
UnaryOpFT_LogicalNOT or FT_Undefined
Tolerancethe tolerance used by FT_BelongToGeom, FT_BelongToSurface, FT_LyingOnGeom, FT_CoplanarFaces criteria
Returns:
SMESH_Group

Definition at line 1790 of file smeshDC.py.

01798                                   :
01799         aCriterion = self.smeshpyD.GetCriterion(elementType, CritType, Compare, Treshold, UnaryOp, FT_Undefined,Tolerance)
01800         group = self.MakeGroupByCriterion(groupName, aCriterion)
01801         return group

def smeshDC.Mesh.MakeGroupByCriteria (   self,
  groupName,
  theCriteria 
) [inherited]

Creates a mesh group by the given criteria (list of criteria)

Parameters:
groupNamethe name of the mesh group
theCriteriathe list of criteria
Returns:
SMESH_Group

Definition at line 1822 of file smeshDC.py.

01823                                                          :
01824         aFilterMgr = self.smeshpyD.CreateFilterManager()
01825         aFilter = aFilterMgr.CreateFilter()
01826         aFilter.SetCriteria(theCriteria)
01827         group = self.MakeGroupByFilter(groupName, aFilter)
01828         aFilterMgr.UnRegister()
01829         return group

def smeshDC.Mesh.MakeGroupByCriterion (   self,
  groupName,
  Criterion 
) [inherited]

Creates a mesh group by the given criterion.

Parameters:
groupNamethe name of the mesh group
Criterionthe instance of Criterion class
Returns:
SMESH_Group

Definition at line 1807 of file smeshDC.py.

01808                                                         :
01809         aFilterMgr = self.smeshpyD.CreateFilterManager()
01810         aFilter = aFilterMgr.CreateFilter()
01811         aCriteria = []
01812         aCriteria.append(Criterion)
01813         aFilter.SetCriteria(aCriteria)
01814         group = self.MakeGroupByFilter(groupName, aFilter)
01815         aFilterMgr.UnRegister()
01816         return group

def smeshDC.Mesh.MakeGroupByFilter (   self,
  groupName,
  theFilter 
) [inherited]

Creates a mesh group by the given filter.

Parameters:
groupNamethe name of the mesh group
theFilterthe instance of Filter class
Returns:
SMESH_Group

Definition at line 1835 of file smeshDC.py.

01836                                                      :
01837         group = self.CreateEmptyGroup(theFilter.GetElementType(), groupName)
01838         theFilter.SetMesh( self.mesh )
01839         group.AddFrom( theFilter )
01840         return group

def smeshDC.Mesh.MakeGroupByIds (   self,
  groupName,
  elementType,
  elemIDs 
) [inherited]

Creates a mesh group by the given ids of elements.

Parameters:
groupNamethe name of the mesh group
elementTypethe type of elements in the group
elemIDsthe list of ids
Returns:
SMESH_Group

Definition at line 1774 of file smeshDC.py.

01775                                                              :
01776         group = self.mesh.CreateGroup(elementType, groupName)
01777         group.Add(elemIDs)
01778         return group

def smeshDC.Mesh.NbGroups (   self) [inherited]

Gets the number of groups existing in the mesh.

Returns:
the quantity of groups as an integer value

Definition at line 1880 of file smeshDC.py.

01881                       :
01882         return self.mesh.NbGroups()

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS