Back to index

salome-smesh  6.5.0
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.GroupOnFilter
 Creates a mesh group with given name based on the filter which is a special type of group dynamically updating it's contents during mesh modification.
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 
)

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 1473 of file smeshDC.py.

01473 
01474     def CreateEmptyGroup(self, elementType, name):
01475         return self.mesh.CreateGroup(elementType, name)

Here is the caller graph for this function:

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

Returns:
list of strings

Definition at line 1654 of file smeshDC.py.

01654 
01655     def GetGroupNames(self):
01656         groups = self.GetGroups()
01657         names = []
01658         for group in groups:
01659             names.append(group.GetName())
01660         return names

Here is the call graph for this function:

def smeshDC.Mesh.GetGroups (   self)

Gets the list of groups existing in the mesh.

Returns:
a sequence of SMESH_GroupBase

Definition at line 1642 of file smeshDC.py.

01642 
01643     def GetGroups(self):
01644         return self.mesh.GetGroups()

Here is the caller graph for this function:

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

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 1484 of file smeshDC.py.

01484 
01485     def Group(self, grp, name=""):
01486         return self.GroupOnGeom(grp, name)

Here is the call graph for this function:

def smeshDC.Mesh.GroupOnFilter (   self,
  typ,
  name,
  filter 
)

Creates a mesh group with given name based on the filter which is a special type of group dynamically updating it's contents during mesh modification.

Parameters:
typthe type of elements in the group
namethe name of the mesh group
filterthe filter defining group contents
Returns:
SMESH_GroupOnFilter

Definition at line 1533 of file smeshDC.py.

01533 
01534     def GroupOnFilter(self, typ, name, filter):
01535         return self.mesh.CreateGroupFromFilter(typ, name, filter)

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

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 1496 of file smeshDC.py.

01496 
01497     def GroupOnGeom(self, grp, name="", typ=None):
01498         AssureGeomPublished( self, grp, name )
01499         if name == "":
01500             name = grp.GetName()
01501         if not typ:
01502             typ = self._groupTypeFromShape( grp )
01503         return self.mesh.CreateGroupFromGEOM(typ, name, grp)

Here is the call graph for this function:

Here is the caller graph for this function:

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

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}
Thresholdthe 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 1565 of file smeshDC.py.

01565 
01566                   Tolerance=1e-07):
01567         aCriterion = self.smeshpyD.GetCriterion(elementType, CritType, Compare, Threshold, UnaryOp, FT_Undefined,Tolerance)
01568         group = self.MakeGroupByCriterion(groupName, aCriterion)
01569         return group

Here is the call graph for this function:

Here is the caller graph for this function:

def smeshDC.Mesh.MakeGroupByCriteria (   self,
  groupName,
  theCriteria 
)

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 1590 of file smeshDC.py.

01590 
01591     def MakeGroupByCriteria(self, groupName, theCriteria):
01592         aFilterMgr = self.smeshpyD.CreateFilterManager()
01593         aFilter = aFilterMgr.CreateFilter()
01594         aFilter.SetCriteria(theCriteria)
01595         group = self.MakeGroupByFilter(groupName, aFilter)
01596         aFilterMgr.UnRegister()
01597         return group

Here is the call graph for this function:

def smeshDC.Mesh.MakeGroupByCriterion (   self,
  groupName,
  Criterion 
)

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 1575 of file smeshDC.py.

01575 
01576     def MakeGroupByCriterion(self, groupName, Criterion):
01577         aFilterMgr = self.smeshpyD.CreateFilterManager()
01578         aFilter = aFilterMgr.CreateFilter()
01579         aCriteria = []
01580         aCriteria.append(Criterion)
01581         aFilter.SetCriteria(aCriteria)
01582         group = self.MakeGroupByFilter(groupName, aFilter)
01583         aFilterMgr.UnRegister()
01584         return group

Here is the call graph for this function:

Here is the caller graph for this function:

def smeshDC.Mesh.MakeGroupByFilter (   self,
  groupName,
  theFilter 
)

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 1603 of file smeshDC.py.

01603 
01604     def MakeGroupByFilter(self, groupName, theFilter):
01605         group = self.CreateEmptyGroup(theFilter.GetElementType(), groupName)
01606         theFilter.SetMesh( self.mesh )
01607         group.AddFrom( theFilter )
01608         return group

Here is the call graph for this function:

Here is the caller graph for this function:

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

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 1542 of file smeshDC.py.

01542 
01543     def MakeGroupByIds(self, groupName, elementType, elemIDs):
01544         group = self.mesh.CreateGroup(elementType, groupName)
01545         group.Add(elemIDs)
01546         return group

Here is the call graph for this function:

def smeshDC.Mesh.NbGroups (   self)

Gets the number of groups existing in the mesh.

Returns:
the quantity of groups as an integer value

Definition at line 1648 of file smeshDC.py.

01648 
01649     def NbGroups(self):
01650         return self.mesh.NbGroups()