Salome HOME
Update of CheckDone
[modules/smesh.git] / doc / examples / defining_hypotheses_len_near_vertex.py
1 # Usage of Segments around Vertex algorithm
2
3 # for meshing a box with quadrangles with refinement near vertices
4
5 import salome
6 salome.salome_init_without_session()
7
8 from salome.geom import geomBuilder
9 from salome.smesh import smeshBuilder
10
11 geom_builder = geomBuilder.New()
12 smesh_builder = smeshBuilder.New()
13
14 # create a box
15 box = geom_builder.MakeBoxDXDYDZ( 10, 10, 10 )
16
17 # make a mesh
18 mesh = smesh_builder.Mesh( box )
19
20 # define quadrangle meshing
21 algo1d = mesh.Segment()
22 algo1d.LocalLength( 1. )
23 mesh.Quadrangle()
24
25 # add Hexahedron algo to assure that there are no triangles
26 mesh.Hexahedron()
27
28 # define refinement near vertices
29 algo1d.LengthNearVertex( 0.2 )
30
31 if not mesh.Compute(): raise Exception("Error when computing Mesh")