+ [thickness, numberOfLayers, stretchFactor, faces, isFacesToIgnore],
+ toAdd=False)
+ hyp.SetTotalThickness( thickness )
+ hyp.SetNumberLayers( numberOfLayers )
+ hyp.SetStretchFactor( stretchFactor )
+ hyp.SetFaces( faces, isFacesToIgnore )
+ hyp.SetMethod( extrMethod )
+ hyp.SetGroupName( groupName )
+ self.mesh.AddHypothesis( hyp, self.geom )
+ return hyp
+
+ def ViscousLayers2D(self, thickness, numberOfLayers, stretchFactor,
+ edges=[], isEdgesToIgnore=True, groupName="" ):
+ """
+ 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, MG-CADSurf
+
+ Parameters:
+ thickness: total thickness of layers of quadrilaterals
+ numberOfLayers: number of layers
+ stretchFactor: factor (>1.0) of growth of layer thickness towards inside of mesh
+ edges: list of geometrical edges (or their ids).
+ Viscous layers are either generated on these edges or not, depending on
+ the value of **isEdgesToIgnore** parameter.
+ isEdgesToIgnore: if *True*, the Viscous layers are not generated on the
+ edges specified by the previous parameter (**edges**).
+ groupName: name of a group to contain elements of layers. If not provided,
+ no group is created. The group is created upon mesh generation.
+ It can be retrieved by calling
+ ::
+
+ group = mesh.GetGroupByName( groupName, SMESH.FACE )[0]
+
+ Returns:
+ StdMeshers.StdMeshers_ViscousLayers2D hypothesis
+ """
+
+ 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 edges and not isinstance( edges, list ) and not isinstance( edges, tuple ):
+ edges = [edges]
+ if edges and isinstance( edges[0], geomBuilder.GEOM._objref_GEOM_Object ):
+ edgeIDs = []
+ for shape in edges:
+ ee = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["EDGE"])
+ for e in ee:
+ edgeIDs.append( self.mesh.geompyD.GetSubShapeID( self.mesh.geom, e ))
+ edges = edgeIDs
+ hyp = self.Hypothesis("ViscousLayers2D",
+ [thickness, numberOfLayers, stretchFactor, edges, isEdgesToIgnore],
+ toAdd=False)