4 salome.salome_init_without_session()
6 from salome.geom import geomBuilder
7 from salome.smesh import smeshBuilder
9 geom_builder = geomBuilder.New()
10 smesh_builder = smeshBuilder.New()
13 base = geom_builder.MakeSketcher("Sketcher:F 0 0:TT 10 0:TT 20 10:TT 0 10:WF", theName="F")
14 box = geom_builder.MakePrismDXDYDZ( base, 0,0,10 )
15 geom_builder.addToStudy(box, "Box")
17 # get one edge of the box to put local hypothesis on
18 p5 = geom_builder.MakeVertex(5., 0., 0.)
19 EdgeX = geom_builder.GetEdgeNearPoint(box, p5)
20 geom_builder.addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]")
22 # create a hexahedral mesh on the box
23 hexa = smesh_builder.Mesh(box, "Propagation of hypothesis")
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 of 1D Hypothesis"
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 "Arithmetic1D" hypothesis
38 # from 'EdgeX' on opposite sides of all quadilateral faces
39 algo_local.Propagation()
41 # compute the mesh which contains prisms
44 # create another mesh on the box
45 mesh = smesh_builder.Mesh(box, "Propagation of distribution of nodes")
47 # set global algorithms and hypotheses
48 algo1D = mesh.Segment()
51 algo1D.NumberOfSegments(4)
53 # create a sub-mesh with local 1D hypothesis and "Propagation of Node Distribution"
54 algo_local = mesh.Segment(EdgeX)
55 algo_local.Arithmetic1D(1, 4)
57 # define "Propagation Of Distribution" hypothesis that propagates
58 # distribution of nodes generated by "Arithmetic1D" hypothesis
59 # from 'EdgeX' on opposite sides of all quadilateral faces
60 algo_local.PropagationOfDistribution()
62 # compute the mesh which contains hexahedra only