Salome HOME
Add new method DoubleNodeElemGroupsNew which allows to have the group of newly create...
[modules/smesh.git] / src / SMESH_SWIG / smeshDC.py
index 3e52108c653cc8a1f550b5125cf9913cef07f1c3..5fa6cc4b40f59bc61106a5f7a94b1b55142937eb 100644 (file)
@@ -3139,7 +3139,8 @@ class Mesh:
         return []
 
     ## Generates new elements by rotation of the elements of object around the axis
-    #  @param theObject object which elements should be sweeped
+    #  @param theObject object which elements should be sweeped.
+    #                   It can be a mesh, a sub mesh or a group.
     #  @param Axis the axis of rotation, AxisStruct or line(geom object)
     #  @param AngleInRadians the angle of Rotation
     #  @param NbOfSteps number of steps
@@ -3174,7 +3175,8 @@ class Mesh:
         return []
 
     ## Generates new elements by rotation of the elements of object around the axis
-    #  @param theObject object which elements should be sweeped
+    #  @param theObject object which elements should be sweeped.
+    #                   It can be a mesh, a sub mesh or a group.
     #  @param Axis the axis of rotation, AxisStruct or line(geom object)
     #  @param AngleInRadians the angle of Rotation
     #  @param NbOfSteps number of steps
@@ -3209,7 +3211,8 @@ class Mesh:
         return []
 
     ## Generates new elements by rotation of the elements of object around the axis
-    #  @param theObject object which elements should be sweeped
+    #  @param theObject object which elements should be sweeped.
+    #                   It can be a mesh, a sub mesh or a group.
     #  @param Axis the axis of rotation, AxisStruct or line(geom object)
     #  @param AngleInRadians the angle of Rotation
     #  @param NbOfSteps number of steps
@@ -3286,7 +3289,8 @@ class Mesh:
         return []
 
     ## Generates new elements by extrusion of the elements which belong to the object
-    #  @param theObject the object which elements should be processed
+    #  @param theObject the object which elements should be processed.
+    #                   It can be a mesh, a sub mesh or a group.
     #  @param StepVector vector, defining the direction and value of extrusion
     #  @param NbOfSteps the number of steps
     #  @param MakeGroups forces the generation of new groups from existing ones
@@ -3307,7 +3311,8 @@ class Mesh:
         return []
 
     ## Generates new elements by extrusion of the elements which belong to the object
-    #  @param theObject object which elements should be processed
+    #  @param theObject object which elements should be processed.
+    #                   It can be a mesh, a sub mesh or a group.
     #  @param StepVector vector, defining the direction and value of extrusion
     #  @param NbOfSteps the number of steps
     #  @param MakeGroups to generate new groups from existing ones
@@ -3328,7 +3333,8 @@ class Mesh:
         return []
 
     ## Generates new elements by extrusion of the elements which belong to the object
-    #  @param theObject object which elements should be processed
+    #  @param theObject object which elements should be processed.
+    #                   It can be a mesh, a sub mesh or a group.
     #  @param StepVector vector, defining the direction and value of extrusion
     #  @param NbOfSteps the number of steps
     #  @param MakeGroups forces the generation of new groups from existing ones
@@ -3352,7 +3358,7 @@ class Mesh:
 
     ## Generates new elements by extrusion of the given elements
     #  The path of extrusion must be a meshed edge.
-    #  @param Base mesh or list of ids of elements for extrusion
+    #  @param Base mesh or group, or submesh, or list of ids of elements for extrusion
     #  @param Path - 1D mesh or 1D sub-mesh, along which proceeds the extrusion
     #  @param NodeStart the start node from Path. Defines the direction of extrusion
     #  @param HasAngles allows the shape to be rotated around the path
@@ -3379,8 +3385,7 @@ class Mesh:
         Parameters = AnglesParameters + var_separator + RefPointParameters
         self.mesh.SetParameters(Parameters)
 
-        if (isinstance(Path, Mesh)):
-            Path = Path.GetMesh()
+        if (isinstance(Path, Mesh)): Path = Path.GetMesh()
 
         if isinstance(Base, list):
             IDsOfElements = []
@@ -3443,7 +3448,8 @@ class Mesh:
 
     ## Generates new elements by extrusion of the elements which belong to the object
     #  The path of extrusion must be a meshed edge.
-    #  @param theObject the object which elements should be processed
+    #  @param theObject the object which elements should be processed.
+    #                   It can be a mesh, a sub mesh or a group.
     #  @param PathMesh mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
     #  @param PathShape shape(edge) defines the sub-mesh for the path
     #  @param NodeStart the first or the last node on the edge. Defines the direction of extrusion
@@ -3485,7 +3491,8 @@ class Mesh:
 
     ## Generates new elements by extrusion of the elements which belong to the object
     #  The path of extrusion must be a meshed edge.
-    #  @param theObject the object which elements should be processed
+    #  @param theObject the object which elements should be processed.
+    #                   It can be a mesh, a sub mesh or a group.
     #  @param PathMesh mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
     #  @param PathShape shape(edge) defines the sub-mesh for the path
     #  @param NodeStart the first or the last node on the edge. Defines the direction of extrusion
@@ -3527,7 +3534,8 @@ class Mesh:
 
     ## Generates new elements by extrusion of the elements which belong to the object
     #  The path of extrusion must be a meshed edge.
-    #  @param theObject the object which elements should be processed
+    #  @param theObject the object which elements should be processed.
+    #                   It can be a mesh, a sub mesh or a group.
     #  @param PathMesh mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
     #  @param PathShape shape(edge) defines the sub-mesh for the path
     #  @param NodeStart the first or the last node on the edge. Defines the direction of extrusion
@@ -4056,6 +4064,8 @@ class Mesh:
     #  @param theAffectedElems - group of elements to which the replicated nodes
     #         should be associated to.
     #  @param theMakeGroup forces the generation of a group containing new elements.
+    #  @return TRUE or a created group if operation has been completed successfully,
+    #          FALSE or None otherwise
     #  @ingroup l2_modif_edit
     def DoubleNodeElemGroup(self, theElems, theNodesNot, theAffectedElems, theMakeGroup=False):
         if theMakeGroup:
@@ -4079,9 +4089,13 @@ class Mesh:
     #  @param theNodesNot - list of groups of nodes not to replicated
     #  @param theAffectedElems - group of elements to which the replicated nodes
     #         should be associated to.
-    #  @return TRUE if operation has been completed successfully, FALSE otherwise
+    #  @param theMakeGroup forces the generation of a group containing new elements.
+    #  @return TRUE or a created group if operation has been completed successfully,
+    #          FALSE or None otherwise
     #  @ingroup l2_modif_edit
-    def DoubleNodeElemGroups(self, theElems, theNodesNot, theAffectedElems):
+    def DoubleNodeElemGroups(self, theElems, theNodesNot, theAffectedElems, theMakeGroup=False):
+        if theMakeGroup:
+            return self.editor.DoubleNodeElemGroupsNew(theElems, theNodesNot, theAffectedElems)
         return self.editor.DoubleNodeElemGroups(theElems, theNodesNot, theAffectedElems)
 
     ## Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -4395,6 +4409,29 @@ class Mesh_Algorithm:
         if not entry: return ""
         return entry
 
+    ## Defines "ViscousLayers" hypothesis to give parameters of layers of prisms to build
+    #  near mesh boundary. This hypothesis can be used by several 3D algorithms:
+    #  NETGEN 3D, GHS3D, Hexahedron(i,j,k)
+    #  @param thickness total thickness of layers of prisms
+    #  @param numberOfLayers number of layers of prisms
+    #  @param stretchFactor factor (>1.0) of growth of layer thickness towards inside of mesh
+    #  @param ignoreFaces geometrical face (or their ids) not to generate layers on
+    #  @ingroup l3_hypos_additi
+    def ViscousLayers(self, thickness, numberOfLayers, stretchFactor, ignoreFaces=[]):
+        if not isinstance(self.algo, SMESH._objref_SMESH_3D_Algo):
+            raise TypeError, "ViscousLayers are supported by 3D algorithms only"
+        if not "ViscousLayers" in self.GetCompatibleHypothesis():
+            raise TypeError, "ViscousLayers are not supported by %s"%self.algo.GetName()
+        if ignoreFaces and isinstance( ignoreFaces[0], geompyDC.GEOM._objref_GEOM_Object ):
+            ignoreFaces = [ self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f) for f in ignoreFaces ]
+        hyp = self.Hypothesis("ViscousLayers",
+                              [thickness, numberOfLayers, stretchFactor, ignoreFaces])
+        hyp.SetTotalThickness(thickness)
+        hyp.SetNumberLayers(numberOfLayers)
+        hyp.SetStretchFactor(stretchFactor)
+        hyp.SetIgnoreFaces(ignoreFaces)
+        return hyp
+
 # Public class: Mesh_Segment
 # --------------------------