7 from salome.geom
import geomBuilder
8 geompy = geomBuilder.New(salome.myStudy)
10 import SMESH, SALOMEDS
11 from salome.smesh
import smeshBuilder
12 smesh = smeshBuilder.New(salome.myStudy)
13 import salome_notebook
17 sphere = geompy.MakeSphereR( 50 )
18 geompy.addToStudy( sphere,
"sphere" )
21 mesh = smesh.Mesh( sphere )
22 cartAlgo = mesh.BodyFitted()
25 coords = range(-100,100,10)
26 cartHyp = cartAlgo.SetGrid( coords,coords,coords, 1000000)
30 print "nb hexahedra",mesh.NbHexas()
31 print "nb tetrahedra",mesh.NbTetras()
32 print "nb polyhedra",mesh.NbPolyhedrons()
36 cartHyp = cartAlgo.SetGrid(
"10",
"10",
"10", 1000000)
39 print "nb hexahedra",mesh.NbHexas()
40 print "nb tetrahedra",mesh.NbTetras()
41 print "nb polyhedra",mesh.NbPolyhedrons()
45 spaceFuns = [
"5",
"10+10*t"]
46 cartAlgo.SetGrid( [spaceFuns, [0.5]], [spaceFuns, [0.5]], [spaceFuns, [0.25]], 10 )
49 print "nb hexahedra",mesh.NbHexas()
50 print "nb tetrahedra",mesh.NbTetras()
51 print "nb polyhedra",mesh.NbPolyhedrons()
57 xDir = geompy.MakeVectorDXDYDZ( 1.0, 0.1, 0.0,
"xDir" )
58 yDir = geompy.MakeVectorDXDYDZ(-0.1, 1.0, 0.0,
"yDir" )
59 zDir = geompy.MakeVectorDXDYDZ( 0.2, 0.3, 1.0,
"zDir" )
60 face = geompy.MakePrismVecH( xDir, yDir, 1.0 )
61 box = geompy.MakePrismVecH( face, zDir, 1.0, theName=
"box" )
66 mesh = smesh.Mesh( box,
"custom axes")
67 algo = mesh.BodyFitted()
68 algo.SetGrid( spc, spc, spc, 10000 )
71 print " nb hex:",mesh.NbHexas()
74 algo.SetAxesDirs( xDir, [-0.1,1,0], zDir )
77 print " nb hex:",mesh.NbHexas()
80 algo.SetOptimalAxesDirs( isOrthogonal=
True )
82 print "Optimal orthogonal axes"
83 print " nb hex:",mesh.NbHexas()
86 algo.SetOptimalAxesDirs( isOrthogonal=
False )
88 print "Optimal non-orthogonal axes"
89 print " nb hex:",mesh.NbHexas()