Back to index

salome-smesh  6.5.0
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
smeshDC.Mesh Class Reference

This class allows defining and managing a mesh. More...

List of all members.

Public Member Functions

def __init__
 Constructor.
def SetMesh
 Initializes the Mesh object from an instance of SMESH_Mesh interface.
def GetMesh
 Returns the mesh, that is an instance of SMESH_Mesh interface.
def GetName
 Gets the name of the mesh.
def SetName
 Sets a name to the mesh.
def GetSubMesh
 Gets the subMesh object associated to a theSubObject geometrical object.
def GetShape
 Returns the shape associated to the mesh.
def SetShape
 Associates the given shape to the mesh (entails the recreation of the mesh)
def Load
 Loads mesh from the study after opening the study.
def IsReadyToCompute
 Returns true if the hypotheses are defined well.
def GetAlgoState
 Returns errors of hypotheses definition.
def GetGeometryByMeshElement
 Returns a geometrical object on which the given element was built.
def MeshDimension
 Returns the mesh dimension depending on the dimension of the underlying shape.
def Evaluate
 Evaluates size of prospective mesh on a shape.
def Compute
 Computes the mesh and returns the status of the computation.
def GetMeshOrder
 Return submesh objects list in meshing order.
def SetMeshOrder
 Return submesh objects list in meshing order.
def Clear
 Removes all nodes and elements.
def ClearSubMesh
 Removes all nodes and elements of indicated shape.
def AutomaticTetrahedralization
 Computes a tetrahedral mesh using AutomaticLength + MEFISTO + NETGEN.
def AutomaticHexahedralization
 Computes an hexahedral mesh using AutomaticLength + Quadrangle + Hexahedron.
def AddHypothesis
 Assigns a hypothesis.
def IsUsedHypothesis
 Return True if an algorithm of hypothesis is assigned to a given shape.
def RemoveHypothesis
 Unassigns a hypothesis.
def GetHypothesisList
 Gets the list of hypotheses added on a geometry.
def RemoveGlobalHypotheses
 Removes all global hypotheses.
def ExportToMED
 Deprecated, used only for compatibility! Please, use ExportToMEDX() method instead.
def ExportMED
 Exports the mesh in a file in MED format and chooses the version of MED format allowing to overwrite the file if it exists or add the exported data to its contents.
def ExportSAUV
 Exports the mesh in a file in SAUV format.
def ExportDAT
 Exports the mesh in a file in DAT format.
def ExportUNV
 Exports the mesh in a file in UNV format.
def ExportSTL
 Export the mesh in a file in STL format.
def ExportCGNS
 Exports the mesh in a file in CGNS format.
def CreateEmptyGroup
 Creates an empty mesh group.
def 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 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 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 MakeGroupByIds
 Creates a mesh group by the given ids of elements.
def MakeGroup
 Creates a mesh group by the given conditions.
def MakeGroupByCriterion
 Creates a mesh group by the given criterion.
def MakeGroupByCriteria
 Creates a mesh group by the given criteria (list of criteria)
def MakeGroupByFilter
 Creates a mesh group by the given filter.
def GetIdsFromFilter
 Passes mesh elements through the given filter and return IDs of fitting elements.
def GetFreeBorders
 Verifies whether a 2D mesh element has free edges (edges connected to one face only)
Returns a list of special structures (borders).
def RemoveGroup
 Removes a group.
def RemoveGroupWithContents
 Removes a group with its contents.
def GetGroups
 Gets the list of groups existing in the mesh.
def NbGroups
 Gets the number of groups existing in the mesh.
def GetGroupNames
 Gets the list of names of groups existing in the mesh.
def UnionGroups
 Produces a union of two groups A new group is created.
def UnionListOfGroups
 Produces a union list of groups New group is created.
def IntersectGroups
 Prodices an intersection of two groups A new group is created.
def IntersectListOfGroups
 Produces an intersection of groups New group is created.
def CutGroups
 Produces a cut of two groups A new group is created.
def CutListOfGroups
 Produces a cut of groups A new group is created.
def CreateDimGroup
 Produces a group of elements of specified type using list of existing groups A new group is created.
def ConvertToStandalone
 Convert group on geom into standalone group.
def GetLog
 Returns the log of nodes and elements added or removed since the previous clear of the log.
def ClearLog
 Clears the log of nodes and elements added or removed since the previous clear.
def SetAutoColor
 Toggles auto color mode on the object.
def GetAutoColor
 Gets flag of object auto color mode.
def GetId
 Gets the internal ID.
def GetStudyId
 Get the study Id.
def HasDuplicatedGroupNamesMED
 Checks the group names for duplications.
def GetMeshEditor
 Obtains the mesh editor tool.
def GetIDSource
 Wrap a list of IDs of elements or nodes into SMESH_IDSource which can be passed as argument to accepting mesh, group or sub-mesh.
def GetMEDMesh
 Gets MED Mesh.
def GetMeshInfo
 Gets the mesh stattistic.
def NbNodes
 Returns the number of nodes in the mesh.
def NbElements
 Returns the number of elements in the mesh.
def Nb0DElements
 Returns the number of 0d elements in the mesh.
def NbEdges
 Returns the number of edges in the mesh.
def NbEdgesOfOrder
 Returns the number of edges with the given order in the mesh.
def NbFaces
 Returns the number of faces in the mesh.
def NbFacesOfOrder
 Returns the number of faces with the given order in the mesh.
def NbTriangles
 Returns the number of triangles in the mesh.
def NbTrianglesOfOrder
 Returns the number of triangles with the given order in the mesh.
def NbQuadrangles
 Returns the number of quadrangles in the mesh.
def NbQuadranglesOfOrder
 Returns the number of quadrangles with the given order in the mesh.
def NbBiQuadQuadrangles
 Returns the number of biquadratic quadrangles in the mesh.
def NbPolygons
 Returns the number of polygons in the mesh.
def NbVolumes
 Returns the number of volumes in the mesh.
def NbVolumesOfOrder
 Returns the number of volumes with the given order in the mesh.
def NbTetras
 Returns the number of tetrahedrons in the mesh.
def NbTetrasOfOrder
 Returns the number of tetrahedrons with the given order in the mesh.
def NbHexas
 Returns the number of hexahedrons in the mesh.
def NbHexasOfOrder
 Returns the number of hexahedrons with the given order in the mesh.
def NbTriQuadraticHexas
 Returns the number of triquadratic hexahedrons in the mesh.
def NbPyramids
 Returns the number of pyramids in the mesh.
def NbPyramidsOfOrder
 Returns the number of pyramids with the given order in the mesh.
def NbPrisms
 Returns the number of prisms in the mesh.
def NbPrismsOfOrder
 Returns the number of prisms with the given order in the mesh.
def NbHexagonalPrisms
 Returns the number of hexagonal prisms in the mesh.
def NbPolyhedrons
 Returns the number of polyhedrons in the mesh.
def NbSubMesh
 Returns the number of submeshes in the mesh.
def GetElementsId
 Returns the list of mesh elements IDs.
def GetElementsByType
 Returns the list of IDs of mesh elements with the given type.
def GetNodesId
 Returns the list of mesh nodes IDs.
def GetElementType
 Returns the type of mesh element.
def GetElementGeomType
 Returns the geometric type of mesh element.
def GetSubMeshElementsId
 Returns the list of submesh elements IDs.
def GetSubMeshNodesId
 Returns the list of submesh nodes IDs.
def GetSubMeshElementType
 Returns type of elements on given shape.
def Dump
 Gets the mesh description.
def GetNodeXYZ
 Gets XYZ coordinates of a node
If there is no nodes for the given ID - returns an empty list.
def GetNodeInverseElements
 Returns list of IDs of inverse elements for the given node
If there is no node for the given ID - returns an empty list.
def GetNodePosition
 Returns the position of a node on the shape.
def GetShapeID
 If the given element is a node, returns the ID of shape
If there is no node for the given ID - returns -1.
def GetShapeIDForElem
 Returns the ID of the result shape after FindShape() from SMESH_MeshEditor for the given element
If there is no element for the given ID - returns -1.
def GetElemNbNodes
 Returns the number of nodes for the given element
If there is no element for the given ID - returns -1.
def GetElemNode
 Returns the node ID the given index for the given element
If there is no element for the given ID - returns -1
If there is no node for the given index - returns -2.
def GetElemNodes
 Returns the IDs of nodes of the given element.
def IsMediumNode
 Returns true if the given node is the medium node in the given quadratic element.
def IsMediumNodeOfAnyElem
 Returns true if the given node is the medium node in one of quadratic elements.
def ElemNbEdges
 Returns the number of edges for the given element.
def ElemNbFaces
 Returns the number of faces for the given element.
def GetElemFaceNodes
 Returns nodes of given face (counted from zero) for given volumic element.
def FindElementByNodes
 Returns an element based on all given nodes.
def IsPoly
 Returns true if the given element is a polygon.
def IsQuadratic
 Returns true if the given element is quadratic.
def BaryCenter
 Returns XYZ coordinates of the barycenter of the given element
If there is no element for the given ID - returns an empty list.
def MinDistance
 Get minimum distance between two nodes, elements or distance to the origin.
def GetMinDistance
 Get measure structure specifying minimum distance data between two objects.
def BoundingBox
 Get bounding box of the specified object(s)
def GetBoundingBox
 Get measure structure specifying bounding box data of the specified object(s)
def RemoveElements
 Removes the elements from the mesh by ids.
def RemoveNodes
 Removes nodes from mesh by ids.
def RemoveOrphanNodes
 Removes all orphan (free) nodes from mesh.
def AddNode
 Add a node to the mesh by coordinates.
def Add0DElement
 Creates a 0D element on a node with given number.
def AddEdge
 Creates a linear or quadratic edge (this is determined by the number of given nodes).
def AddFace
 Creates a linear or quadratic face (this is determined by the number of given nodes).
def AddPolygonalFace
 Adds a polygonal face to the mesh by the list of node IDs.
def AddVolume
 Creates both simple and quadratic volume (this is determined by the number of given nodes).
def AddPolyhedralVolume
 Creates a volume of many faces, giving nodes for each face.
def AddPolyhedralVolumeByFaces
 Creates a volume of many faces, giving the IDs of the existing faces.
def SetNodeOnVertex
 Binds a node to a vertex.
def SetNodeOnEdge
 Stores the node position on an edge.
def SetNodeOnFace
 Stores node position on a face.
def SetNodeInVolume
 Binds a node to a solid.
def SetMeshElementOnShape
 Bind an element to a shape.
def MoveNode
 Moves the node with the given id.
def MoveClosestNodeToPoint
 Finds the node closest to a point and moves it to a point location.
def FindNodeClosestTo
 Finds the node closest to a point.
def FindElementsByPoint
 Finds the elements where a point lays IN or ON.
def GetPointState
def MeshToPassThroughAPoint
 Finds the node closest to a point and moves it to a point location.
def InverseDiag
 Replaces two neighbour triangles sharing Node1-Node2 link with the triangles built on the same 4 nodes but having other common link.
def DeleteDiag
 Replaces two neighbour triangles sharing Node1-Node2 link with a quadrangle built on the same 4 nodes.
def Reorient
 Reorients elements by ids.
def ReorientObject
 Reorients all elements of the object.
def TriToQuad
 Fuses the neighbouring triangles into quadrangles.
def TriToQuadObject
 Fuses the neighbouring triangles of the object into quadrangles.
def QuadToTri
 Splits quadrangles into triangles.
def QuadToTriObject
 Splits quadrangles into triangles.
def SplitQuad
 Splits quadrangles into triangles.
def SplitQuadObject
 Splits quadrangles into triangles.
def BestSplit
 Finds a better splitting of the given quadrangle.
def SplitVolumesIntoTetra
 Splits volumic elements into tetrahedrons.
def SplitQuadsNearTriangularFacets
 Splits quadrangle faces near triangular facets of volumes.
def SplitHexaToTetras
 Splits hexahedrons into tetrahedrons.
def SplitHexaToPrisms
 Split hexahedrons into prisms.
def Smooth
 Smoothes elements.
def SmoothObject
 Smoothes elements which belong to the given object.
def SmoothParametric
 Parametrically smoothes the given elements.
def SmoothParametricObject
 Parametrically smoothes the elements which belong to the given object.
def ConvertToQuadratic
 Converts the mesh to quadratic, deletes old elements, replacing them with quadratic with the same id.
def ConvertFromQuadratic
 Converts the mesh from quadratic to ordinary, deletes old quadratic elements,
replacing them with ordinary mesh elements with the same id.
def Make2DMeshFrom3D
 Creates 2D mesh as skin on boundary faces of a 3D mesh.
def MakeBoundaryMesh
 Creates missing boundary elements.
def MakeBoundaryElements
 Creates missing boundary elements around either the whole mesh or groups of 2D elements.
def RenumberNodes
 Renumber mesh nodes.
def RenumberElements
 Renumber mesh elements.
def RotationSweep
 Generates new elements by rotation of the elements around the axis.
def RotationSweepObject
 Generates new elements by rotation of the elements of object around the axis.
def RotationSweepObject1D
 Generates new elements by rotation of the elements of object around the axis.
def RotationSweepObject2D
 Generates new elements by rotation of the elements of object around the axis.
def ExtrusionSweep
 Generates new elements by extrusion of the elements with given ids.
def AdvancedExtrusion
 Generates new elements by extrusion of the elements with given ids.
def ExtrusionSweepObject
 Generates new elements by extrusion of the elements which belong to the object.
def ExtrusionSweepObject1D
 Generates new elements by extrusion of the elements which belong to the object.
def ExtrusionSweepObject2D
 Generates new elements by extrusion of the elements which belong to the object.
def ExtrusionAlongPathX
 Generates new elements by extrusion of the given elements The path of extrusion must be a meshed edge.
def ExtrusionAlongPath
 Generates new elements by extrusion of the given elements The path of extrusion must be a meshed edge.
def ExtrusionAlongPathObject
 Generates new elements by extrusion of the elements which belong to the object The path of extrusion must be a meshed edge.
def ExtrusionAlongPathObject1D
 Generates new elements by extrusion of the elements which belong to the object The path of extrusion must be a meshed edge.
def ExtrusionAlongPathObject2D
 Generates new elements by extrusion of the elements which belong to the object The path of extrusion must be a meshed edge.
def Mirror
 Creates a symmetrical copy of mesh elements.
def MirrorMakeMesh
 Creates a new mesh by a symmetrical copy of mesh elements.
def MirrorObject
 Creates a symmetrical copy of the object.
def MirrorObjectMakeMesh
 Creates a new mesh by a symmetrical copy of the object.
def Translate
 Translates the elements.
def TranslateMakeMesh
 Creates a new mesh of translated elements.
def TranslateObject
 Translates the object.
def TranslateObjectMakeMesh
 Creates a new mesh from the translated object.
def Scale
 Scales the object.
def ScaleMakeMesh
 Creates a new mesh from the translated object.
def Rotate
 Rotates the elements.
def RotateMakeMesh
 Creates a new mesh of rotated elements.
def RotateObject
 Rotates the object.
def RotateObjectMakeMesh
 Creates a new mesh from the rotated object.
def FindCoincidentNodes
 Finds groups of ajacent nodes within Tolerance.
def FindCoincidentNodesOnPart
 Finds groups of ajacent nodes within Tolerance.
def MergeNodes
 Merges nodes.
def FindEqualElements
 Finds the elements built on the same nodes.
def MergeElements
 Merges elements in each given group.
def MergeEqualElements
 Leaves one element and removes all other elements built on the same nodes.
def SewFreeBorders
 Sews free borders.
def SewConformFreeBorders
 Sews conform free borders.
def SewBorderToSide
 Sews border to side.
def SewSideElements
 Sews two sides of a mesh.
def ChangeElemNodes
 Sets new nodes for the given element.
def GetLastCreatedNodes
 If during the last operation of MeshEditor some nodes were created, this method returns the list of their IDs,
if new nodes were not created - returns empty list.
def GetLastCreatedElems
 If during the last operation of MeshEditor some elements were created this method returns the list of their IDs,
if new elements were not created - returns empty list.
def DoubleNodes
def DoubleNode
 Creates a hole in a mesh by doubling the nodes of some particular elements This method provided for convenience works as DoubleNodes() described above.
def DoubleNodeGroup
 Creates a hole in a mesh by doubling the nodes of some particular elements This method provided for convenience works as DoubleNodes() described above.
def DoubleNodeGroups
 Creates a hole in a mesh by doubling the nodes of some particular elements This method provided for convenience works as DoubleNodes() described above.
def DoubleNodeElem
 Creates a hole in a mesh by doubling the nodes of some particular elements.
def DoubleNodeElemInRegion
 Creates a hole in a mesh by doubling the nodes of some particular elements.
def DoubleNodeElemGroup
 Creates a hole in a mesh by doubling the nodes of some particular elements This method provided for convenience works as DoubleNodes() described above.
def DoubleNodeElemGroupInRegion
 Creates a hole in a mesh by doubling the nodes of some particular elements This method provided for convenience works as DoubleNodes() described above.
def DoubleNodeElemGroups
 Creates a hole in a mesh by doubling the nodes of some particular elements This method provided for convenience works as DoubleNodes() described above.
def DoubleNodeElemGroupsInRegion
 Creates a hole in a mesh by doubling the nodes of some particular elements This method provided for convenience works as DoubleNodes() described above.
def DoubleNodesOnGroupBoundaries
 Double nodes on shared faces between groups of volumes and create flat elements on demand.
def CreateFlatElementsOnFacesGroups
 Double nodes on some external faces and create flat elements.
def GetLength
 Get length of 1D element.
def GetArea
 Get area of 2D element.
def GetVolume
 Get volume of 3D element.
def GetMaxElementLength
 Get maximum element length.
def GetAspectRatio
 Get aspect ratio of 2D or 3D element.
def GetWarping
 Get warping angle of 2D element.
def GetMinimumAngle
 Get minimum angle of 2D element.
def GetTaper
 Get taper of 2D element.
def GetSkew
 Get skew of 2D element.

Public Attributes

 smeshpyD
 geompyD
 geom
 mesh
 editor

Static Public Attributes

int geom = 0
int mesh = 0
int editor = 0

Private Member Functions

def _groupTypeFromShape
 Pivate method to get a type of group on geometry.
def _valueFromFunctor

Detailed Description

This class allows defining and managing a mesh.

It has a set of methods to build a mesh on the given geometry, including the definition of sub-meshes. It also has methods to define groups of mesh elements, to modify a mesh (by addition of new nodes and elements and by changing the existing entities), to get information about a mesh and to export a mesh into different formats.

Definition at line 946 of file smeshDC.py.


Member Function Documentation

def smeshDC.Mesh._groupTypeFromShape (   self,
  shape 
) [private]

Pivate method to get a type of group on geometry.

Definition at line 1505 of file smeshDC.py.

01505 
01506     def _groupTypeFromShape( self, shape ):
01507         tgeo = str(shape.GetShapeType())
01508         if tgeo == "VERTEX":
01509             typ = NODE
01510         elif tgeo == "EDGE":
01511             typ = EDGE
01512         elif tgeo == "FACE" or tgeo == "SHELL":
01513             typ = FACE
01514         elif tgeo == "SOLID" or tgeo == "COMPSOLID":
01515             typ = VOLUME
01516         elif tgeo == "COMPOUND":
01517             sub = self.geompyD.SubShapeAll( shape, geompyDC.ShapeType["SHAPE"])
01518             if not sub:
01519                 raise ValueError,"_groupTypeFromShape(): empty geometric group or compound '%s'" % GetName(shape)
01520             return self._groupTypeFromShape( sub[0] )
01521         else:
01522             raise ValueError, \
01523                   "_groupTypeFromShape(): invalid geometry '%s'" % GetName(shape)
01524         return typ

Here is the call graph for this function:

Here is the caller graph for this function:

def smeshDC.Mesh._valueFromFunctor (   self,
  funcType,
  elemId 
) [private]

Definition at line 3941 of file smeshDC.py.

03941 
03942     def _valueFromFunctor(self, funcType, elemId):
03943         fn = self.smeshpyD.GetFunctor(funcType)
03944         fn.SetMesh(self.mesh)
03945         if fn.GetElementType() == self.GetElementType(elemId, True):
03946             val = fn.GetValue(elemId)
03947         else:
03948             val = 0
03949         return val

Here is the call graph for this function:

Here is the caller graph for this function:

def smeshDC.Mesh.BoundingBox (   self,
  objects = None,
  isElem = False 
)

Get bounding box of the specified object(s)

Parameters:
objectssingle source object or list of source objects or list of nodes/elements IDs
isElemif objects is a list of IDs, True value in this parameters specifies that objects are elements, False specifies that objects are nodes
Returns:
tuple of six values (minX, minY, minZ, maxX, maxY, maxZ)
See also:
GetBoundingBox()

Definition at line 2217 of file smeshDC.py.

02217 
02218     def BoundingBox(self, objects=None, isElem=False):
02219         result = self.GetBoundingBox(objects, isElem)
02220         if result is None:
02221             result = (0.0,)*6
02222         else:
02223             result = (result.minX, result.minY, result.minZ, result.maxX, result.maxY, result.maxZ)
02224         return result

Here is the call graph for this function:

def smeshDC.Mesh.CreateFlatElementsOnFacesGroups (   self,
  theGroupsOfFaces 
)

Double nodes on some external faces and create flat elements.

Flat elements are mainly used by some types of mechanic calculations.

Each group of the list must be constituted of faces. Triangles are transformed in prisms, and quadrangles in hexahedrons.

Parameters:
theGroupsOfFaces- list of groups of faces
Returns:
TRUE if operation has been completed successfully, FALSE otherwise

Definition at line 3938 of file smeshDC.py.

03938 
03939     def CreateFlatElementsOnFacesGroups(self, theGroupsOfFaces ):
03940         return self.editor.CreateFlatElementsOnFacesGroups( theGroupsOfFaces )

def smeshDC.Mesh.DoubleNodes (   self,
  theNodes,
  theModifiedElems 
)

Definition at line 3791 of file smeshDC.py.

03791 
03792     def DoubleNodes(self, theNodes, theModifiedElems):
03793         return self.editor.DoubleNodes(theNodes, theModifiedElems)

def smeshDC.Mesh.DoubleNodesOnGroupBoundaries (   self,
  theDomains,
  createJointElems 
)

Double nodes on shared faces between groups of volumes and create flat elements on demand.

The list of groups must describe a partition of the mesh volumes. The nodes of the internal faces at the boundaries of the groups are doubled. In option, the internal faces are replaced by flat elements. Triangles are transformed in prisms, and quadrangles in hexahedrons.

Parameters:
theDomains- list of groups of volumes
createJointElems- if TRUE, create the elements
Returns:
TRUE if operation has been completed successfully, FALSE otherwise

Definition at line 3928 of file smeshDC.py.

03928 
03929     def DoubleNodesOnGroupBoundaries(self, theDomains, createJointElems ):
03930        return self.editor.DoubleNodesOnGroupBoundaries( theDomains, createJointElems )

def smeshDC.Mesh.Evaluate (   self,
  geom = 0 
)

Evaluates size of prospective mesh on a shape.

Returns:
a list where i-th element is a number of elements of i-th SMESH.EntityType To know predicted number of e.g. edges, inquire it this way Evaluate()[ EnumToLong( Entity_Edge )]

Definition at line 1098 of file smeshDC.py.

01098 
01099     def Evaluate(self, geom=0):
01100         if geom == 0 or not isinstance(geom, geompyDC.GEOM._objref_GEOM_Object):
01101             if self.geom == 0:
01102                 geom = self.mesh.GetShapeToMesh()
01103             else:
01104                 geom = self.geom
01105         return self.smeshpyD.Evaluate(self.mesh, geom)
01106 

def smeshDC.Mesh.GetBoundingBox (   self,
  IDs = None,
  isElem = False 
)

Get measure structure specifying bounding box data of the specified object(s)

Parameters:
IDssingle source object or list of source objects or list of nodes/elements IDs
isElemif objects is a list of IDs, True value in this parameters specifies that objects are elements, False specifies that objects are nodes
Returns:
Measure structure
See also:
BoundingBox()

Definition at line 2231 of file smeshDC.py.

02231 
02232     def GetBoundingBox(self, IDs=None, isElem=False):
02233         if IDs is None:
02234             IDs = [self.mesh]
02235         elif isinstance(IDs, tuple):
02236             IDs = list(IDs)
02237         if not isinstance(IDs, list):
02238             IDs = [IDs]
02239         if len(IDs) > 0 and isinstance(IDs[0], int):
02240             IDs = [IDs]
02241         srclist = []
02242         for o in IDs:
02243             if isinstance(o, Mesh):
02244                 srclist.append(o.mesh)
02245             elif hasattr(o, "_narrow"):
02246                 src = o._narrow(SMESH.SMESH_IDSource)
02247                 if src: srclist.append(src)
02248                 pass
02249             elif isinstance(o, list):
02250                 if isElem:
02251                     srclist.append(self.editor.MakeIDSource(o, SMESH.FACE))
02252                 else:
02253                     srclist.append(self.editor.MakeIDSource(o, SMESH.NODE))
02254                 pass
02255             pass
02256         aMeasurements = self.smeshpyD.CreateMeasurements()
02257         aMeasure = aMeasurements.BoundingBox(srclist)
02258         aMeasurements.UnRegister()
02259         return aMeasure

Here is the caller graph for this function:

def smeshDC.Mesh.GetMinDistance (   self,
  id1,
  id2 = 0,
  isElem1 = False,
  isElem2 = False 
)

Get measure structure specifying minimum distance data between two objects.

Parameters:
id1first node/element id
id2second node/element id (if 0, distance from id1 to the origin is computed)
isElem1True if id1 is element id, False if it is node id
isElem2True if id2 is element id, False if it is node id
Returns:
Measure structure
See also:
MinDistance()

Definition at line 2192 of file smeshDC.py.

02192 
02193     def GetMinDistance(self, id1, id2=0, isElem1=False, isElem2=False):
02194         if isElem1:
02195             id1 = self.editor.MakeIDSource([id1], SMESH.FACE)
02196         else:
02197             id1 = self.editor.MakeIDSource([id1], SMESH.NODE)
02198         if id2 != 0:
02199             if isElem2:
02200                 id2 = self.editor.MakeIDSource([id2], SMESH.FACE)
02201             else:
02202                 id2 = self.editor.MakeIDSource([id2], SMESH.NODE)
02203             pass
02204         else:
02205             id2 = None
02206 
02207         aMeasurements = self.smeshpyD.CreateMeasurements()
02208         aMeasure = aMeasurements.MinDistance(id1, id2)
02209         aMeasurements.UnRegister()
02210         return aMeasure

Here is the caller graph for this function:

def smeshDC.Mesh.GetPointState (   self,
  x,
  y,
  z 
)

Definition at line 2497 of file smeshDC.py.

02497 
02498     def GetPointState(self, x, y, z):
02499         return self.editor.GetPointState(x, y, z)

def smeshDC.Mesh.Load (   self)

Loads mesh from the study after opening the study.

Definition at line 1051 of file smeshDC.py.

01051 
01052     def Load(self):
01053         self.mesh.Load()

def smeshDC.Mesh.MakeBoundaryElements (   self,
  dimension = SMESH.BND_2DFROM3D,
  groupName = "",
  meshName = "",
  toCopyAll = False,
  groups = [] 
)

Creates missing boundary elements around either the whole mesh or groups of 2D elements.

Parameters:
dimension- defines type of boundary elements to create
groupName- a name of group to store all boundary elements in, "" means not to create the group
meshName- a name of a new mesh, which is a copy of the initial mesh + created boundary elements; "" means not to create the new mesh
toCopyAll- if true, the whole initial mesh will be copied into the new mesh else only boundary elements will be copied into the new mesh
groups- groups of 2D elements to make boundary around
Return values:
tuple(long, mesh, groups ) long - number of added boundary elements mesh - the mesh where elements were added to group - the group of boundary elements or None

Definition at line 2930 of file smeshDC.py.

02930 
02931                              toCopyAll=False, groups=[]):
02932         nb, mesh, group = self.editor.MakeBoundaryElements(dimension,groupName,meshName,
02933                                                            toCopyAll,groups)
02934         if mesh: mesh = self.smeshpyD.Mesh(mesh)
02935         return nb, mesh, group

Here is the caller graph for this function:

def smeshDC.Mesh.MinDistance (   self,
  id1,
  id2 = 0,
  isElem1 = False,
  isElem2 = False 
)

Get minimum distance between two nodes, elements or distance to the origin.

Parameters:
id1first node/element id
id2second node/element id (if 0, distance from id1 to the origin is computed)
isElem1True if id1 is element id, False if it is node id
isElem2True if id2 is element id, False if it is node id
Returns:
minimum distance value
See also:
GetMinDistance()

Definition at line 2181 of file smeshDC.py.

02181 
02182     def MinDistance(self, id1, id2=0, isElem1=False, isElem2=False):
02183         aMeasure = self.GetMinDistance(id1, id2, isElem1, isElem2)
02184         return aMeasure.value

Here is the call graph for this function:

def smeshDC.Mesh.Scale (   self,
  theObject,
  thePoint,
  theScaleFact,
  Copy,
  MakeGroups = False 
)

Scales the object.

Parameters:
theObject- the object to translate (mesh, submesh, or group)
thePoint- base point for scale
theScaleFact- list of 1-3 scale factors for axises
Copy- allows copying the translated elements
MakeGroups- forces the generation of new groups from existing ones (if Copy)
Returns:
list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise

Definition at line 3556 of file smeshDC.py.

03556 
03557     def Scale(self, theObject, thePoint, theScaleFact, Copy, MakeGroups=False):
03558         if ( isinstance( theObject, Mesh )):
03559             theObject = theObject.GetMesh()
03560         if ( isinstance( theObject, list )):
03561             theObject = self.GetIDSource(theObject, SMESH.ALL)
03562 
03563         self.mesh.SetParameters(thePoint.parameters)
03564 
03565         if Copy and MakeGroups:
03566             return self.editor.ScaleMakeGroups(theObject, thePoint, theScaleFact)
03567         self.editor.Scale(theObject, thePoint, theScaleFact, Copy)
03568         return []

Here is the call graph for this function:

def smeshDC.Mesh.ScaleMakeMesh (   self,
  theObject,
  thePoint,
  theScaleFact,
  MakeGroups = False,
  NewMeshName = "" 
)

Creates a new mesh from the translated object.

Parameters:
theObject- the object to translate (mesh, submesh, or group)
thePoint- base point for scale
theScaleFact- list of 1-3 scale factors for axises
MakeGroups- forces the generation of new groups from existing ones
NewMeshName- the name of the newly created mesh
Returns:
instance of Mesh class

Definition at line 3576 of file smeshDC.py.

03576 
03577     def ScaleMakeMesh(self, theObject, thePoint, theScaleFact, MakeGroups=False, NewMeshName=""):
03578         if (isinstance(theObject, Mesh)):
03579             theObject = theObject.GetMesh()
03580         if ( isinstance( theObject, list )):
03581             theObject = self.GetIDSource(theObject,SMESH.ALL)
03582 
03583         self.mesh.SetParameters(thePoint.parameters)
03584         mesh = self.editor.ScaleMakeMesh(theObject, thePoint, theScaleFact,
03585                                          MakeGroups, NewMeshName)
03586         return Mesh( self.smeshpyD, self.geompyD, mesh )
03587 
03588 

Here is the call graph for this function:


Member Data Documentation

int smeshDC.Mesh.editor = 0 [static]

Definition at line 950 of file smeshDC.py.

Definition at line 993 of file smeshDC.py.

int smeshDC.Mesh.geom = 0 [static]

Definition at line 948 of file smeshDC.py.

Definition at line 969 of file smeshDC.py.

Definition at line 963 of file smeshDC.py.

int smeshDC.Mesh.mesh = 0 [static]

Definition at line 949 of file smeshDC.py.

Definition at line 979 of file smeshDC.py.

Definition at line 962 of file smeshDC.py.


The documentation for this class was generated from the following file: