Version: 8.3.0
Home
 All Data Structures Namespaces Files Functions Variables Groups
Mesh Information

Functions

def GetMeshInfo
 Get the mesh statistic. More...
 
def GetGeometryByMeshElement
 Return a geometrical object on which the given element was built. More...
 
def MeshDimension
 Return the mesh dimension depending on the dimension of the underlying shape or, if the mesh is not based on any shape, basing on deimension of elements. More...
 
def GetMeshInfo
 Get the mesh stattistic. More...
 
def NbNodes
 Return the number of nodes in the mesh. More...
 
def NbElements
 Return the number of elements in the mesh. More...
 
def Nb0DElements
 Return the number of 0d elements in the mesh. More...
 
def NbBalls
 Return the number of ball discrete elements in the mesh. More...
 
def NbEdges
 Return the number of edges in the mesh. More...
 
def NbEdgesOfOrder
 Return the number of edges with the given order in the mesh. More...
 
def NbFaces
 Return the number of faces in the mesh. More...
 
def NbFacesOfOrder
 Return the number of faces with the given order in the mesh. More...
 
def NbTriangles
 Return the number of triangles in the mesh. More...
 
def NbTrianglesOfOrder
 Return the number of triangles with the given order in the mesh. More...
 
def NbBiQuadTriangles
 Return the number of biquadratic triangles in the mesh. More...
 
def NbQuadrangles
 Return the number of quadrangles in the mesh. More...
 
def NbQuadranglesOfOrder
 Return the number of quadrangles with the given order in the mesh. More...
 
def NbBiQuadQuadrangles
 Return the number of biquadratic quadrangles in the mesh. More...
 
def NbPolygons
 Return the number of polygons of given order in the mesh. More...
 
def NbVolumes
 Return the number of volumes in the mesh. More...
 
def NbVolumesOfOrder
 Return the number of volumes with the given order in the mesh. More...
 
def NbTetras
 Return the number of tetrahedrons in the mesh. More...
 
def NbTetrasOfOrder
 Return the number of tetrahedrons with the given order in the mesh. More...
 
def NbHexas
 Return the number of hexahedrons in the mesh. More...
 
def NbHexasOfOrder
 Return the number of hexahedrons with the given order in the mesh. More...
 
def NbTriQuadraticHexas
 Return the number of triquadratic hexahedrons in the mesh. More...
 
def NbPyramids
 Return the number of pyramids in the mesh. More...
 
def NbPyramidsOfOrder
 Return the number of pyramids with the given order in the mesh. More...
 
def NbPrisms
 Return the number of prisms in the mesh. More...
 
def NbPrismsOfOrder
 Return the number of prisms with the given order in the mesh. More...
 
def NbHexagonalPrisms
 Return the number of hexagonal prisms in the mesh. More...
 
def NbPolyhedrons
 Return the number of polyhedrons in the mesh. More...
 
def NbSubMesh
 Return the number of submeshes in the mesh. More...
 
def GetElementsId
 Return the list of mesh elements IDs. More...
 
def GetElementsByType
 Return the list of IDs of mesh elements with the given type. More...
 
def GetNodesId
 Return the list of mesh nodes IDs. More...
 
def GetElementType
 Return the type of mesh element. More...
 
def GetElementGeomType
 Return the geometric type of mesh element. More...
 
def GetElementShape
 Return the shape type of mesh element. More...
 
def GetSubMeshElementsId
 Return the list of submesh elements IDs. More...
 
def GetSubMeshNodesId
 Return the list of submesh nodes IDs. More...
 
def GetSubMeshElementType
 Return type of elements on given shape. More...
 
def Dump
 Get the mesh description. More...
 
def GetNodeXYZ
 Get XYZ coordinates of a node
If there is no nodes for the given ID - return an empty list. More...
 
def GetNodeInverseElements
 Return list of IDs of inverse elements for the given node
If there is no node for the given ID - return an empty list. More...
 
def GetNodePosition
 Return the position of a node on the shape. More...
 
def GetElementPosition
 Return the position of an element on the shape. More...
 
def GetShapeID
 Return the ID of the shape, on which the given node was generated. More...
 
def GetShapeIDForElem
 Return the ID of the shape, on which the given element was generated. More...
 
def GetElemNbNodes
 Return the number of nodes of the given element. More...
 
def GetElemNode
 Return the node ID the given (zero based) index for the given element
If there is no element for the given ID - return -1
If there is no node for the given index - return -2. More...
 
def GetElemNodes
 Return the IDs of nodes of the given element. More...
 
def IsMediumNode
 Return true if the given node is the medium node in the given quadratic element. More...
 
def IsMediumNodeOfAnyElem
 Return true if the given node is the medium node in one of quadratic elements. More...
 
def ElemNbEdges
 Return the number of edges for the given element. More...
 
def ElemNbFaces
 Return the number of faces for the given element. More...
 
def GetElemFaceNodes
 Return nodes of given face (counted from zero) for given volumic element. More...
 
def GetFaceNormal
 Return three components of normal of given mesh face (or an empty array in KO case) More...
 
def FindElementByNodes
 Return an element based on all given nodes. More...
 
def IsPoly
 Return true if the given element is a polygon. More...
 
def IsQuadratic
 Return true if the given element is quadratic. More...
 
def GetBallDiameter
 Return diameter of a ball discrete element or zero in case of an invalid id. More...
 
def BaryCenter
 Return XYZ coordinates of the barycenter of the given element
If there is no element for the given ID - return an empty list. More...
 
def FindNodeClosestTo
 Find the node closest to a point. More...
 
def FindElementsByPoint
 Find the elements where a point lays IN or ON. More...
 
def GetPointState
 Return point state in a closed 2D mesh in terms of TopAbs_State enumeration: 0-IN, 1-OUT, 2-ON, 3-UNKNOWN UNKNOWN state means that either mesh is wrong or the analysis fails. More...
 

Detailed Description

Function Documentation

def GetMeshInfo (   self,
  obj 
)

Get the mesh statistic.

Returns
dictionary "element type" - "count of elements"
def GetGeometryByMeshElement (   self,
  theElementID,
  theGeomName 
)

Return a geometrical object on which the given element was built.

The returned geometrical object, if not nil, is either found in the study or published by this method with the given name

Parameters
theElementIDthe id of the mesh element
theGeomNamethe user-defined name of the geometrical object
Returns
GEOM::GEOM_Object instance

References Mesh.mesh.

def MeshDimension (   self)

Return the mesh dimension depending on the dimension of the underlying shape or, if the mesh is not based on any shape, basing on deimension of elements.

Returns
mesh dimension as an integer value [0,3]

References Mesh.geom, Mesh.NbEdges(), Mesh.NbFaces(), and Mesh.NbVolumes().

def GetMeshInfo (   self,
  obj = None 
)

Get the mesh stattistic.

Returns
dictionary type element - count of elements

References Mesh.mesh.

def NbNodes (   self)

Return the number of nodes in the mesh.

Returns
an integer value
def NbElements (   self)

Return the number of elements in the mesh.

Returns
an integer value
def Nb0DElements (   self)

Return the number of 0d elements in the mesh.

Returns
an integer value
def NbBalls (   self)

Return the number of ball discrete elements in the mesh.

Returns
an integer value
def NbEdges (   self)

Return the number of edges in the mesh.

Returns
an integer value
def NbEdgesOfOrder (   self,
  elementOrder 
)

Return the number of edges with the given order in the mesh.

Parameters
elementOrderthe order of elements: SMESH.ORDER_ANY, SMESH.ORDER_LINEAR or SMESH.ORDER_QUADRATIC
Returns
an integer value
def NbFaces (   self)

Return the number of faces in the mesh.

Returns
an integer value
def NbFacesOfOrder (   self,
  elementOrder 
)

Return the number of faces with the given order in the mesh.

Parameters
elementOrderthe order of elements: SMESH.ORDER_ANY, SMESH.ORDER_LINEAR or SMESH.ORDER_QUADRATIC
Returns
an integer value
def NbTriangles (   self)

Return the number of triangles in the mesh.

Returns
an integer value
def NbTrianglesOfOrder (   self,
  elementOrder 
)

Return the number of triangles with the given order in the mesh.

Parameters
elementOrderis the order of elements: SMESH.ORDER_ANY, SMESH.ORDER_LINEAR or SMESH.ORDER_QUADRATIC
Returns
an integer value
def NbBiQuadTriangles (   self)

Return the number of biquadratic triangles in the mesh.

Returns
an integer value
def NbQuadrangles (   self)

Return the number of quadrangles in the mesh.

Returns
an integer value
def NbQuadranglesOfOrder (   self,
  elementOrder 
)

Return the number of quadrangles with the given order in the mesh.

Parameters
elementOrderthe order of elements: SMESH.ORDER_ANY, SMESH.ORDER_LINEAR or SMESH.ORDER_QUADRATIC
Returns
an integer value
def NbBiQuadQuadrangles (   self)

Return the number of biquadratic quadrangles in the mesh.

Returns
an integer value
def NbPolygons (   self,
  elementOrder = SMESH.ORDER_ANY 
)

Return the number of polygons of given order in the mesh.

Parameters
elementOrderthe order of elements: SMESH.ORDER_ANY, SMESH.ORDER_LINEAR or SMESH.ORDER_QUADRATIC
Returns
an integer value
def NbVolumes (   self)

Return the number of volumes in the mesh.

Returns
an integer value
def NbVolumesOfOrder (   self,
  elementOrder 
)

Return the number of volumes with the given order in the mesh.

Parameters
elementOrderthe order of elements: SMESH.ORDER_ANY, SMESH.ORDER_LINEAR or SMESH.ORDER_QUADRATIC
Returns
an integer value
def NbTetras (   self)

Return the number of tetrahedrons in the mesh.

Returns
an integer value
def NbTetrasOfOrder (   self,
  elementOrder 
)

Return the number of tetrahedrons with the given order in the mesh.

Parameters
elementOrderthe order of elements: SMESH.ORDER_ANY, SMESH.ORDER_LINEAR or SMESH.ORDER_QUADRATIC
Returns
an integer value
def NbHexas (   self)

Return the number of hexahedrons in the mesh.

Returns
an integer value
def NbHexasOfOrder (   self,
  elementOrder 
)

Return the number of hexahedrons with the given order in the mesh.

Parameters
elementOrderthe order of elements: SMESH.ORDER_ANY, SMESH.ORDER_LINEAR or SMESH.ORDER_QUADRATIC
Returns
an integer value
def NbTriQuadraticHexas (   self)

Return the number of triquadratic hexahedrons in the mesh.

Returns
an integer value
def NbPyramids (   self)

Return the number of pyramids in the mesh.

Returns
an integer value
def NbPyramidsOfOrder (   self,
  elementOrder 
)

Return the number of pyramids with the given order in the mesh.

Parameters
elementOrderthe order of elements: SMESH.ORDER_ANY, SMESH.ORDER_LINEAR or SMESH.ORDER_QUADRATIC
Returns
an integer value
def NbPrisms (   self)

Return the number of prisms in the mesh.

Returns
an integer value
def NbPrismsOfOrder (   self,
  elementOrder 
)

Return the number of prisms with the given order in the mesh.

Parameters
elementOrderthe order of elements: SMESH.ORDER_ANY, SMESH.ORDER_LINEAR or SMESH.ORDER_QUADRATIC
Returns
an integer value
def NbHexagonalPrisms (   self)

Return the number of hexagonal prisms in the mesh.

Returns
an integer value
def NbPolyhedrons (   self)

Return the number of polyhedrons in the mesh.

Returns
an integer value
def NbSubMesh (   self)

Return the number of submeshes in the mesh.

Returns
an integer value
def GetElementsId (   self)

Return the list of mesh elements IDs.

Returns
the list of integer values
def GetElementsByType (   self,
  elementType 
)

Return the list of IDs of mesh elements with the given type.

Parameters
elementTypethe required type of elements, either of (SMESH.NODE, SMESH.EDGE, SMESH.FACE or SMESH.VOLUME)
Returns
list of integer values
def GetNodesId (   self)

Return the list of mesh nodes IDs.

Returns
the list of integer values
def GetElementType (   self,
  id,
  iselem = True 
)

Return the type of mesh element.

Returns
the value from SMESH::ElementType enumeration Type SMESH.ElementType._items in the Python Console to see all possible values.
def GetElementGeomType (   self,
  id 
)

Return the geometric type of mesh element.

Returns
the value from SMESH::EntityType enumeration Type SMESH.EntityType._items in the Python Console to see all possible values.
def GetElementShape (   self,
  id 
)

Return the shape type of mesh element.

Returns
the value from SMESH::GeometryType enumeration. Type SMESH.GeometryType._items in the Python Console to see all possible values.
def GetSubMeshElementsId (   self,
  Shape 
)

Return the list of submesh elements IDs.

Parameters
Shapea geom object(sub-shape) Shape must be the sub-shape of a ShapeToMesh()
Returns
the list of integer values

References Mesh.geom.

def GetSubMeshNodesId (   self,
  Shape,
  all 
)

Return the list of submesh nodes IDs.

Parameters
Shapea geom object(sub-shape) Shape must be the sub-shape of a ShapeToMesh()
allIf true, gives all nodes of submesh elements, otherwise gives only submesh nodes
Returns
the list of integer values

References Mesh.geom.

def GetSubMeshElementType (   self,
  Shape 
)

Return type of elements on given shape.

Parameters
Shapea geom object(sub-shape) Shape must be a sub-shape of a ShapeToMesh()
Returns
element type

References Mesh.geom.

def Dump (   self)

Get the mesh description.

Returns
string value
def GetNodeXYZ (   self,
  id 
)

Get XYZ coordinates of a node
If there is no nodes for the given ID - return an empty list.

Returns
a list of double precision values
def GetNodeInverseElements (   self,
  id 
)

Return list of IDs of inverse elements for the given node
If there is no node for the given ID - return an empty list.

Returns
a list of integer values
def GetNodePosition (   self,
  NodeID 
)

Return the position of a node on the shape.

Returns
SMESH::NodePosition
def GetElementPosition (   self,
  ElemID 
)

Return the position of an element on the shape.

Returns
SMESH::ElementPosition
def GetShapeID (   self,
  id 
)

Return the ID of the shape, on which the given node was generated.

Returns
an integer value > 0 or -1 if there is no node for the given ID or the node is not assigned to any geometry
def GetShapeIDForElem (   self,
  id 
)

Return the ID of the shape, on which the given element was generated.

Returns
an integer value > 0 or -1 if there is no element for the given ID or the element is not assigned to any geometry
def GetElemNbNodes (   self,
  id 
)

Return the number of nodes of the given element.

Returns
an integer value > 0 or -1 if there is no element for the given ID
def GetElemNode (   self,
  id,
  index 
)

Return the node ID the given (zero based) index for the given element
If there is no element for the given ID - return -1
If there is no node for the given index - return -2.

Returns
an integer value
def GetElemNodes (   self,
  id 
)

Return the IDs of nodes of the given element.

Returns
a list of integer values
def IsMediumNode (   self,
  elementID,
  nodeID 
)

Return true if the given node is the medium node in the given quadratic element.

def IsMediumNodeOfAnyElem (   self,
  nodeID,
  elementType = SMESH.ALL 
)

Return true if the given node is the medium node in one of quadratic elements.

Parameters
nodeIDID of the node
elementTypethe type of elements to check a state of the node, either of (SMESH.ALL, SMESH.NODE, SMESH.EDGE, SMESH.FACE or SMESH.VOLUME)
def ElemNbEdges (   self,
  id 
)

Return the number of edges for the given element.

def ElemNbFaces (   self,
  id 
)

Return the number of faces for the given element.

def GetElemFaceNodes (   self,
  elemId,
  faceIndex 
)

Return nodes of given face (counted from zero) for given volumic element.

def GetFaceNormal (   self,
  faceId,
  normalized = False 
)

Return three components of normal of given mesh face (or an empty array in KO case)

def FindElementByNodes (   self,
  nodes 
)

Return an element based on all given nodes.

def IsPoly (   self,
  id 
)

Return true if the given element is a polygon.

def IsQuadratic (   self,
  id 
)

Return true if the given element is quadratic.

def GetBallDiameter (   self,
  id 
)

Return diameter of a ball discrete element or zero in case of an invalid id.

def BaryCenter (   self,
  id 
)

Return XYZ coordinates of the barycenter of the given element
If there is no element for the given ID - return an empty list.

Returns
a list of three double values
def FindNodeClosestTo (   self,
  x,
  y,
  z 
)

Find the node closest to a point.

Parameters
xthe X coordinate of a point
ythe Y coordinate of a point
zthe Z coordinate of a point
Returns
the ID of a node
def FindElementsByPoint (   self,
  x,
  y,
  z,
  elementType = SMESH.ALL,
  meshPart = None 
)

Find the elements where a point lays IN or ON.

Parameters
xthe X coordinate of a point
ythe Y coordinate of a point
zthe Z coordinate of a point
elementTypetype of elements to find; either of (SMESH.NODE, SMESH.EDGE, SMESH.FACE, SMESH.VOLUME); SMESH.ALL type means elements of any type excluding nodes, discrete and 0D elements.
meshParta part of mesh (group, sub-mesh) to search within
Returns
list of IDs of found elements
def GetPointState (   self,
  x,
  y,
  z 
)

Return point state in a closed 2D mesh in terms of TopAbs_State enumeration: 0-IN, 1-OUT, 2-ON, 3-UNKNOWN UNKNOWN state means that either mesh is wrong or the analysis fails.