Salome HOME
Merge from V6_main 28/02/2013
[modules/smesh.git] / doc / salome / examples / defining_hypotheses_ex08.py
1 # Propagation
2
3 from geompy import *
4 import smesh
5
6 # create a box
7 box = MakeBoxDXDYDZ(10., 10., 10.)
8 addToStudy(box, "Box")
9
10 # get one edge of the box to put local hypothesis on
11 p5 = MakeVertex(5., 0., 0.)
12 EdgeX = GetEdgeNearPoint(box, p5)
13 addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]")
14
15 # create a hexahedral mesh on the box
16 hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
17
18 # set global algorithms and hypotheses
19 algo1D = hexa.Segment()
20 hexa.Quadrangle()
21 hexa.Hexahedron()
22 algo1D.NumberOfSegments(4)
23
24 # create a sub-mesh with local 1D hypothesis and propagation
25 algo_local = hexa.Segment(EdgeX)
26
27 # define "Arithmetic1D" hypothesis to cut an edge in several segments with increasing length
28 algo_local.Arithmetic1D(1, 4)
29
30 # define "Propagation" hypothesis that propagates all other 1D hypotheses
31 # from all edges on the opposite side of a face in case of quadrangular faces
32 algo_local.Propagation()
33
34 # compute the mesh
35 hexa.Compute()