X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_SWIG%2Fsmesh_algorithm.py;h=9b3acf00d61b45b9a20cbdbdef80aceb522d8927;hp=dfeaba4fb7da741e3d39b1b8d1054d87ea9d8c97;hb=1067ffa6e7e5c394e3a1b17219d8b355a57607cd;hpb=f5016d85b7b4b88623723027a1585c6414c4dc66 diff --git a/src/SMESH_SWIG/smesh_algorithm.py b/src/SMESH_SWIG/smesh_algorithm.py index dfeaba4fb..9b3acf00d 100644 --- a/src/SMESH_SWIG/smesh_algorithm.py +++ b/src/SMESH_SWIG/smesh_algorithm.py @@ -195,7 +195,7 @@ class Mesh_Algorithm: raise RuntimeError, "Attemp to create " + algo + " algoritm on None shape" self.mesh = mesh name = "" - if not geom: + if not geom or geom.IsSame( mesh.geom ): self.geom = mesh.geom else: self.geom = geom @@ -283,6 +283,29 @@ class Mesh_Algorithm: hyp.SetIgnoreFaces(ignoreFaces) return hyp + ## Defines "ViscousLayers2D" hypothesis to give parameters of layers of quadrilateral + # elements to build near mesh boundary. This hypothesis can be used by several 2D algorithms: + # NETGEN 2D, NETGEN 1D-2D, Quadrangle (mapping), MEFISTO, BLSURF + # @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 + # @ingroup l3_hypos_additi + def ViscousLayers2D(self, thickness, numberOfLayers, stretchFactor, ignoreEdges=[]): + 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], geompyDC.GEOM._objref_GEOM_Object ): + ignoreEdges = [ self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f) for f in ignoreEdges ] + hyp = self.Hypothesis("ViscousLayers2D", + [thickness, numberOfLayers, stretchFactor, ignoreEdges]) + hyp.SetTotalThickness(thickness) + hyp.SetNumberLayers(numberOfLayers) + hyp.SetStretchFactor(stretchFactor) + hyp.SetIgnoreEdges(ignoreEdges) + return hyp + ## Transform a list of ether edges or tuples (edge, 1st_vertex_of_edge) # into a list acceptable to SetReversedEdges() of some 1D hypotheses # @ingroup l3_hypos_1dhyps