From: eap Date: Thu, 30 May 2013 14:18:23 +0000 (+0000) Subject: 0022104: EDF 2550 SMESH: 2D viscous layer, allow specifying edges with viscous layer X-Git-Tag: V7_3_0a1~373 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9f9b06a194271d43220cd95176b689b471dc7189;p=modules%2Fsmesh.git 0022104: EDF 2550 SMESH: 2D viscous layer, allow specifying edges with viscous layer - def ViscousLayers2D(self, thickness, numberOfLayers, stretchFactor, ignoreEdges=[]): + def ViscousLayers2D(self, thickness, numberOfLayers, stretchFactor, + edges=[], isEdgesToIgnore=True ): --- diff --git a/src/SMESH_SWIG/smesh_algorithm.py b/src/SMESH_SWIG/smesh_algorithm.py index 6dc35e6b2..a81f825a6 100644 --- a/src/SMESH_SWIG/smesh_algorithm.py +++ b/src/SMESH_SWIG/smesh_algorithm.py @@ -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)