X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Fdefining_hypotheses_ex08.py;h=285eae2ad63f29e0c67f65e220dfad39d51f241f;hb=7d57cfe3069f0be65c6773ff704c2642129b2bb8;hp=34fcbc37789f885feaa07b77de169fbcf349c28b;hpb=54182913fbb9df65a3f4cc96f55db3618835ecd8;p=modules%2Fsmesh.git diff --git a/doc/salome/examples/defining_hypotheses_ex08.py b/doc/salome/examples/defining_hypotheses_ex08.py index 34fcbc377..285eae2ad 100644 --- a/doc/salome/examples/defining_hypotheses_ex08.py +++ b/doc/salome/examples/defining_hypotheses_ex08.py @@ -4,14 +4,15 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a box -box = geompy.MakeBoxDXDYDZ(10., 10., 10.) +base = geompy.MakeSketcher("Sketcher:F 0 0:TT 10 0:TT 20 10:TT 0 10:WF", theName="F") +box = geompy.MakePrismDXDYDZ( base, 0,0,10 ) geompy.addToStudy(box, "Box") # get one edge of the box to put local hypothesis on @@ -20,7 +21,7 @@ EdgeX = geompy.GetEdgeNearPoint(box, p5) geompy.addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]") # create a hexahedral mesh on the box -hexa = smesh.Mesh(box, "Box : hexahedrical mesh") +hexa = smesh.Mesh(box, "Propagation of hypothesis") # set global algorithms and hypotheses algo1D = hexa.Segment() @@ -28,15 +29,37 @@ hexa.Quadrangle() hexa.Hexahedron() algo1D.NumberOfSegments(4) -# create a sub-mesh with local 1D hypothesis and propagation +# create a sub-mesh with local 1D hypothesis and "Propagation of 1D Hypothesis" algo_local = hexa.Segment(EdgeX) # define "Arithmetic1D" hypothesis to cut an edge in several segments with increasing length algo_local.Arithmetic1D(1, 4) -# define "Propagation" hypothesis that propagates all other 1D hypotheses -# from all edges on the opposite side of a face in case of quadrangular faces +# define "Propagation" hypothesis that propagates "Arithmetic1D" hypothesis +# from 'EdgeX' on opposite sides of all quadilateral faces algo_local.Propagation() -# compute the mesh +# compute the mesh which contains prisms hexa.Compute() + + +# create another mesh on the box +mesh = smesh.Mesh(box, "Propagation of distribution of nodes") + +# set global algorithms and hypotheses +algo1D = mesh.Segment() +mesh.Quadrangle() +mesh.Hexahedron() +algo1D.NumberOfSegments(4) + +# create a sub-mesh with local 1D hypothesis and "Propagation of Node Distribution" +algo_local = mesh.Segment(EdgeX) +algo_local.Arithmetic1D(1, 4) + +# define "Propagation Of Distribution" hypothesis that propagates +# distribution of nodes generated by "Arithmetic1D" hypothesis +# from 'EdgeX' on opposite sides of all quadilateral faces +algo_local.PropagationOfDistribution() + +# compute the mesh which contains hexahedra only +mesh.Compute()