Salome HOME
PR: synchro V6_main tag mergeto_V7_main_11Feb13
[modules/smesh.git] / doc / salome / examples / defining_hypotheses_ex01.py
1 # Arithmetic 1D
2
3 import geompy
4 import smesh
5
6 # create a box
7 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
8 geompy.addToStudy(box, "Box")
9
10 # create a hexahedral mesh on the box
11 hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
12
13 # create a Regular 1D algorithm for edges
14 algo1D = hexa.Segment()
15
16 # optionally reverse node distribution on certain edges
17 allEdges = geompy.SubShapeAllSortedIDs( box, geompy.ShapeType["EDGE"])
18 reversedEdges = [ allEdges[0], allEdges[4] ]
19
20 # define "Arithmetic1D" hypothesis to cut all edges in several segments with increasing arithmetic length 
21 algo1D.Arithmetic1D(1, 4, reversedEdges)
22
23 # create a quadrangle 2D algorithm for faces
24 hexa.Quadrangle()
25
26 # create a hexahedron 3D algorithm for solids
27 hexa.Hexahedron()
28
29 # compute the mesh
30 hexa.Compute()