Salome HOME
0022104: EDF 2550 SMESH: 2D viscous layer, allow specifying edges with viscous layer
authoreap <eap@opencascade.com>
Thu, 30 May 2013 14:18:23 +0000 (14:18 +0000)
committereap <eap@opencascade.com>
Thu, 30 May 2013 14:18:23 +0000 (14:18 +0000)
-    def ViscousLayers2D(self, thickness, numberOfLayers, stretchFactor, ignoreEdges=[]):
+    def ViscousLayers2D(self, thickness, numberOfLayers, stretchFactor,
+                        edges=[], isEdgesToIgnore=True ):

src/SMESH_SWIG/smesh_algorithm.py

index 6dc35e6b28fcb875897d737332e4c2b11096620c..a81f825a6ac4ebd2440f3d079bb63423a13a8340 100644 (file)
@@ -290,21 +290,27 @@ class Mesh_Algorithm:
     #  @param thickness total thickness of layers of quadrilaterals
     #  @param numberOfLayers number of layers
     #  @param stretchFactor factor (>1.0) of growth of layer thickness towards inside of mesh
-    #  @param ignoreEdges list of geometrical edge (or their ids) not to generate layers on
+    #  @param edges list of geometrical edge (or their ids).
+    #         Viscous layers are either generated on these edges or not, depending on
+    #         the values of \a isEdgesToIgnore parameter.
+    #  @param isEdgesToIgnore if \c True, the Viscous layers are not generated on the
+    #         edges specified by the previous parameter (\a edges).
     #  @ingroup l3_hypos_additi
-    def ViscousLayers2D(self, thickness, numberOfLayers, stretchFactor, ignoreEdges=[]):
+    def ViscousLayers2D(self, thickness, numberOfLayers, stretchFactor,
+                        edges=[], isEdgesToIgnore=True ):
         if not isinstance(self.algo, SMESH._objref_SMESH_2D_Algo):
             raise TypeError, "ViscousLayers2D are supported by 2D algorithms only"
         if not "ViscousLayers2D" in self.GetCompatibleHypothesis():
             raise TypeError, "ViscousLayers2D are not supported by %s"%self.algo.GetName()
-        if ignoreEdges and isinstance( ignoreEdges[0], geomBuilder.GEOM._objref_GEOM_Object ):
-            ignoreEdges = [ self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f) for f in ignoreEdges ]
+        if edges and isinstance( edges[0], geomBuilder.GEOM._objref_GEOM_Object ):
+            edges = [ self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f) for f in edges ]
         hyp = self.Hypothesis("ViscousLayers2D",
-                              [thickness, numberOfLayers, stretchFactor, ignoreEdges])
+                              [thickness, numberOfLayers, stretchFactor,
+                               edges, isEdgesToIgnore])
         hyp.SetTotalThickness(thickness)
         hyp.SetNumberLayers(numberOfLayers)
         hyp.SetStretchFactor(stretchFactor)
-        hyp.SetIgnoreEdges(ignoreEdges)
+        hyp.SetEdges(edges, isEdgesToIgnore)
         return hyp
 
     ## Transform a list of ether edges or tuples (edge, 1st_vertex_of_edge)