Salome HOME
Merge from V6_main 28/02/2013
[modules/smesh.git] / doc / salome / examples / defining_hypotheses_ex09.py
1 # Defining Meshing Algorithms
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 # 1. 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 # create a quadrangle 2D algorithm for faces
17 algo2D = hexa.Quadrangle()
18
19 # create a hexahedron 3D algorithm for solids
20 algo3D = hexa.Hexahedron()
21
22 # define hypotheses
23 algo1D.Arithmetic1D(1, 4)
24
25 # compute the mesh
26 hexa.Compute()
27
28 # 2. Create a tetrahedral mesh on the box
29 tetra = smesh.Mesh(box, "Box : tetrahedrical mesh")
30
31 # create a Regular 1D algorithm for edges
32 algo1D = tetra.Segment()
33
34 # create a Mefisto 2D algorithm for faces
35 algo2D = tetra.Triangle()
36
37 # create a 3D algorithm for solids
38 algo3D = tetra.Tetrahedron()
39
40 # define hypotheses
41 algo1D.Arithmetic1D(1, 4)
42 algo2D.LengthFromEdges()
43
44 # compute the mesh
45 tetra.Compute()