Version: 8.3.0
Home
 All Data Structures Namespaces Files Functions Variables Groups
Constructing sub-meshes

Functions

def GetSubMesh
 Get a sub-mesh object associated to a geom geometrical object. More...
 
def ClearSubMesh
 Remove all nodes and elements of indicated shape. More...
 
def Compute
 Compute the sub-mesh and return the status of the computation. More...
 

Detailed Description

Function Documentation

def GetSubMesh (   self,
  geom,
  name 
)

Get a sub-mesh object associated to a geom geometrical object.

Parameters
geoma geometrical object (shape)
namea name for the sub-mesh in the Object Browser
Returns
an object of type SMESH.SMESH_subMesh, representing a part of mesh, which lies on the given shape

The sub-mesh object gives access to the IDs of nodes and elements. The sub-mesh object has the following methods:

  • SMESH.SMESH_subMesh.GetNumberOfElements()
  • SMESH.SMESH_subMesh.GetNumberOfNodes( all )
  • SMESH.SMESH_subMesh.GetElementsId()
  • SMESH.SMESH_subMesh.GetElementsByType( ElementType )
  • SMESH.SMESH_subMesh.GetNodesId()
  • SMESH.SMESH_subMesh.GetSubShape()
  • SMESH.SMESH_subMesh.GetFather()
  • SMESH.SMESH_subMesh.GetId()
    Note
    A sub-mesh is implicitly created when a sub-shape is specified at creating an algorithm, for example: algo1D = mesh.Segment(geom=Edge_1) creates a sub-mesh on Edge_1 and assign Wire Discretization algorithm to it. The created sub-mesh can be retrieved from the algorithm: submesh = algo1D.GetSubMesh()

References smeshBuilder.AssureGeomPublished().

def ClearSubMesh (   self,
  geomId,
  refresh = False 
)

Remove all nodes and elements of indicated shape.

Parameters
refreshif True, Object browser is automatically updated (when running in GUI)
geomIdthe ID of a sub-shape to remove elements on

References Mesh.mesh.

def Compute (   self,
  refresh = False 
)

Compute the sub-mesh and return the status of the computation.

Parameters
refreshif True, Object browser is automatically updated (when running in GUI)
Returns
True or False

This is a method of SMESH.SMESH_submesh that can be obtained via Mesh.GetSubMesh() or Mesh_Algorithm.GetSubMesh().

References Mesh.GetMesh(), Mesh.mesh, and submeshProxy.mesh.