1 # Arithmetic 1D and Geometric Progression
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
9 from salome.smesh import smeshBuilder
10 smesh = smeshBuilder.New(salome.myStudy)
13 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
14 geompy.addToStudy(box, "Box")
16 # create a hexahedral mesh on the box
17 hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
19 # create a Regular 1D algorithm for edges
20 algo1D = hexa.Segment()
22 # optionally reverse node distribution on certain edges
23 allEdges = geompy.SubShapeAllSorted( box, geompy.ShapeType["EDGE"])
24 reversedEdges = [ allEdges[0], allEdges[4] ]
26 # define "Arithmetic1D" hypothesis to cut all edges in several segments with increasing arithmetic length
27 algo1D.Arithmetic1D(1, 4, reversedEdges)
29 # define "Geometric Progression" hypothesis on one edge to cut this edge in segments with length increasing by 20% starting from 1
30 gpAlgo = hexa.Segment( allEdges[1] )
31 gpAlgo.GeometricProgression( 1, 1.2 )
33 # propagate distribution of nodes computed using "Geometric Progression" to parallel edges
34 gpAlgo.PropagationOfDistribution()
37 # create a quadrangle 2D algorithm for faces
40 # create a hexahedron 3D algorithm for solids