11 .. py:class:: DriverMED_ReadStatus
13 Enumeration for mesh read status
15 .. py:attribute:: DRS_OK
19 .. py:attribute:: DRS_EMPTY
21 a file contains no mesh with the given name
23 .. py:attribute:: DRS_WARN_RENUMBER
25 a MED file has overlapped ranges of element numbers,
26 so the numbers from the file are ignored
28 .. py:attribute:: DRS_WARN_SKIP_ELEM
30 some elements were skipped due to incorrect file data
32 .. py:attribute:: DRS_WARN_DESCENDING
34 some elements were skipped due to descending connectivity
36 .. py:attribute:: DRS_FAIL
38 general failure (exception etc.)
43 .. py:class:: ComputeErrorName
45 Enumeration of computation errors
47 .. py:attribute:: COMPERR_OK
51 .. py:attribute:: COMPERR_BAD_INPUT_MESH
53 wrong mesh of lower sub-mesh
55 .. py:attribute:: COMPERR_STD_EXCEPTION
57 some std exception raised
59 .. py:attribute:: COMPERR_OCC_EXCEPTION
63 .. py:attribute:: COMPERR_SLM_EXCEPTION
65 SALOME exception raised
67 .. py:attribute:: COMPERR_EXCEPTION
69 other exception raised
71 .. py:attribute:: COMPERR_MEMORY_PB
73 memory allocation problem
75 .. py:attribute:: COMPERR_ALGO_FAILED
79 .. py:attribute:: COMPERR_BAD_SHAPE
83 .. py:attribute:: COMPERR_WARNING
85 algo reports error but sub-mesh is computed anyway
87 .. py:attribute:: COMPERR_CANCELED
91 .. py:attribute:: COMPERR_NO_MESH_ON_SHAPE
93 no mesh elements assigned to sub-mesh
95 .. py:attribute:: COMPERR_BAD_PARMETERS
97 incorrect hypotheses parameters
103 .. py:class:: ComputeError
107 .. py:attribute:: code
109 ``int`` - :class:`ComputeErrorName` or, if negative, algo specific code
111 .. py:attribute:: comment
113 ``str`` - textual problem description
115 .. py:attribute:: algoName
119 .. py:attribute:: subShapeID
121 ``int`` - id of sub-shape of a shape to mesh
123 .. py:attribute:: hasBadMesh
125 ``boolean`` - there are elements preventing computation available for visualization
130 .. py:class:: Measure
132 Data returned by measure operations
134 .. py:attribute:: minX, minY, minZ
136 ``double`` - coordinates of one point
138 .. py:attribute:: maxX, maxY, maxZ
140 ``double`` - coordinates of another point
142 .. py:attribute:: node1, node2
144 ``long`` - IDs of two nodes
146 .. py:attribute:: elem1, elem2
148 ``long`` - IDs of two elements
150 .. py:attribute:: value
152 ``double`` - distance
157 .. py:class:: NodePosition
159 Node location on a shape
161 .. py:attribute:: shapeID
163 ``long`` - ID of a shape
165 .. py:attribute:: shapeType
167 ``GEOM.shape_type`` - type of shape
169 .. py:attribute:: params
175 * [] on the rest shapes
180 .. py:class:: ElementPosition
182 Element location on a shape
184 .. py:attribute:: shapeID
186 ``long`` - ID of a shape
188 .. py:attribute:: shapeType
190 ``GEOM.shape_type`` - type of shape
195 .. py:class:: PolySegment
197 Define a cutting plane passing through two points.
198 Used in :meth:`~smeshBuilder.Mesh.MakePolyLine`
200 .. py:attribute:: node1ID1, node1ID2
202 ``int,int`` - *point 1*: if *node1ID2* > 0, then the point is in the middle of a face edge defined
203 by two nodes, else it is at *node1ID1*
205 .. py:attribute:: node2ID1, node2ID2
207 ``int,int`` - *point 2*: if *node2ID2* > 0, then the point is in the middle of a face edge defined
208 by two nodes, else it is at *node2ID1*
210 .. py:attribute:: vector
212 ``SMESH.DirStruct`` - vector on the plane; to use a default plane set vector = (0,0,0)
218 .. py:class:: ElementType
220 Enumeration for element type, like in SMDS
235 .. py:class:: EntityType
237 Enumeration of entity type
246 Entity_BiQuad_Triangle
248 Entity_Quad_Quadrangle
249 Entity_BiQuad_Quadrangle
262 Entity_Hexagonal_Prism
264 Entity_Quad_Polyhedra
271 .. py:class:: GeometryType
273 Enumeration of element geometry type
293 .. py:class:: Hypothesis_Status
295 Enumeration of result of hypothesis addition/removal
297 .. py:attribute:: HYP_OK
301 .. py:attribute:: HYP_MISSING
303 algo misses a hypothesis
305 .. py:attribute:: HYP_CONCURRENT
307 several applicable hypotheses
309 .. py:attribute:: HYP_BAD_PARAMETER
311 hypothesis has a bad parameter value
313 .. py:attribute:: HYP_HIDDEN_ALGO
315 an algo is hidden by an upper dim algo generating all-dim elements
317 .. py:attribute:: HYP_HIDING_ALGO
319 an algo hides lower dim algos by generating all-dim elements
321 .. py:attribute:: HYP_UNKNOWN_FATAL
323 all statuses below should be considered as fatal for Add/RemoveHypothesis operations
325 .. py:attribute:: HYP_INCOMPATIBLE
327 hypothesis does not fit algorithm
329 .. py:attribute:: HYP_NOTCONFORM
331 not conform mesh is produced applying a hypothesis
333 .. py:attribute:: HYP_ALREADY_EXIST
335 such hypothesis already exist
337 .. py:attribute:: HYP_BAD_DIM
341 .. py:attribute:: HYP_BAD_SUBSHAPE
343 shape is neither the main one, nor its sub-shape, nor a group
345 .. py:attribute:: HYP_BAD_GEOMETRY
347 geometry mismatches algorithm's expectation
349 .. py:attribute:: HYP_NEED_SHAPE
351 algorithm can work on shape only
353 .. py:attribute:: HYP_INCOMPAT_HYPS
355 several additional hypotheses are incompatible one with other
361 .. py:class:: FunctorType
363 Enumeration of functor types
374 FT_MaxElementLength2D
375 FT_MaxElementLength3D
389 FT_NodeConnectivityNumber
394 FT_BelongToGenSurface
400 FT_OverConstrainedVolume
401 FT_OverConstrainedFace
417 .. py:module:: SMESH.Filter
423 .. py:class:: Criterion
425 Structure containing information of a criterion
427 .. py:attribute:: Type
429 ``long`` - value of item of :class:`SMESH.FunctorType`
431 .. py:attribute:: Compare
433 ``long`` - value of item of :class:`SMESH.FunctorType` in ( FT_LessThan, FT_MoreThan, FT_EqualTo )
435 .. py:attribute:: Threshold
437 ``double`` - threshold value
439 .. py:attribute:: ThresholdStr
441 ``string`` - Threshold value defined as string. Used for:
442 1. Diapason of identifiers. Example: "1,2,3,5-10,12,27-29".
443 2. Storing name of shape.
444 3. Storing group color "0.2;0;0.5".
445 4. Storing point coordinates.
447 .. py:attribute:: ThresholdID
449 ``string`` - One more threshold value defined as string. Used for storing id of shape
451 .. py:attribute:: UnaryOp
453 ``long`` - unary logical operation: FT_LogicalNOT or FT_Undefined
455 .. py:attribute:: BinaryOp
457 ``long`` - binary logical operation FT_LogicalAND, FT_LogicalOR etc.
459 .. py:attribute:: Tolerance
461 ``double`` - Tolerance is used for
462 1. Comparison of real values.
463 2. Detection of geometrical coincidence.
465 .. py:attribute:: TypeOfElement
467 ``ElementType`` - type of element :class:`SMESH.ElementType` (SMESH.NODE, SMESH.FACE etc.)
469 .. py:attribute:: Precision
471 ``long`` - Precision of numerical functors
473 .. py:currentmodule:: SMESH
478 .. py:class:: FreeEdges.Border
480 Free edge: edge connected to one face only
482 .. py:attribute:: myElemId
484 ``long`` - ID of a face
486 .. py:attribute:: myPnt1,myPnt2
488 ``long`` - IDs of two nodes
493 .. py:class:: PointStruct
497 Use :meth:`GetPointStruct() <smeshBuilder.smeshBuilder.GetPointStruct>`
498 to convert a vertex (GEOM.GEOM_Object) to PointStruct
500 .. py:attribute:: x,y,z
502 ``double`` - point coordinates
507 .. py:class:: DirStruct
511 Use :meth:`GetDirStruct() <smeshBuilder.smeshBuilder.GetDirStruct>`
512 to convert a vector (GEOM.GEOM_Object) to DirStruct
516 :class:`PointStruct` - vector components
521 .. py:class:: AxisStruct
523 Axis defined by its origin and its vector.
525 Use :meth:`GetAxisStruct() <smeshBuilder.smeshBuilder.GetAxisStruct>`
526 to convert a line or plane (GEOM.GEOM_Object) to AxisStruct
528 .. py:attribute:: x,y,z
530 ``double`` - coordinates of the origin
532 .. py:attribute:: vx,vy,vz
534 ``double`` - components of the vector
541 Filter of mesh entities
543 .. py:function:: GetElementsId( mesh )
545 Return satisfying elements
547 :param SMESH.SMESH_Mesh mesh: the mesh;
548 it can be obtained via :meth:`~smeshBuilder.Mesh.GetMesh`
552 .. py:function:: GetIDs()
554 Return satisfying elements.
555 A mesh to filter must be already set, either via :meth:`SetMesh` method
556 or via ``mesh`` argument of :meth:`~smeshBuilder.smeshBuilder.GetFilter`
560 .. py:function:: SetMesh( mesh )
564 :param SMESH.SMESH_Mesh mesh: the mesh;
565 it can be obtained via :meth:`~smeshBuilder.Mesh.GetMesh`
567 .. py:function:: SetCriteria( criteria )
569 Define filtering criteria
571 :param criteria: list of :class:`SMESH.Filter.Criterion`
576 .. py:class:: NumericalFunctor
578 Calculate value by ID of mesh entity. Base class of various functors
580 .. py:function:: GetValue( elementID )
584 :param elementID: ID of element or node
585 :return: floating value
590 .. py:class:: SMESH_Mesh
592 Mesh. It is a Python wrap over a CORBA interface of mesh.
594 All its methods are exposed via :class:`smeshBuilder.Mesh` class that you can obtain by calling::
596 smeshBuilder_mesh = smesh.Mesh( smesh_mesh )
601 .. py:class:: SMESH_MeshEditor
603 Mesh editor. It is a Python wrap over a CORBA SMESH_MeshEditor interface.
604 All its methods are exposed via :class:`smeshBuilder.Mesh` class.
606 .. py:class:: Extrusion_Error
608 Enumeration of errors of :meth:`~smeshBuilder.Mesh.ExtrusionAlongPathObjects`
615 EXTR_BAD_STARTING_NODE
616 EXTR_BAD_ANGLES_NUMBER
617 EXTR_CANT_GET_TANGENT
619 .. py:class:: SMESH_MeshEditor.Sew_Error
621 Enumeration of errors of SMESH_MeshEditor.Sewing... methods
625 SEW_BORDER1_NOT_FOUND
626 SEW_BORDER2_NOT_FOUND
627 SEW_BOTH_BORDERS_NOT_FOUND
630 SEW_DIFF_NB_OF_ELEMENTS
631 SEW_TOPO_DIFF_SETS_OF_ELEMENTS
639 .. py:class:: SMESH_Pattern
641 Pattern mapper. Use a pattern defined by user for
643 * creating mesh elements on geometry, faces or blocks
644 * refining existing mesh elements, faces or hexahedra
646 The pattern is defined by a string as explained :doc:`here <pattern_mapping>`.
650 * Define a pattern via Load... method
651 * Compute future positions of nodes via Apply... method
652 * Create nodes and elements in a mesh via :meth:`MakeMesh` method
654 .. py:function:: LoadFromFile( patternFileContents )
656 Load a pattern from the string *patternFileContents*
658 :param str patternFileContents: string defining a pattern
659 :return: True if succeeded
661 .. py:function:: LoadFromFace( mesh, geomFace, toProject )
663 Create a 2D pattern from the mesh built on *geomFace*.
665 :param SMESH.SMESH_Mesh mesh: source mesh
666 :param GEOM.GEOM_Object geomFace: geometrical face whose mesh forms a pattern
667 :param boolean toProject: if True makes override nodes positions
668 on *geomFace* computed by mesher
669 :return: True if succeeded
671 .. py:function:: LoadFrom3DBlock( mesh, geomBlock )
673 Create a 3D pattern from the mesh built on *geomBlock*
675 :param SMESH.SMESH_Mesh mesh: source mesh
676 :param GEOM.GEOM_Object geomBlock: geometrical block whose mesh forms a pattern
677 :return: True if succeeded
679 .. py:function:: ApplyToFace( geomFace, vertexOnKeyPoint1, toReverse )
681 Compute nodes coordinates by applying
682 the loaded pattern to *geomFace*. The first key-point
683 will be mapped into *vertexOnKeyPoint1*, which must
684 be in the outer wire of *geomFace*
686 :param GEOM.GEOM_Object geomFace: the geometrical face to generate faces on
687 :param GEOM.GEOM_Object vertexOnKeyPoint1: the vertex to be at the 1st key-point
688 :param boolean toReverse: to reverse order of key-points
689 :return: list of :class:`SMESH.PointStruct` - computed coordinates of points of the pattern
691 .. py:function:: ApplyTo3DBlock( geomBlock, vertex000, vertex001 )
693 Compute nodes coordinates by applying
694 the loaded pattern to *geomBlock*. The (0,0,0) key-point
695 will be mapped into *vertex000*. The (0,0,1)
696 key-point will be mapped into *vertex001*.
698 :param GEOM.GEOM_Object geomBlock: the geometrical block to generate volume elements on
699 :param GEOM.GEOM_Object vertex000: the vertex to superpose (0,0,0) key-point of pattern
700 :param GEOM.GEOM_Object vertex001: the vertex to superpose (0,0,1) key-point of pattern
701 :return: list of :class:`SMESH.PointStruct` - computed coordinates of points of the pattern
703 .. py:function:: ApplyToMeshFaces( mesh, facesIDs, nodeIndexOnKeyPoint1, toReverse )
705 Compute nodes coordinates by applying
706 the loaded pattern to mesh faces. The first key-point
707 will be mapped into *nodeIndexOnKeyPoint1* -th node of each mesh face
709 :param SMESH.SMESH_Mesh mesh: the mesh where to refine faces
710 :param list_of_ids facesIDs: IDs of faces to refine
711 :param int nodeIndexOnKeyPoint1: index of a face node to be at 1-st key-point of pattern
712 :param boolean toReverse: to reverse order of key-points
713 :return: list of :class:`SMESH.PointStruct` - computed coordinates of points of the pattern
715 .. py:function:: ApplyToHexahedrons( mesh, volumesIDs, node000Index, node001Index )
717 Compute nodes coordinates by applying
718 the loaded pattern to hexahedra. The (0,0,0) key-point
719 will be mapped into *Node000Index* -th node of each volume.
720 The (0,0,1) key-point will be mapped into *node001Index* -th
723 :param SMESH.SMESH_Mesh mesh: the mesh where to refine hexahedra
724 :param list_of_ids volumesIDs: IDs of volumes to refine
725 :param long node000Index: index of a volume node to be at (0,0,0) key-point of pattern
726 :param long node001Index: index of a volume node to be at (0,0,1) key-point of pattern
727 :return: list of :class:`SMESH.PointStruct` - computed coordinates of points of the pattern
729 .. py:function:: MakeMesh( mesh, createPolygons, createPolyedrs )
731 Create nodes and elements in *mesh* using nodes
732 coordinates computed by either of Apply...() methods.
733 If *createPolygons* is True, replace adjacent faces by polygons
734 to keep mesh conformity.
735 If *createPolyedrs* is True, replace adjacent volumes by polyedrs
736 to keep mesh conformity.
738 :param SMESH.SMESH_Mesh mesh: the mesh to create nodes and elements in
739 :param boolean createPolygons: to create polygons to to keep mesh conformity
740 :param boolean createPolyedrs: to create polyherda to to keep mesh conformity
741 :return: True if succeeded
747 .. py:class:: SMESH_subMesh
749 :doc:`Sub-mesh <constructing_submeshes>`
751 .. py:function:: GetNumberOfElements()
753 Return number of elements in the sub-mesh
755 .. py:function:: GetNumberOfNodes( all )
757 Return number of nodes in the sub-mesh
759 :param boolean all: if True, also return nodes assigned to boundary sub-meshes
761 .. py:function:: GetElementsId()
763 Return IDs of elements in the sub-mesh
765 .. py:function:: GetNodesId()
767 Return IDs of nodes in the sub-mesh
769 .. py:function:: GetSubShape()
771 Return :class:`geom shape <GEOM.GEOM_Object>` the sub-mesh is dedicated to
773 .. py:function:: GetId()
775 Return ID of the :class:`geom shape <GEOM.GEOM_Object>` the sub-mesh is dedicated to
777 .. py:function:: GetMeshInfo()
779 Return number of mesh elements of each :class:`SMESH.EntityType`.
780 Use :meth:`~smeshBuilder.smeshBuilder.EnumToLong` to get an integer from
781 an item of :class:`SMESH.EntityType`.
783 :return: array of number of elements per :class:`SMESH.EntityType`
785 .. py:function:: GetMesh()
787 Return the :class:`SMESH.SMESH_Mesh`
792 .. py:class:: SMESH_GroupBase
794 :doc:`Mesh group <grouping_elements>`.
795 Base class of :class:`standalone group <SMESH_Group>`,
796 :class:`group on geometry <SMESH_GroupOnGeom>` and
797 :class:`group on filter <SMESH_GroupOnFilter>`.
798 Inherit all methods from :class:`SMESH_IDSource`.
800 .. py:function:: SetName( name )
804 .. py:function:: GetName()
808 .. py:function:: GetType()
810 Return :class:`group type <SMESH.ElementType>` (type of elements in the group)
812 .. py:function:: Size()
814 Return the number of elements in the group
816 .. py:function:: IsEmpty()
818 Return True if the group does not contain any elements
820 .. py:function:: Contains( elem_id )
822 Return True if the group contains an element with ID == *elem_id*
824 .. py:function:: GetID( elem_index )
826 Return ID of an element at position *elem_index* counted from 1
828 .. py:function:: GetNumberOfNodes()
830 Return the number of nodes of cells included to the group.
831 For a nodal group return the same value as Size() function
833 .. py:function:: GetNodeIDs()
835 Return IDs of nodes of cells included to the group.
836 For a nodal group return result of GetListOfID() function
838 .. py:function:: SetColor( color )
842 :param SALOMEDS.Color color: color
844 .. py:function:: GetColor()
848 :return: SALOMEDS.Color
853 .. py:class:: SMESH_Group
855 :doc:`Standalone mesh group <grouping_elements>`. Inherits all methods of :class:`SMESH.SMESH_GroupBase`
857 .. py:function:: Clear()
859 Clears the group's contents
861 .. py:function:: Add( elem_ids )
863 Adds elements or nodes with specified identifiers to the group
865 :param list_of_ids elem_ids: IDs to add
867 .. py:function:: AddFrom( idSource )
869 Add all elements or nodes from the specified source to the group
871 :param SMESH.SMESH_IDSource idSource: an object to retrieve IDs from
873 .. py:function:: Remove( elem_ids )
875 Removes elements or nodes with specified identifiers from the group
877 :param list_of_ids elem_ids: IDs to remove
882 .. py:class:: SMESH_GroupOnGeom
884 Group linked to geometry. Inherits all methods of :class:`SMESH.SMESH_GroupBase`
886 .. py:function:: GetShape()
888 Return an associated geometry
890 :return: GEOM.GEOM_Object
895 .. py:class:: SMESH_GroupOnFilter
897 Group defined by filter. Inherits all methods of :class:`SMESH.SMESH_GroupBase`
899 .. py:function:: SetFilter( filter )
901 Set the :class:`filter <SMESH.Filter>`
903 .. py:function:: GetFilter()
905 Return the :class:`filter <SMESH.Filter>`
911 .. py:class:: SMESH_IDSource
913 Base class for classes able to return IDs of mesh entities. These classes are:
915 * :class:`SMESH.SMESH_Mesh`
916 * :class:`SMESH.SMESH_subMesh`
917 * :class:`SMESH.SMESH_GroupBase`
918 * :class:`SMESH.Filter`
919 * temporal ID source created by :meth:`~smeshBuilder.Mesh.GetIDSource`
921 .. py:function:: GetIDs()
923 Return a sequence of all element IDs
925 .. py:function:: GetMeshInfo()
927 Return number of mesh elements of each :class:`SMESH.EntityType`.
928 Use :meth:`~smeshBuilder.smeshBuilder.EnumToLong` to get an integer from
929 an item of :class:`SMESH.EntityType`.
931 .. py:function:: GetNbElementsByType()
933 Return number of mesh elements of each :class:`SMESH.ElementType`.
934 Use :meth:`~smeshBuilder.smeshBuilder.EnumToLong` to get an integer from
935 an item of :class:`SMESH.ElementType`.
938 .. py:function:: GetTypes()
940 Return types of elements it contains.
941 It's empty if the object contains no IDs
943 :return: list of :class:`SMESH.ElementType`
945 .. py:function:: GetMesh()
947 Return the :class:`SMESH.SMESH_Mesh`
952 .. py:class:: SMESH_Hypothesis
954 Base class of all :doc:`hypotheses <about_hypo>`
956 .. py:function:: GetName()
958 Return string of hypothesis type name, something like "Regular_1D"
960 .. py:function:: GetLibName()
962 Return string of plugin library name