Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/smesh.git] / doc / salome / gui / SMESH / input / tui_cartesian_algo.doc
1 /*!
2
3 \page tui_cartesian_algo Usage of Body Fitting algorithm
4
5 \code
6 from smesh import *
7 SetCurrentStudy(salome.myStudy)
8
9 # create a sphere
10 sphere = geompy.MakeSphereR( 50 )
11 geompy.addToStudy( sphere, "sphere" )
12
13 # create a mesh and assign a "Body Fitting" algo
14 mesh = Mesh( sphere )
15 cartAlgo = mesh.BodyFitted()
16
17 # define a cartesian grid using Coordinates
18 coords = range(-100,100,10)
19 cartHyp = cartAlgo.SetGrid( coords,coords,coords, 1000000)
20
21 # compute the mesh
22 mesh.Compute()
23 print "nb hexahedra",mesh.NbHexas()
24 print "nb tetrahedra",mesh.NbTetras()
25 print "nb polyhedra",mesh.NbPolyhedrons()
26 print
27
28 # define the grid by sitting constant spacing
29 cartHyp = cartAlgo.SetGrid( "10","10","10", 1000000)
30
31 mesh.Compute()
32 print "nb hexahedra",mesh.NbHexas()
33 print "nb tetrahedra",mesh.NbTetras()
34 print "nb polyhedra",mesh.NbPolyhedrons()
35
36
37 # define the grid by sitting different spacing in 2 sub-ranges of geometry
38 spaceFuns = ["5","10+10*t"]
39 cartAlgo.SetGrid( [spaceFuns, [0.5]], [spaceFuns, [0.5]], [spaceFuns, [0.25]], 2 )
40
41 mesh.Compute()
42 print "nb hexahedra",mesh.NbHexas()
43 print "nb tetrahedra",mesh.NbTetras()
44 print "nb polyhedra",mesh.NbPolyhedrons()
45 print
46
47 \endcode
48
49 */