X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Fdefining_hypotheses_ex01.py;h=a4083ba4934b66f69906f097d3c8b50f7930e2fd;hb=d85d605175efca167efafe15543f2212e9702b1b;hp=6efb1cfb9c9cb7fc67887bb09510a659b81c7e84;hpb=9a54694a0ab1e5cbc558a35c4606ceea4f7af2ef;p=modules%2Fsmesh.git diff --git a/doc/salome/examples/defining_hypotheses_ex01.py b/doc/salome/examples/defining_hypotheses_ex01.py index 6efb1cfb9..a4083ba49 100644 --- a/doc/salome/examples/defining_hypotheses_ex01.py +++ b/doc/salome/examples/defining_hypotheses_ex01.py @@ -1,7 +1,13 @@ -# Arithmetic 1D +# Arithmetic Progression and Geometric Progression -import geompy -import smesh +import salome +salome.salome_init() + +from salome.geom import geomBuilder +geompy = geomBuilder.New() + +from salome.smesh import smeshBuilder +smesh = smeshBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(10., 10., 10.) @@ -14,12 +20,20 @@ hexa = smesh.Mesh(box, "Box : hexahedrical mesh") algo1D = hexa.Segment() # optionally reverse node distribution on certain edges -allEdges = geompy.SubShapeAllSortedIDs( box, geompy.ShapeType["EDGE"]) +allEdges = geompy.SubShapeAllSorted( box, geompy.ShapeType["EDGE"]) reversedEdges = [ allEdges[0], allEdges[4] ] # define "Arithmetic1D" hypothesis to cut all edges in several segments with increasing arithmetic length algo1D.Arithmetic1D(1, 4, reversedEdges) +# define "Geometric Progression" hypothesis on one edge to cut this edge in segments with length increasing by 20% starting from 1 +gpAlgo = hexa.Segment( allEdges[1] ) +gpAlgo.GeometricProgression( 1, 1.2 ) + +# propagate distribution of nodes computed using "Geometric Progression" to parallel edges +gpAlgo.PropagationOfDistribution() + + # create a quadrangle 2D algorithm for faces hexa.Quadrangle()