X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Fdefining_hypotheses_ex17.py;fp=doc%2Fsalome%2Fexamples%2Fdefining_hypotheses_ex17.py;h=cadd71e24b0af4b1845677b98dc14820ee67e8d0;hp=f2b7d8c20f4f21207ef87ac3a0e2c92ddcb80820;hb=70eb9c09d00f9c4b0e48d5aba70676e45e779f9c;hpb=bda71f4197e589fab8b784abb636a993ff6aa808 diff --git a/doc/salome/examples/defining_hypotheses_ex17.py b/doc/salome/examples/defining_hypotheses_ex17.py index f2b7d8c20..cadd71e24 100644 --- a/doc/salome/examples/defining_hypotheses_ex17.py +++ b/doc/salome/examples/defining_hypotheses_ex17.py @@ -33,16 +33,22 @@ mesh.Segment().NumberOfSegments( 4 ) mesh.Triangle() mesh.Quadrangle(face1) -mesh.Compute() algo3D = mesh.Tetrahedron() thickness = 20 numberOfLayers = 10 stretchFactor = 1.5 -layersHyp = algo3D.ViscousLayers(thickness,numberOfLayers,stretchFactor,ignoreFaces) +groupName = "Boundary layers" +layersHyp = algo3D.ViscousLayers(thickness,numberOfLayers,stretchFactor, + ignoreFaces, # optional + groupName = groupName) # optional mesh.Compute() +# retrieve boundary prisms created by mesh.Compute() +boundaryGroup = mesh.GetGroupByName( layersHyp.GetGroupName() )[0] +print( "Nb boundary prisms", boundaryGroup.Size() ) + mesh.MakeGroup("Tetras",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_TETRA) mesh.MakeGroup("Pyras",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_PYRAMID) mesh.MakeGroup("Prims",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_PENTA) @@ -55,12 +61,17 @@ edgeIds = geompy.SubShapeAllIDs( face1, geompy.ShapeType["EDGE"])[:-1] mesh = smesh.Mesh(face1,"VicsousLayers2D") mesh.Segment().NumberOfSegments( 5 ) -# viscous layers should be created on 1 edge, as we set 3 edges to ignore -vlHyp = mesh.Triangle().ViscousLayers2D( 2, 3, 1.5, edgeIds, isEdgesToIgnore=True ) - +# viscous layers will be created on 1 edge, as we set 3 edges to ignore +vlHyp = mesh.Triangle().ViscousLayers2D( 2, 3, 1.5, + edgeIds, isEdgesToIgnore=True, # optional + groupName=groupName) # optional mesh.Compute() -# viscous layers should be created on 3 edges, as we pass isEdgesToIgnore=False +# retrieve boundary elements created by mesh.Compute() +quadrangles = mesh.GetGroupByName( vlHyp.GetGroupName() )[0] +print( "Nb boundary quadrangles", quadrangles.Size() ) + +# viscous layers will be created on 3 edges, as we pass isEdgesToIgnore=False vlHyp.SetEdges( edgeIds, False ) mesh.Compute()