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