Salome HOME
Merge from V6_main 19/03/2013
[modules/smesh.git] / doc / salome / examples / defining_hypotheses_ex17.py
1 # Viscous layers construction
2
3 from smesh import *
4 SetCurrentStudy(salome.myStudy)
5
6 X = geompy.MakeVectorDXDYDZ( 1,0,0 )
7 O = geompy.MakeVertex( 100,50,50 )
8 plane = geompy.MakePlane( O, X, 200 ) # plane YZ
9
10 box = geompy.MakeBoxDXDYDZ(200,100,100)
11
12 shape = geompy.MakeHalfPartition( box, plane )
13
14 faces = geompy.SubShapeAllSorted(shape, geompy.ShapeType["FACE"])
15 face1 = faces[1]
16 ignoreFaces = [ faces[0], faces[-1]]
17
18 geompy.addToStudy( shape, "shape" )
19 geompy.addToStudyInFather( shape, face1, "face1")
20
21
22 mesh = Mesh(shape, "CFD")
23
24 mesh.Segment().NumberOfSegments( 4 )
25
26 mesh.Triangle()
27 mesh.Quadrangle(face1)
28 mesh.Compute()
29 algo3D = mesh.Tetrahedron()
30
31 thickness = 20
32 numberOfLayers = 10
33 stretchFactor = 1.5
34 layersHyp = algo3D.ViscousLayers(thickness,numberOfLayers,stretchFactor,ignoreFaces)
35
36 mesh.Compute()
37
38 mesh.MakeGroup("Tetras",VOLUME,FT_ElemGeomType,"=",Geom_TETRA)
39 mesh.MakeGroup("Pyras",VOLUME,FT_ElemGeomType,"=",Geom_PYRAMID)
40 mesh.MakeGroup("Prims",VOLUME,FT_ElemGeomType,"=",Geom_PENTA)