6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
10 from salome.smesh import smeshBuilder
11 smesh = smeshBuilder.New(salome.myStudy)
14 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
15 geompy.addToStudy(box, "Box")
17 # get one edge of the box to put local hypothesis on
18 p5 = geompy.MakeVertex(5., 0., 0.)
19 EdgeX = geompy.GetEdgeNearPoint(box, p5)
20 geompy.addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]")
22 # create a hexahedral mesh on the box
23 hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
25 # set global algorithms and hypotheses
26 algo1D = hexa.Segment()
29 algo1D.NumberOfSegments(4)
31 # create a sub-mesh with local 1D hypothesis and propagation
32 algo_local = hexa.Segment(EdgeX)
34 # define "Arithmetic1D" hypothesis to cut an edge in several segments with increasing length
35 algo_local.Arithmetic1D(1, 4)
37 # define "Propagation" hypothesis that propagates all other 1D hypotheses
38 # from all edges on the opposite side of a face in case of quadrangular faces
39 algo_local.Propagation()